Hey, Here is a super tricky question - See if you can figure this out
This is the concept I want to get into code:
- Have a Document Class attached to the Main.swf
- Have a Assets.swf that has all MovieClips that set to Export and have been given actual Classes.
- Have the document class Load the Assets.swf.
- Once loaded, be able to create instances of the MovieClips from Assets.swf by writing the code in the Document Class of Main.swf
Now is this the correct scenario, because as it stands. I can get all this to work… However what I am finding is if I have a public function on the Document class that creates an instance of something from the Assets.swf, lets say var okTest:TestClass = new TestClass(); I have to also import it in the Document Class (import com.test.TestClass).
When I compile it, yes it works. If I remove the Assets.swf file it doesn’t display. Ok… But I’ve noticed that the Main.swf file is including all the imported classes (eg: com.test.TestClass) so the Main.swf filesize is pretty much the same as the Assets.swf file.
I also ran it through a decompiler and can see yes in fact Main.swf is including all those Classes from Assets.swf because I’m trying to access them from Main.swf and had to import.
So the biggest question is how do I go about this properly? Being able to load the asset file that has movieclips etc that have custom classes. Then create instances of those classes within the document class but only if Assets.swf is loaded.
Any ideas??