This content has been marked as final. Show 5 replies
Two things. Most classes are pretty small and don't add much weight to a published file anyways. But…
Doesn't actually import/include the whole package in the published swf file. It just provides a shortcut for any reference. The actual class will only be compiled and put into the file if it is instantiated or if any of its methods are used on another class instance that has been cast to that class. (I think. I'm a bit new to the whole class thing. In my head I've got it straight, but I'm not sure I've explained it properly.)
So I tested my idea a bit. Here I have a linearMath package that includes two different implementations of a matrix class. I first made a file with just stop and published it. I then added the import and published. Next I made an instance of one of the matrix classes and then another. Below each line is the published file size after I added each line.
var A:compMatrix=new compMatrix(5,10);
var B:myMatrix=new myMatrix(5,10);
Just as a side-note, Rothrock, you do not have to instanciate a class to
force-include its definition. You need only add statements that reference
the class constructor.
Using your example:
Hmmm. That is interesting and will keep it in mind. Thanks.
You totally rule...both of you. thank you!