heh heres the concept (haven't tried the above approaches yet *waits
for his $4,500 AUD alienware laptop to boot that weighs 12lbs and has 
keyboard that heats up*..... btw i hate alienware.

Ok, the *REASON* why I wanted to approach this dynamic class creation
at runtime, is that i'm using an XML configuration (as most of you may
of read in the past) for my framework. Inside this XML Configuration
you can specify various paths for certain elements (ie templates,
view-pods, presenters etc). So the initial base class loaded is
realitively small in size.

What happens is a class i wrote traverses this configuration file,
breaks it up into various managers (ViewPodManager, ScreenManager,
TemplateManager) etc and then once ready, I fired off a defaultScreen
event ("showMainScreen").

This then on a per screen basis, gathers all the requirements for
presenting that screen and part of that process is it needs to
instantiate certain MXML/ASCLasses on the fly based on arguments you
previously specificed inside your config.xml

The weird part - which is what prompted me to send of this orginal
post is - that the entire first pass doesn't know anything about the
mxml/asclasses inside the main directory structure - in that i have no
XMLNS or IMPORT declartions anywhere. I found that if i:

var a = "SynergyFlex";
var b = "framework";
var c = "templates";
var d = "mail";
var e = "defaultLayout";

var oTemplate:Function =  com[a][b][c][d][e];
ScreenContainer.createChild(oTemplate);

it works, it creates the child. Of course, i use an iteration string
solution (ie break the path up via split and piece it together,
growing the object as i iterate.

The catch22 i found though was you had prefix it correctly, in that
com[etc..] or org[etc..] which made me think that com/org/de/blah/mx
etc could be like J2EE mappings or something, and needed a way to just
jump up the heirachy just one more step (ie i'm hoping _level0 or
_global maybe that point).

Its just weird how it lets me create stuff on the fly like that, and
the only thing i can guess is that some how if its not asked/stored in
the code up front it talks to the server and says "gimme that object"
- that or - it must in some small way include the entire
/yourFlexApp/* somehow??? clueless as to whats going on here.

I say that as I first thought no way will this work, and i'll have to
use a loadMoview(myviewpods.mxml) approach - that or - do a
embed/#include style concept of some sort...

*shrug*... had me baffled.

Let ya know how i go ;)

On Apr 6, 2005 7:25 PM, Dirk Eismann <[EMAIL PROTECTED]> wrote:
> 
> > Eventually Components.as will be generated by
> > ColdFusion before the Flex application is loaded.
> 
> one word: nifty :)
> 
> Dirk.
> 
> 
> Yahoo! Groups Links
> 
> 
> 
> 
> 


-- 
Regards,
Scott Barnes
http://www.mossyblog.com
http://www.flexcoder.com (Coming Soon)


 
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/
 



Reply via email to