Is it possible to create an array based on a list of items stored in a variable?
Heres an example:
This is my list of items stored in a variable…
MENU_BUTTONS = “home”, “about LRD”, “members”, “games”, “downloads”, “links”;
I then initalize my array with the attempt to assign the contents of the array with my items stored in my MENU_BUTTONS variable…
BUTTONS = new Array(MENU_BUTTONS);
This does not work. It only assigns BUTTONS[0] with the value “home” and nothing else.
On the other hand, this does work.
BUTTONS = new Array(“home”, “about LRD”, “members”, “games”, “downloads”, “links”);
I would not think that Flash would know the difference between the two different sets of code because the MENU_BUTTONS variable is just a reference to my list of items.
You’re probably wondering why I just dont stick with the second approach which works fine. But I am planning on loading the MENU_BUTTONS variable from a text file in the final version of the program.
Thanks for your time.