Unused classes gets compiled into swf

I am building a swc [MY.swc] component with compc. It is suppose to contain base functionality for MY.swf
I need to include another (third party) swc [OTHER.swc] into my own swc. This other swc has a reference to mx.core.mx_internal and I suspect that it is this reference that in the end, when I compile MY.swf, results in that all mx classes (mx.*) and all spark classes (spark.*) is included in MY.swf (seen when decompiling)
The difference in size between MY.swf with/without OTHER.swc is ~180kB.
The only difference (when decompiling) MY.swc with/without OTHER.swc is that the first has a reference to mx.core.mx_internal
Here is the compc part from my ANT task:
<compc output="MY.swc">
<include-sources dir="${project.root}/${SRC_ROOT}" includes="*" />
<library-path dir="${project.root}/${LIBS_DIR}" includes="*" />
</compc>
Do you know if there is a problem with compiling a swc into another swc?
Any other ideas why all mx and spark classes are included?
Thanks!

I solved my own problem:
Needed to set append flag (in library-path) to false when building MY.swf
<compiler.library-path dir="${project.root}" append="false">
  <include name="${LIBS_DIR}" />
</compiler.library-path>
Have not yet figured out exacly why, but it resulted in that the unused classes were not compiled.

Similar Messages

  • Do unused libraries get compiled into the binary file?

    So if I import all classes inside flash.display.* and only use Sprite, will everything get compiled?
    Or only Sprite?

    In general, only the classes you actually use are compiled in -- the import statement just tells the compiler where to look to try to find code to compile.
    However...
    Since flash.display.* are all native classes, none of them are ever included in your .air file (desktop) or .apk file (Android) or .swf file (Flash Player), because the flash.display.* classes are built into the AIR/Flash Player runtime and their definitions exist there.
    However...
    If you build an AIR for iOS app, the runtime has to be compiled in as part of your app. Currently the entire runtime is compiled into your app, regardless of whether you use certain parts of it or not. (The same is true if you use a captive runtime for your desktop or Android AIR app.)
    Paul

  • CSS file compiled into SWF...

    Hello,
    I have a problem with all my css files in my Flex project. I
    need them to be compiled into SWF because its the only way to load
    and switch them at runtime.
    I use a ClassReference to a custom programmatic skin in the
    css file:
    skin: ClassReference(
    "com.someawsomepackage.util.manager.SkinManager" );
    MY PROBLEM is that I HAVE TO place the various css file in
    the ROOT folder of my project so that the compiler can find and
    compile this classreference along with the css.
    I would like to place the css files into a style folder...
    But I will get a compile error if I do so.
    Anyone has an idea ? thx !

    did you try compiling them manually from the command line using mxmlc?

  • [svn] 4492: Simplified how an accessibility class gets hooked into its corresponding component class .

    Revision: 4492
    Author: [email protected]
    Date: 2009-01-12 14:47:10 -0800 (Mon, 12 Jan 2009)
    Log Message:
    Simplified how an accessibility class gets hooked into its corresponding component class.
    We now do the hooking in the static method enableAccessibility(), which is called by code that is autogenerated by the compiler. Previously this method did nothing and the hooking happened at static initialization time. This allows us to remove the static var accessibilityHooked and the static method hookAccessibility() in each accessibility class.
    QE Notes: None
    Doc Notes: None
    Bugs: None
    Reviewer: Deepa and Alex
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/AccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/AccordionHeaderAccImpl. as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/AlertAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/ButtonAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/CheckBoxAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/ColorPickerAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/ComboBaseAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/ComboBoxAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/DataGridAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/DateChooserAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/DateFieldAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/LinkButtonAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/ListAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/ListBaseAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/MenuAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/MenuBarAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/PanelAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/RadioButtonAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/SliderAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/TabBarAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/TitleWindowAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/TreeAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/UIComponentAccProps.as

    Was it really necessary to post the whole API description?!?
    Locale[] locales = Locale.ENGLISH();ENGLISH is not a method in class Locale, so do not add the braces "( );".
    Also, the constant ENGLISH is not an array, but just a single Locale object.
    You didn't say what your problem was. What do you want to achieve with your program and what is it that you don't understand?

  • One class type compiles into many .class files

    I have written a single large GUI file that is composed of a single class (FCTabGui class). When I run javac FCTabGui.java it generates around 190 classes with the same name (FCTabGui) but each one after the first is attached with $# at the end (ie FCTabGui$1.class, ..., FCTabGui$189.class) . I have never seen this before. Does anyone know why this is happening and how I can keep it to just one .class file instead of 190. Thanks.
    Jason

    What I meant by "standard to jar up files for a GUI"
    is that if there are lots of buttons that create
    anonymous classes then you HAVE to jar up the files
    because there is no alternative to it. One cannot
    preserve the single .class file setup with a GUI,
    unless its really small and has no action listeners.I suppose you could contort your code so that the single class not only creates all the widgets but also acts as the single action listener for every single button. This way you could avoid creating anonymous inner classes. But anyone who needs to maintain your code will grow to hate you.
    One can double click on a jar file and it will start
    running automatically, (assuming the JRE is
    installed), right?You can do that, but it's not automatic. You have to explicitly list what class has the main() method to invoke when the jar is double clicked. If you're using a wizard to create the jar, this may be easily specified. Otherwise you can do it by creating a jar manifest file with a "Main-class:" attribute.

  • Want to get Captivate 2 .swf into ebook

    I am trying to move a course from CD to ebook. All I have are the autorun CD files, including the .swf file; the .cp file cannot be found and the person who created it is longer with the company. The .swf contains screen snaps and voice over, as well as some cursor animation. My problem is that the .swf file starts playing as soon as the student goes to the ebook page that contains the .swf file.
    To the best of my knowledge I can't use the player skin that comes with Captivate without the .cp file, so my proposed solution is to import the .swf into Adobe Flash CS3 Professional, add controls and code that has the movie stopped when opened, and save it as a more user-friendly .swf for the ebook. I am a technical writer, not a programmer, and even though I have spent many hours searching the internet and even reading a book or two about Flash programming, I cannot get a working .swf file. I'm wondering if anyone can point me to example code that will do what I need. I found out about rdcmnd functions and the advantage of the MovieClipLoader class over the loadMovie method, but I seem to be unable to put it all together in a working .swf.
    I agree with Captiv8r that a decompiler for Captivate .swf files would be good.

    Thanks Captiv8r.
    I tried that with no change in behaviour as a result. The video still begins playing as soon as the page it is on opens. This is now my html with the added line:
    <OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
            codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
            width="801" height="601">
            <param name="movie" value="excercise1.swf">
            <param name="quality" value="high">
            <param name="bgcolor" value="#FFFFFF">
            <param name="loop" value="False">
            <param name="play" value="False">
            <EMBED src="excercise1.swf" quality="high" bgcolor="#FFFFFF" width="801" height="601" loop="0" type="application/x-shockwave-flash"
                   pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">
            </EMBED>
    </OBJECT>
    According to the forum administrator at Help and Manual (http://helpman.it-authoring.com/viewtopic.php?f=19&t=7681&hilit=flash+swf)
    "How Flash files are played is controlled  entirely by the Flash file itself. You  will need to consult the Captivate documentation or Adobe on this. I  think the settings are somewhere in the skins but I don't remember  offhand."

  • Compiling CSS into SWF, folders

    Hello all!
    I'm compiling a few CSS files into SWF to have them available
    at runtime. Unfortunatly, these are currently located in the root
    directory of my application but I would like them to be in a style
    folder. Any idea on how to do it (At compile time)?
    Even by editing the .actionscriptproperties, it doesnt change
    anything:
    <buildCSSFileEntry destPath="bin-debug/style"
    sourcePath="flex_src/style.css"/>
    Also I'm talking about the destination folder only since the
    css file won't compile if I place it somewhere else than the root
    directory ( it uses a classreference )

    Hi,
    In you rsl project properties, go to Flex Library Build Path and go to library path tab. Here you can edit your imported library. There's no need in RSL to import the libraries merge into code but external(even the Adobe libraries should be loaded as external) cause you load it already from your application project (as rsl or merge into code).
    Bye!

  • When publishing a captivate I get the message "Swf compilation failed. Note: Please verify if any of the actionscript keywords is used as user variable name." and it won't allow me to publish the Captivate, can anyone help?

    When publishing a captivate I get the message "Swf compilation failed. Note: Please verify if any of the actionscript keywords is used as user variable name." and it won't allow me to publish the Captivate, can anyone help?

    Hi There,
    Can you tell me the Operating System and Captivate version you are using?
    Also can you confirm if you are getting this issue will this one project or all the projects? Try to copy paste this project on a new blank project and then try to publish.
    Regards,
    Mayank

  • Is there any way to compile FLA files into SWF files on the command line?

    I am using Adobe Flash CS4 Professional on Windows XP.  To facilitate automated nightly builds, I have been searching for a way to compile my SWF files from the FLA files under source control, but without luck.  The tools in the Flex SDK looked promising, but we do not use Flex.  Thanks!

    Seen these?

  • How do you get rid of the white background when importing.mov into SWF ?

    i'm working with a .mov file importing it into SWF
    example here of the object:    http://www.highlandmeditation.com/?page_id=2288
    is there a way in Flash CS4 where i can remove the white background that surrounds the movie?
    its not on the .mov file originally only when i port into SWF
    thanks for your help

    Well when you are finished drawing a picture when you select it you are able to make the drawings background transparent so when you put it on top of something else the background doesnt show up or you can have the background visible.

  • My class only compiles in Java 1.6 and not in Java 1.5

    Hi, my java class wont compile in java 1.5, it only compiles in Java 1.6. How can i compile the following?
    import java.util.*;
    public class ShoppingBasket
         Vector products;
         public ShoppingBasket() { products = new Vector(); }
         public void addProduct(Product product)
         boolean flag = false;
         for(Enumeration e = getProducts(); e.hasMoreElements();)
              { Product item = (Product)e.nextElement();
                   if(item.getId().equals(product.id))
                   {flag = true; item.quantity++; break; }
              if(!flag){ products.addElement(product);}
         public void deleteProduct(String str)
              for(Enumeration e=getProducts();
              e.hasMoreElements();)
              { Product item = (Product)e.nextElement();
                   if(item.getId().equals(str))
                   {products.removeElement(item); break; }
         public void emptyBasket(){products = new Vector();}
         public int getProductNumber(){ return products.size();}
         public Enumeration getProducts() { return products.elements(); }
         public double getTotal()
         Enumeration e = getProducts();
         double total; Product item;
         for(total=0.0D;e.hasMoreElements();     total+= item.getTotal())
         {item = (Product)e.nextElement(); }
         return total;
    }It should link with a class called Product which compiles fine... the errors i get are below:
    K:\jakarta-tomcat-5.0.18\webapps\ROOT\WEB-INF\classes\ShoppingBasket\ShoppingBas
    ket.java:6: cannot find symbol
    symbol  : class Product
    location: class ShoppingBasket
            public void addProduct(Product product)
                                   ^
    K:\jakarta-tomcat-5.0.18\webapps\ROOT\WEB-INF\classes\ShoppingBasket\ShoppingBas
    ket.java:10: cannot find symbol
    symbol  : class Product
    location: class ShoppingBasket
                    { Product item = (Product)e.nextElement();
                      ^
    K:\jakarta-tomcat-5.0.18\webapps\ROOT\WEB-INF\classes\ShoppingBasket\ShoppingBas
    ket.java:10: cannot find symbol
    symbol  : class Product
    location: class ShoppingBasket
                    { Product item = (Product)e.nextElement();
                                      ^
    K:\jakarta-tomcat-5.0.18\webapps\ROOT\WEB-INF\classes\ShoppingBasket\ShoppingBas
    ket.java:20: cannot find symbol
    symbol  : class Product
    location: class ShoppingBasket
                    { Product item = (Product)e.nextElement();
                      ^
    K:\jakarta-tomcat-5.0.18\webapps\ROOT\WEB-INF\classes\ShoppingBasket\ShoppingBas
    ket.java:20: cannot find symbol
    symbol  : class Product
    location: class ShoppingBasket
                    { Product item = (Product)e.nextElement();
                                      ^
    K:\jakarta-tomcat-5.0.18\webapps\ROOT\WEB-INF\classes\ShoppingBasket\ShoppingBas
    ket.java:35: cannot find symbol
    symbol  : class Product
    location: class ShoppingBasket
            double total; Product item;
                          ^
    K:\jakarta-tomcat-5.0.18\webapps\ROOT\WEB-INF\classes\ShoppingBasket\ShoppingBas
    ket.java:36: inconvertible types
    found   : <nulltype>
    required: double
            for(total=0.0D;e.hasMoreElements();     total+= item.getTotal())
                                                                         ^
    K:\jakarta-tomcat-5.0.18\webapps\ROOT\WEB-INF\classes\ShoppingBasket\ShoppingBas
    ket.java:37: cannot find symbol
    symbol  : class Product
    location: class ShoppingBasket
            {item = (Product)e.nextElement(); }
                     ^
    8 errors

    fahafiz wrote:
    ah, so should i put the classes into the folder which the classpath is assigned to?More likely you should assign your classpath to whatever folder your classes are in.
    Put your files where they make sense, and then fill in classpath accordingly:
    javac -classpath classpath MyFile.java(I think, it's been a while since I compiled from the command-line, see http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javac.html)

  • How to integrate a .abc file into swf by using mxmlc?

    Enviroment: CrossBridge1.0.1, Flex SDK 4.6
    I use g++ to compile 2 .cc files (the c2as wrapper) & a .a file (the logic)  into a .swc file; then use this .swc as a library for mxmlc to compile the main .as file.
    The Makefile is as follows:
    "$(FLASCC)/usr/bin/g++" $(BASE_CFLAGS) -O4 -L. main.cc test_as3.cc -lmytest -emit-swc=sample.mytest -o mytest.swc
    "$(FLEX)/bin/mxmlc" -static-link-runtime-shared-libraries -library-path=mytest.swc -debug=false MainView.as -o test.swf
    everything is ok.
    But when I add some function calls in .as file, it uses the CModule package:
    in MainView.as:
    import com.adobe.flascc.CModule;
    CModule.malloc
    CModule.writeBytes
    CModule.free
    the mxmlc complains that
    Access of undefined property, CModule.malloc,
    Access of undefined property, CModule.writeBytes,
    Access of undefined property, CModule.free
    Definition com.adobe.flascc:CModule could not be found.
    I found the CModule.abc in sdk/usr/lib folder, and I explored that it do have those functions. but how to import this .abc package into .swf ?
    the follow command doesn't work:
    "$(FLEX)/bin/mxmlc" -static-link-runtime-shared-libraries -library-path=mytest.swc  -import CModule.abc -debug=false MainView.as -o test.swf

    First, you should check out the new version at CrossBridge — CrossBridge
    1.0.1 is quite old.
    For your problem, you don't need to compile Cmodule.abc into your swf, it is already present into your SWC file. Here is the reason why your import is not working.
    When you compile directly to SWF with crossbridge, the compiler put all the crossbridge stuff (CModule included) into the com.adobe.flascc namespace.
    The problem is that, when you build a SWC, there is no garantee that your end application won't include multiple SWC compiled by crossbridge. To prevent namespace clashing, (having multiple Cmodule under the same namespace), all the stuff in the SWC is namespace with the namespace you gave after the -emit-swc command. In this particular case "-emit-swc=sample.mytest"  your namespace is "sample.mytest".
    So you need yo change the import from :
    import com.adobe.flascc.CModule;
    to
    import sample.mytest.CModule;
    and it should work.
    More detail in the documentation : http://crossbridge.io/docs/Reference.html#section_gcc
    Building SWCs
    A SWC is the Flash Runtime equivalent of a shared library. You can link a SWC into a pure ActionScript project either with an IDE (Flash Builder, for example), or via the command-line ActionScript compiler (named mxmlc). A SWC contains the compiled ActionScript bytecode, along with an API catalog so that Flash Builder can perform code hinting while a developer writes ActionScript that uses the API exposed by a SWC.
    When you generate a SWC you must specify an AS3 package name to contain the generated code, and the internal Crossbridge boilerplate code. This lets you link multiple Crossbridge-generated SWCs into one SWF without any function or class collisions. Anywhere you would have previously seen a name starting with com.adobe.flascc this namespace will be replaced with the string passed in the gcc/g++ -emit-swc=... argument.
    -emit-swc=
    Emits a SWC that can be linked into a Flash Builder project or distributed for others to link into their own projects. You must specify the namespace that you want to use to replace the default com.adobe.flascc namespace, this lets you link multiple Crossbridge-generated SWCs into a single project.

  • Get Path from SWF

    Hi,
    I've found function drawPath() which allows to create different shapes from two vectors... the first with commands for drawing and the second with coordinates (http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/display/Graphics.html#drawPath())
    So can I get these vectors from some shapes back?
    Actually, I need some solution for getting coordinates and commands from shapes which compiled as SWF.
    I wish to use some shapes like patterns.. so I really need additional information about these objects... May be a possibility to convert SWF to svg or something another?
    Thanks

    There is no API for reading back the graphics that are drawn into a SWF.  Maybe someday.
    It is possible to decode a SWF and see what its shapes contain, but that is a lot of work.  The SWF spec should be available on the internet.
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • "The class being compiled does not match the class that was imported"

    ----------Actions on timeline in
    sixSpices/updateSite/updateSite.fla----------
    import com.sixspices.updater.view.*;
    var calDrawer:CalendarView = new CalendarView(); //Listener /
    view
    ----------sixSpices/com/sixspices/updater/view/CalendarView.as
    file----------
    class CalendarView {
    public function CalendarView(){
    public function onRecieveData(listOfEvents:Array) {
    displayEvents(listOfEvents);
    public function displayEvents(listOfEvents:Array):Void {
    trace(listOfEvents);
    When I test the movie (updateSite.swf) in flash, it gives me
    the error:
    The class being compiled, 'CalendarView', does not match the
    class that was imported,
    'com.sixspices.updater.view.CalendarView'.

    Here is my file structure:
    sixSpices
    -->updateSite
    -->-->updateSite.fla
    -->-->updateSite.swf
    -->com
    -->-->sixSpices
    -->-->-->updater
    -->-->-->-->view
    -->-->-->-->-->Calendar.as
    If I move updateSite.fla to the folder sixSpices so that
    "com" is in the same folder as it, I get the same error.
    The following works with no problems (no similar error):
    ----------Actions on timeline in
    sixSpices/updateSite/updateSite.fla----------
    import com.sixspices.updater.model.*;
    var calModel:CalendarOverview = new CalendarOverview();
    //Broadcaster / model
    ----------sixSpices/com/sixspices/updater/model/CalendarOverview.as
    file----------
    import com.sixspices.updater.model.*;
    import mx.utils.Delegate;
    import mx.events.EventDispatcher;
    class CalendarOverview {
    public function CalendarOverview(){
    }

  • I just want my classes to compile.

    Hello,
    I'd just like to do something simple: compile a test class in
    AS3.0 (Flash CS3 on Mac OSX 10.4).
    Not having any luck, nor can I find any documentation. Hoping
    someone can help here. Here is what I have set up:
    - file structure: Inside a folder called "Notation" i have
    the files "editField.as" and "editFieldTest.fla"
    - class path: Points to the "Notation" folder
    - code in the "editField.as" file is:
    package Notation {
    import flash.display.MovieClip;
    public class editField extends MovieClip { //Compiler wanted
    me to extend MovieClip
    function editField() {
    trace( "editField.class" );
    - code in frame 1 of "editFieldTest.fla":
    import Notation.editField;
    var tf:editField = new editField();
    I've played with this a lot and the error messages vary. All
    I need is the correct way to set this up to get the class to
    compile.
    Thanks.
    Mark Goodes
    Flash MX expert
    Flash 3.0 newbie

    Thanks for the quick reply, kglad. Love your site!
    Unfortunately though when I tried your suggestion it didn't
    fix the problem. I got the error message:
    5001: The name of package 'Notation' does not reflect the
    location of this file. Please change the package definition's name
    inside this file, or move the file.
    /Users/markgoodes/Documents/Flash CS3
    Projects/Notation/editField.as
    I really wish the message would tell us which change was
    required instead of making us guess.
    Mark

Maybe you are looking for