Answered
Dynamically add instance of a class
Im trying to dynamically add instances of a class. I need to do it in a loop. How would I go about doing something of that nature?
Im trying to dynamically add instances of a class. I need to do it in a loop. How would I go about doing something of that nature?
Basically...
for(var i:uint=0; i<numInstancesNeeded; i++){
var newInstance:YourClassName = new YourClassName();
addChild(newInstance);
}
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.