Is there anyway to create "components" on the fly?
Let me explain what i mean.
I have a datagrid that has like 5 columns. Each one of them use a
different itemrenderer.
I understand that i can create each itemrenderer on a different file
but what if i don't want to create files?
is there anyway to transform the following code in a dynamically code
without create any files?
<mx:DataGridColumn headerText="Name">
<mx:itemRenderer>
<mx:Component>
<mx:Text text="{data.lname + ', ' + data.fname}" />
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
??
How can i do that without creating any other files? i would imagine
something like
var dgc:DataGridColumn = new DataGridColumn();
var mycomponent:Component = new Component();
var txt:Text = new Text();
txt.text = "Somthing here";
mycomponent.addChild(txt);
var render:ClassFactory = new ClassFactory(mycomponent);
dcg.itemRender = render;
i know that this code doesnt work but it's just to have an idea of
what i was thinking.
Is there anyway to do that?
Thanks
Rafael