3 Replies Latest reply on Mar 20, 2011 8:19 PM by johnwatson11219

    need help with newbie compile question


      I am having trouble understanding a compile issue with the open source flex sdk. I have installed the flex sdk and now I can type "mxmlc ..." from the command line and have been able to compile my own project for a few months now. My project consists of mxml files that import some custom .as files that I have packaged up in my source tree.


      I bought a book about Flash programming that contains sample source files and it is these that are giving me trouble. The code samples are very simple but I am missing something basic when I try and compile them. They are structured as .as files that have one class that extends Sprite. There is a [SWF.... metadata section that gives screen dimensions etc. The file that I'm trying to compile imports 3 classes from a package that is right alongside the main class (in the correct subfolder of course to match the package structure).


      When I compile with mxmlc it spits out a swf file but it is way too small. The code samples contain a compiled version that is about 46k while mine is only 2k, also my swf doesn't work when I run it in the Flash debug player. What I think is happening is that the compiler is not including the 3 imported class files (which do most of the work) and is maybe counting on them being available at runtime or something. I'm not trying to do anything that advanced, I just want to compile 1 .as file and the 3 .as files that it imports into 1 swf executable file that I can run in the Flash debug player - or include on a webpage or something like that.


      I have been trying to read the docs but this case seems to be a missing area.


      Can anyone explain what I need to do (or even what I need to google)?

        • 1. Re: need help with newbie compile question
          johnwatson11219 Level 1

          also should mention that when I do the compile it spits out this message:


          Warning: This compilation unit did not have a factoryClass specified in Frame metadata to load the configured runtime shared libraries. To compile without runtime shared libraries either set the -static-link-runtime-shared-libraries option to true or remove the -runtime-shared-libraries option.


          • 2. Re: need help with newbie compile question
            haroon ghafoori

            Hi John


            I am not sure what compiler options u are using to compile your code. If use option -debug=true swf file size will be large having debug capability. By default debug option value is false so if u don't give this option the generated swf will be a small size (used for production) with no debug capabilities.


            Also if you are using Flash Builder by default it compiles code with debug option true. So the sample swf you are looking might be compiled with Flash Builder having a big size and debugging capabilites.

            • 3. Re: need help with newbie compile question
              johnwatson11219 Level 1

              I'm not really worried about the file size. I just pointed it out in my original post because I think it indicates that I'm doing something wrong. Let me try and rephrase my main problem.

              I have been using the open source flex compiler for a few months and I am able to compile mxml files that include .as files that I import. When I do that I am left with a .swf file that I can put on my web server and run inside of a web page etc..

              What is different now is that I have a book with code examples that I downloaded. These examples are almost just like what I have been doing for months, the only difference is that there is no file ending in mxml to serve as a main class. It is .as files all the way down. When I pass the main .as file as a command line option to my compiler it produces a swf file but it doesn't work at runtime. I don't know why but I am almost certain that it is not including the imported class files in the final binary.