Title: RE: [flexcoders] Create Panel Child

Manish,

I have some forms as mxml files. My Tree Control has data for categories and each categoryID in that is part of the file name for those forms.

category_12345.mxml, category_23456.mxml, ....

When a node in tree is selected, I need to load the mxml for that category into a Panel. Now, if I select the node with 12345 as the category, how do I load it? What you're saying is

import samples.classes.*

var cat1:category_12345 = category_12345; (can this be in any part of the application?)

var catID = "category_12345";
createChild( catID, "", {...} );

Is this how I need to structure it?

Thanks

Agha Mehdi
IDT - eBusiness Program Manager


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Manish Jethani
Sent: Sunday, August 07, 2005 10:59 PM
To: [email protected]
Subject: Re: [flexcoders] Create Panel Child

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="" 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/
 




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Computer software testing Macromedia flex Development
Software developer


YAHOO! GROUPS LINKS




Reply via email to