as3.0 flash: how do i append a string to a variable so flash reads it as a variable? -


I'm getting a value from a class that gives me "icon1" nested in the movie clip on the form of data To control the visibility of an item, I want to use it within the function.

// What I want to do here: mymenu.icon1.visible = true;

// But I can not combine 2 as a flash together, it will appear as a string as it has not been read in the form of a path. Eg Function (icon crashed) {

mymenu.iconreceived.viaible = true; } Any clues?

Use brackets as thing1.thing2 is the same as Thing1 ["thing2"] :

  function set iconable (icon has been received: string): zero {mymenu [IconReceived]. Visible = true; }  

This is not usually a good idea for string / name-based references, but the above works.


Comments