On 8/8/05, Mehdi, Agha <[EMAIL PROTECTED]> wrote:
> Yeah, I have seen that example but it doesn't tell you how to create a child
> from file or URL. I build the path to the class dynamically like this:
>
> "samples.classes." + dynamicClass;
>
> Where dynamic class is a variable that holds the name of the mxml file,
> which needs to be loaded.
You can pass the class name to createChild.
var child = createChild("samples.classes." + dynamicClass, "', {...});
You need to make sure the class specified by dynamicClass is linked
into the SWF. If you haven't referenced the class anywhere in your
application, then the compiler does not link it in. In that case, the
createChild call will fail and return undefined. To get around that,
you can declare a dependency variable somewhere in your application.
// pull samples.classes.Foo in...
var fooDependency:samples.classes.Foo = samples.classes.Foo;
Manish
------------------------ Yahoo! Groups Sponsor --------------------~-->
<font face=arial size=-1><a
href="http://us.ard.yahoo.com/SIG=12htfi84e/M=362335.6886445.7839731.1510227/D=groups/S=1705007207:TM/Y=YAHOO/EXP=1123487924/A=2894361/R=0/SIG=13jmebhbo/*http://www.networkforgood.org/topics/education/digitaldivide/?source=YAHOO&cmpgn=GRP&RTP=http://groups.yahoo.com/">In
low income neighborhoods, 84% do not own computers. At Network for Good, help
bridge the Digital Divide!</a>.</font>
--------------------------------------------------------------------~->
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/