Try putting _global in front of your first package, i.e.
var x = _global["com"]["str1"]["str2"]["str3"];
or, if you know the full class path (fully qualified class name) then try
var x = mx.utils.ClassUtil.findClass("com.str1.str2.str3");
Dirk.
> -----Original Message-----
> From: Scott Barnes [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, April 06, 2005 9:10 AM
> To: [email protected]
> Subject: [flexcoders] Re: createChild dynamically via DB arguments..
>
>
>
> better yet:
>
> say you have a situation like this
>
> var x = com["str1"]["str2"]["str3"];
>
> container.createChild(x);
>
> that works ok.
>
> but...
>
> if if i try ["com"]["str1"]["str2"]["str3"] it doesn't. My question
> is, how does "com" come into the equation, is it some kind of FLEX
> mapping?
>
> dir structure is
> /com/
> /com/SynerygFLEX/
> etc..
>
> I'm trying to have it so that i can instantiate a dynamic class path
> on the fly.
>
> It works if i prefix it with some base root level dirs
>
> eg:
> /com/
> /blah/
> /de/
> /au/
>
> these would work:
>
> com["str1"]["str2"]["str3"];
> blah["str1"]["str2"]["str3"];
> de["str1"]["str2"]["str3"];
> etc
> ...
> but i kind of need to go
>
> _whateverThisObjectIs["com"]["str1"]["str2"]["str3"]
> or
> _whateverThisObjectIs["blah"]["str1"]["str2"]["str3"]
>
> Any help?
>
>
> On Apr 6, 2005 3:36 PM, Scott Barnes <[EMAIL PROTECTED]> wrote:
> > Can I quickly confirm something?
> >
> > In order to use createChild(classPath) that initial classPath has to
> > be included before runtime correct? in that you cannot instantiate a
> > custom MXML component unless you either xmlns: / import it?
> >
> > In saying that, if you have a situation where you want to via an
> > onClick instantiate a MXML component thats path came from a DB, its
> > not dooable as the FLEX server will need to know about this class
> > upfront...that or you have to use
> attachMovie(your.mxmlFile.mxml.swf)
> >
> > ?
> >
> >
> > --
> > Regards,
> > Scott Barnes
> > http://www.mossyblog.com
> > http://www.flexcoder.com (Coming Soon)
> >
>
>
> --
> Regards,
> Scott Barnes
> http://www.mossyblog.com
> http://www.flexcoder.com (Coming Soon)
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
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/