If the goal is to generate different canvas children based on the data,
a custom renderer should do that in commitProperties.  How  you
determine which children to create is up to you, but you wouldn't do
this by altering class definitions at runtime.

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Amy
Sent: Friday, July 25, 2008 6:08 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: new Component() ?

 

--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
, "Rafael Faria" 
<[EMAIL PROTECTED]> wrote:
>
> Amy,
> and how would you add elements to the canvas?! or to the itemrender
> itself? because the myRenderer wont have addChild so i can add new
> elements. And how do you change the properties of the Canvas? You
> adding the Class but you aint adding the whole component i was 
talking
> about. 
> 
> Suppose that i want to create for instance
> 
> <mx:itemRenderer>
> <mx:Component>
> <mx:Canvas backgroundColor="#0000000" >
> <mx:Image
> source="@Embed
('../assets/images/icons/clear_green_button.png')" /> 
> <mx:TextInput text="{data.firstname}" alpha="0.5"
> click="{test()}" />
> </mx:Canvas>
> </mx:Component>
> </mx:itemRenderer>
> 
> How i would create this on the fly and add to the itemrenderer?
> 
> this is just to ilustrate what i want. I will need to create 
different
> components according to the parameters of my variables that's the
> reason i'm struggling to do it dynamically.
> 
> If i only knew how to do this from AS3 it would help me a lot.

Alex already said that you can't add any "new parts" into a 
ClassFactory. All you can do is set properties on it. It would be 
an intriguing feature, so you might want to make a feature request.

For now, this method will only work to create instances of a class 
that already does what you want.

http://www.adobe.com/cfusion/communityengine/index.cfm?
<http://www.adobe.com/cfusion/communityengine/index.cfm?> 
event=showdetails&postId=2081&productId=2&loc=en_US

http://www.adobe.com/cfusion/communityengine/index.cfm?
<http://www.adobe.com/cfusion/communityengine/index.cfm?> 
event=showdetails&postId=5762&productId=2&loc=en_US

http://www.paulofierro.com/archives/520/
<http://www.paulofierro.com/archives/520/> 

HTH;

Amy

 

Reply via email to