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
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to