Flex - How do I use a variable to define the name of an instantiated object
Posted
by flexfanatic
on Stack Overflow
See other posts from Stack Overflow
or by flexfanatic
Published on 2010-04-20T03:26:46Z
Indexed on
2010/04/20
3:33 UTC
Read the original article
Hit count: 295
Essentially this is what I want to accomplish, however it doesn't work like this. Is there any solution: - The problem is I can't dynamically name a new object... ??? pulling my hair out.
import views.printingView;
public function initComponent(o:Array):void{ SomeObject::Array = o;
for(i=0; i <=SomeObject.length-1; i++){
'invoice'+{SomeObject[i].namedID}:printingView = new printingView();
someDisplayContainer.addChild('invoice'+{SomeObject[i].namedID});
'invoice'+{SomeObject.namedID}.publicInitFunction(SomeObject[i]);
}
}
© Stack Overflow or respective owner