It definitely works (to do as you describe). I think you need to take a good look at the ApplicationDomain class - make sure that the loaded SWF is in the same application domain as your loading SWF, and it should all be fine.
Alternatively, you can specifically query the child's applicationDomain via the loader - caling getDefinitionByName() on just that applicationDomain. HTH, Ian On Sun, Feb 15, 2009 at 3:08 PM, jonathan howe <[email protected]> wrote: > Hello, > > I have some classes with a lot of code that I may or may not need depending > on the situation. These classes all extend a superclass that I refer to in > my main application. > My ideal would be to define subclasses only in external swfs, load the > swfs and then instantiate the classes via a string passed to > getDefinitionByName so that the subclasses are not included in the main > application. > > So the model is: > > Main.swf / Main.as contains SupClass.as but does not have references to > Subclass1 or Subclass2 > Subclass1.swf / Subclass1.as > Subclass2.swf / Subclass2.as > > Main.as decides it wants Subclass1, loads Subclass1.swf, load inits and > completes, Main.as tries to instantiate > > Of course, when I try this, I get the typical ReferenceError: Error #1065: > Variable Subclass1 is not defined. > > Is there any way that anyone knows of to instantiate a class this way? I > would love to keep it out of the Main.swf. > > Here seems to be a well phrased argument that seems to insist that the class > always be included in the swf that is trying to instantiate (and thus all > the code will be duplicated). > http://nwebb.co.uk/blog/?p=186 > Thanks dudes and dudettes, > -jonathan > > -- > -jonathan howe > _______________________________________________ > Flashcoders mailing list > [email protected] > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > _______________________________________________ Flashcoders mailing list [email protected] http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

