I’m trying to create a dynamically named object.
something like
private var myVar:String = "dynamicName";
private var [myVar+"staticName"]:Object = new Object;
but what i wrote above dosn’t work for some reason.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’d be very surprised if you get that to work.
Better to save your dynamically created objects in an array or possibly a Dictionary. The Flex Framework uses Arrays for itemRenderers in list based classes, for example. Try something like this using a Dictionary:
In some method where you create the children: