I'm trying to compile AS files using the mxmlc but the particular class depends on other classes. My command is something like this: mxmlc -includes classA classB -source-path=. com.example.com.classC.
This gave me classC.swf but when I loaded it, it was still looking for classA.swf and classB.swf. Is there anyway I can have just one swf file?
Thanks!
I assume that classA and classB are .as
files. In that case, you need not use -includes
option at all - just import them to your main class ( ClassC
), as you'd normally do and compile using mxmlc com.example.ClassC
from the folder that contains the com
folder.
According to this page , -includes
option is to specify a list of classes to the resulting application SWF file, whether or not those classes are required at compile time. Normally a class in the source path is compiled only if it is required - ie, only if it used by some other class that is being compiler. This option tells compiler to compile a class even if it is not used in any of your classes - may be to use getDefinitionByName
to create instances of that class at runtime.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.