|
-
dynamic variables
I have a class that is used to create buttons (sprites). I need to be able to create x amount of them. I tried to use a for loop to do that.
for (var a:int = 0; a<=subtopics_number;a++){
var test:SubTopicButton = new SubTopicButton(a);
addChild(test);
}
That creates the buttons but my problem is in how to refrence them from any later point. something like removeChild(x)...
is there a way to do something like: (i know these down work but just examples of what i'd like to be able to do )
var test[i]:SubTopicButton = new SubTopicButton(a);
var test + i:SubTopicButton = new SubTopicButton(a);
basically create dynamic variable names so that i can use them later.
If theres a diffrent way to do this and im totally missing it let me know. If this needs to be move over to the flash newb section thats ok also.
Thanks for help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|