Using mxmlc to compile AS files

Hi there,
I'm wondering if there's a way to compile all classes into 1 swf file? As it is, I have a command that does "mxml -includes classA classB -output classC.swf classC"
and although I have classC.swf, when I load it on my webpage, it makes two extra requests for classA and classB. Is there anyway for me to combine all the classes into classC.swf?
Thanks!

What if you have an MXML file where you "include" A, B and C?
If this post answers your question or helps, please mark it as such.
Greg Lafrance - Flex 2 and 3 ACE certified
www.ChikaraDev.com
Flex Training, Tutoring, Contracting, and Support Services

Similar Messages

  • Using jikes to compile jsp files

              Hello !
              Where can i find a easy installation about jikes/WLS 6.0 sp6
              to compile jsp files ?
              Regards,
              jsanza
              

    just change the compile command for 6.x in weblogic.xml
              kumar.
              "jsanza" <[email protected]> wrote in message
              news:3b814a50$[email protected]..
              >
              > Hello !
              >
              > Where can i find a easy installation about jikes/WLS 6.0 sp6
              > to compile jsp files ?
              >
              > Regards,
              >
              > jsanza
              >
              

  • 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.

  • Error message when compiling book "file is corrupt" referring to a photo.  Or "cannot find original photo".  Can you use photos that have been "edited" out of "Book Mode"?

    Error message when compiling book "file is corrupt" referring to a photo.  Or "cannot find original photo".  Can you use photos that have been "edited" out of "Book Mode"?

    I did copy it to my desktop, but it still won't let me open it.  I think the file on the disc might be corrupt or something like that though the cd itself checks out fine as far as viruses go.  I was able to verify the disc, but that's about it.  My husband tried it on his iMac and we have the same issue.  It's unzipping the folder, but won't let us open the folder on both the Mac Book Pro or the iMac by double clicking, going to file/open or right clicking.  It just keeps saying the same message as I posted above.  I think I'm just going to have the client put the pictures on either a memory card or a USB memory stick so she won't have to compress the files for zipping purposes.  It's been too frustrating trying to open this folder on this cd she gave me.  She said she created/zipped the cd on her Mac Book Pro but it sure won't open on mine.

  • How to compile Java files using Ant in Eclipse

    Hi All ,
    I would like to compile all Java files using Ant in Eclipse.Since am very new to Ant and Eclipse can someone help me to create a build.xml file and let me know how to compile all the java files.
    For ex , I have placed my java files inside the path C:\HEC\Terab.Initially the Terab folder holds 7 jar files which i had decompiled using JD compiler and placed the unzipped 7 folders (which contains the java files ).Now i have imported the HEC project into Eclipse using New ->Project ->Java Project.after importig it throwed me an error saying missing jar files.again i copied the jar files and placed inside Terab folder with other 7 folder.
    Now How i can compile the java files and convert in to class files.Then after compiling the files i will again need to jar all the 7 folder.
    Please tell me the steps i need to follow.How to write an build.xml file ? where i should keep it ? only one build.xml file is enough or should i write 7 build.xml file for each folder ? Please help me out...
    Thanks & Regards
    Kar1983

    put it another way, what I am trying to do is to compile David Brackeen's ch 18 code from his book. The java sourse files can be downloaded here:
    http://www.brackeen.com/javagamebook/
    my question is that how would I complie all of these file so that I can get the program in ch18src\src\com\brackeen\javagamebook\test\ to run?

  • Discover: error: The file /a.out was linked by an older link step. Please use the latest compiler to do the link.

    Hi,
    I have installed Solaris studio and wanted to use the memory analyzer from there. I am trying it on a sample program, but it returns the above error and does not instrument the executable. Could you please help me tracing where am I going wrong.
    # which cc
    /opt/SolarisStudio12.3-solaris-sparc-bin/solarisstudio12.3/bin/cc
    # /opt/SolarisStudio12.3-solaris-sparc-bin/solarisstudio12.3/bin/cc -V
    cc: Sun C 5.12 SunOS_sparc 2011/11/16
    # cc -g -O2 test.c
    # file a.out
    a.out:          ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, dynamically linked, not stripped
    # ldd ./a.out
            libc.so.1 =>     /usr/lib/libc.so.1
            libm.so.2 =>     /usr/lib/libm.so.2
            /platform/SUNW,Sun-Blade-1500/lib/libc_psr.so.1
    # /SolarisStudio12.3-solaris-sparc-bin/solarisstudio12.3/bin/discover -w - ./a.out
    discover: error: The file /a.out was linked by an older link step. Please use the latest compiler to do the link.
    Regards,
    Vikkal

    ok. Thanks for the info.
    Could you check if a small test works on your system ?
    You could use this test :
    % cat a.c
    #include <stdio.h>
    #include <stdlib.h>
    int main()
            int *x = (int*)malloc(100);
            printf("x[0]=%d\n", x[0]);
            return 0;
    % cc a.c -g -xannotate
    % discover -w - -o a.out.disc a.out
    % ./a.out.disc
    ERROR 1 (UMR): accessing uninitialized data "*x" at address 0x8090008 (4 bytes) on the heap at:
            main() + 0xc2  <a.c:8>
                     5:    {
                     6:     int *x = (int*)malloc(100);
                     7:
                     8:=>   printf("x[0]=%d\n", x[0]);
                     9:
                    10:     return 0;
                    11:    }
            _start() + 0x71
        was allocated at (100 bytes):
            main() + 0x5e  <a.c:6>
                    3:
                    4:    int main()
                    5:    {
                    6:=>    int *x = (int*)malloc(100);
                    7:
                    8:      printf("x[0]=%d\n", x[0]);
                    9:
            _start() + 0x71
    x[0]=0
    ***************** Discover Memory Report *****************
    1 allocation at 1 location left on the heap with a total size of 100 bytes
        LEAK 1: 1 allocation with total size of 100 bytes
            main() + 0x5e  <a.c:6>
                    3:
                    4:    int main()
                    5:    {
                    6:=>    int *x = (int*)malloc(100);
                    7:
                    8:      printf("x[0]=%d\n", x[0]);
                    9:
            _start() + 0x71
    DISCOVER SUMMARY:
            unique errors   : 1 (1 total)
            unique warnings : 0 (0 total)

  • Need help -how to use a GUI to compile a file

    hello peeps,
    I have this problem, let's get directly into it, i have a program that has GUI with a Text Area that im going to copy a text file into it (using JFileChooser FileReader and readLine() ...) so i have radio buttons like (view, compile and execute) and an OK button to get the selected option, what i want to know is how to compile the file that is in the text area, like how to get to the MS-dos console and javac to start. i hope this description is clear, and i'll be very appreciative for any help!

    thanks for your response, but its not working it keeps on throwing IOException, i tried to put a direct string into it like (Runtime.getRuntime().exec("javac MyClass.java"); and same thing happend. Am i missing something? like is there something to add before calling that line of code? i did import Runtime
    ok here is how my code looks like:
       if(compile.isSelected())
                       try
                       //name of the file im pasting into the text area  
                       String filename = file.getName();
                       Runtime.getRuntime().exec("javac" + filename);
                       catch (IOException e)
                         System.out.println("error compiling program");
                   }

  • How to solve "Error: Invalid Embed directive in stylesheet - can't resolve source" while building using mxmlc.exe on command prompt

    Hi,
    Currently, I am developing a powershell script for Flex build automation.
    I found some problem and have been trying to search any references and tried any ways to fix it but It did not work.
    I am using compc.exe for compiling the libraries and it works fine.
    I compiled css files into swf files using mxmlc.exe and it works fine.
    However, I have a problem while building my main application (mxml file).
    It complains about embedded resources.
    I run this command, it works fine:
    "C:\Program Files (x86)\Adobe\Flex Builder 3\sdks\3.2.0\bin\mxmlc.exe" "C:\{somePath}\FlashClient\src\styleLang.css" -output "C:\{somePath}\FlashClient_deploy\styleLang.swf"
    However, when I tried to run these command on cmd for testing:
    "C:\Program Files (x86)\Adobe\Flex Builder 3\sdks\3.2.0\bin\mxmlc.exe" "C:\{somePath}\FlashClient\src\FlashClient.mxml" -load-config "C:\{somePath}\FlashClient\src\dump_config_temp.xml" -output "C:\{somePath}\FlashClient_deploy\flashclient_test.swf"
    I got a lot of this error message:
    this is my folder structure:
      FlashClient
      |
      |---assets
      |---src
          |
          |---FlashClient.mxml
          |---FlashClient.as
          |---FlashClientStyleLoopup.css
          |---styleLang
    Already tried to add / at the beginning of the relative paths but It did not work.
    Also tried to compile one of the image to a swc file and include it on the dump_config, but also did not work. something similar with Tech Diary: Flex : Solution to Error: unable to resolve '/assets/icons/icon.png' for transcoding using Embed tag
    Does anyone know how flex builder resolve the relative path to make the embedded resources work? or how to fix this?
    I've been trying to work on it for days but haven't had any luck.
    Will be really appreciate it if someone could help me with this.
    Many Thanks.

    Hi,
    make sure you are using 32 bit Java JDK. Check that your systems variables CLASSPATH, JAVA_HOME are pointing to correct 32 bit Java JDK folder (e.g. CLASSPATH=C:\Program Files (x86)\Java\jdk1.8.0_25 and JAVA_HOME=C:\Program Files (x86)\Java\jdk1.8.0_25). Also make sure you have 32 bit Java JDK's "bin" folder in your system's variable PATH.

  • Embed img using mxmlc, Linux/gij

    Hi,
    I'm trying to embed an image into a .swf. I am compiling from
    a .as file using mxmlc on Linux using gij 4.1.1. The compile step
    always generates the following fatal error:
    MyTest.as(60): col: 3: Error: exception during transcoding:
    Failed to grab pixels for image /files/test.png
    It fails likewise for GIF, JPG, etc. Fails regardless of
    filetype.
    Source code is just a simple embed directive:
    [Embed(source='./test.png')]
    private var MyPhoto:Class;
    Anyone else seen this?

    I'm also having this issue on linux. Same build works
    flawlessly on windows and mac.
    Anyone have more information?

  • Using servlet to generate XML file

    What I want to do is simple but can't work. Hope you guys can give me a hint.
    I succesfully generate XML file in command line using Oracle XML parser and class generator. Then I was trying to do it using servlet. it compiles fine but generate NullPointer exception at the line:
    Emp e1= new Emp(); //Emp is the root of XML
    I suspect the Emp constructor can't correctly find the globalDTD in its superclass -CGDocument. Please note this only happens in servlet setting, not is command line setting. Any suggestion to get arounf this?
    Another unrelated question is that when I create a XML file using the Oracle XML parser, it seems all the elements a file has to be added once, otherwise the compiler will compalain about the missing element. this will be inconvinient when I constructing a big XML file, which I 'd liek to split into small piece and add them up. Maybe there is a good way but I just don't know it.
    my email: [email protected]

    Hi,
    I'm running into the same problem deploying the classes generated by the class generator. Code works fine from JDeveloper, but had to put my DTD in the directory where my classes are. Deploying the classes with Apache's JServ gives me a NullPointer exception on the first addNode method. I guess it can't find the DTD. I tried to put the DTD in many locations but this didn't fix the problem. Any suggestions?
    Steve,
    Did you fix this problem? Thanx!
    null

  • Error while compiling java file

    Hi, im newby in java,
    i was trying to compile java files, and after that i will use it in JSP as javabean.
    I have 2 files already, the first file is a connection code, and its compiled successfully, it looks like this
    i named this as ConnectionBean.java
    package my_package;
    import java.sql.*;
    public class ConnectionBean {
         private Connection con;
         private static final String driver = "org.postgresql.Driver";
         private static final String url = "jdbc:postgresql://localhost:5432/PSQLDS";
         private static final String username = "postgres";
         private static final String password = "mypassword";
         public ConnectionBean() {
         public Connection logOn() {
              try {
                   Class.forName(driver); con = DriverManager.getConnection(url, username, password); }
              catch(ClassNotFoundException e) {
                   System.err.println("ConnectionBean: driver unavailable..."); con = null; }
              catch (SQLException e) {
                   System.err.println("ConnectionBean: driver not loaded..."); con = null; }
              return con;
         public void logOff() {
              try {
                   con.close(); }
              catch (Exception e) {
                   e.printStackTrace(); }
    as you can see above im using "package", and yes i have manage to put all my java files within the correct path (ROOT\WEB-INF\classes\my_package)
    And also, i have test this class as javabean on JSP file and it works.
    There for i continue to create the second java file, as a purpose to create a back engine for JSP. I use the same package as ConnectionBean.java, it looks like this
    i named this as ListPageEngine.java
    package my_package;
    import java.beans.*;
    import java.sql.*;
    public class ListPageEngine {
         public static void main(String[] args) {
              ConnectionBean conBean = new ConnectionBean();}
    on compiling process using command "javac ListPageEngine.java", i get this error message
    ListPageEngine.java:11: cannot find symbol
    symbol : class ConnectionBean
    location: class my_package.ListPageEngine
    ConnectionBean conBean = new ConnectionBean();}
    ^
    ListPageEngine.java:11: cannot find symbol
    symbol : class ConnectionBean
    location: class my_package.ListPageEngine
    ConnectionBean conBean = new ConnectionBean();}
    ^
    2 errors
    I think, i am pretty much sure that all my configuration (wheater its Apache TomCat, Environment Variable or PostgreSQL server) was good, as a prove, i was able to use ConnectionBean.class in my JSP file.
    I susspect the problem is related with "package", seems i cannot use ConnectionBean class within ListPageEngine class when i use package.
    For another information, i didn't install such thing as J2EE, i only install JDK 1.5, i also guess this might be the cause.
    Right now im all stuck, i try to find thread which might be related with my problem but i failed to find it, most of them get the same answer by UncleSAM which are
    Try the following forum (about JSP technology)
    http://forum.java.sun.com/forum.jspa?forumID=45
    JavaBeans spec contains nothing about JSP, but JSP spec describes using of beans.
    i hope my question is clear so anyone who might have experience or clue with this problem might be able to help me.
    Thanks before

    finally folks, i found answer to my own problem hehehehe..
    the problem is on the compiling command (javac ... my_file.java), i found that i need to add some parameter on the command to make it works.
    This problem solved.

  • In PI 7.1 - Java UDF's Compiled Class files - Jar File location

    Hi All,
    In PI 7.1 Does anybody know where the compiled Java UDF's (which are used in Graphical mapping) class files stored in jar are located in integration server? I want to use this jar file in my XSLT mapping.

    Hi,
    I guess it would be under
    \usr\sap\<SID>\DVEBMGS00\j2ee\cluster\server0\temp\classpath_resolver
    or
    \usr\sap\<SID>\DVEBMGS00\j2ee\cluster\server0\.\temp\classpath_resolver
    Where SID is your XI instance name.
    Thanks,
    Gujjeti
    Edited by: Praveen Gujjeti on Jun 23, 2008 5:12 PM

  • Problem in compiling j2me file

    Hello friends,
    friends my problem in compiling j2me file..
    when i compile my j2me file through WTK2.2 (toolkit)
    then it creates extra file including j2me" .class" file..
    for example if my j2me file is "aman.java" and when i compile it
    then it will covert into "aman.class" file but it creates one more file like "aman1$.class" ..plz help me to get out of this problem..coz its increase my j2me file size..
    thanks
    Aman

    That is an inner class in aman.java that you are seeing there.
    If you use inner anonymous classes, for example;
    public class MyMIDlet extends MIDlet {
       // code for the MIDlet
       // Anonymous inner class
       setCommandListener(new CommandListener() {
          public void commandAction(Command c, Displayable d) {
            // implementation;
            // may access MyMIDlet's private fields
    }then the command listener you create will become another class named MyMIDlet$1.class.
    In this example you can get rid of the inner class by making one of the existing classes implement that CommandListener interface:
    public class MyMIDlet extends MIDlet implmements CommandListener {
       public void commandAction(Command c, Displayable d) {
         // implementation;
         // may access MyMIDlet's private fields
       // code for the MIDlet
       // Instead of the anonymous inner class, we can now use MyMIDlet since it
       // implements CommandListener
       setCommandListener(this);
       // etc. etc. etc.
    }shmoove

  • Problem with JSP using bean packaged in jar file

    Hi,
              I am trying to use a java bean in a jsp file. The java bean is packaged
              into a jar file. I am getting class not found compilation error. If the
              bean remains to be a seperated class file, everything work well.
              Does anyone know how I can use bean in a jar file within jsp , i.e. to
              allow the bean to be found during compilation ?
              Thanks,
              Terence.
              [email protected]
              

    Jacek,
              Thanks for replying.
              My JSP's are just files in my document root . However, I found a solution to
              my
              problem. That is to have the jar file defined in my weblogic.class.path. I may
              have missed some files in my original jar file which causes my problem.
              Mayby I should package everything into a web application for deployment. That
              will be my next step.
              Thanks anyway.
              Terence.
              Jacek Laskowski wrote:
              > Terence Lai wrote:
              > >
              > > Hi,
              > >
              > > I am trying to use a java bean in a jsp file. The java bean is packaged
              > > into a jar file. I am getting class not found compilation error. If the
              > > bean remains to be a seperated class file, everything work well.
              >
              > How do you use the JSP file ? Is it a part of web application ? If so,
              > the bean jar package should be located in WEB-INF/lib directory. It's
              > also recommended to put the bean class into a package, so it's not in
              > 'unnamed' package, and <jsp:useBean> can find it.
              >
              > >
              > > Does anyone know how I can use bean in a jar file within jsp , i.e. to
              > > allow the bean to be found during compilation ?
              >
              > see above.
              >
              > > Terence.
              >
              > Jacek Laskowski
              > HP Consulting
              

  • Java application compiles java files in memory

    how can I use java application program (that may call method runtime exec or some other techniques) to compile the other java files that were already loaded in memory. (I can not copy those target files to the hard disk with extension java, then compile for security reason).

    And once they are compiled, where do you plan to put the compiled .class files? Same security problem, right? Perhaps you planned to load and use them "from memory" somehow? This would be a different security problem. Perhaps you need to rethink what you are doing.

Maybe you are looking for