I'm trying to create a menu bar that dynamically creates content based on data found in an array declared on the root. The object that does this is a movie clip called listbox that contains another movie clip called item. Still with me? Okay, the item contains a dynamic text field and a button. The text field is tied to a variable called txt. It looks a bit like this:
root -> listbox -> item -> text field & button
When the menu needs to be populated, it runs the following function that's written in the listbox movieclip:
function populate(list) {
var i;
for (i = 1; i <= list.length; i++) {
duplicateMovieClip("itm", "itm_" + i, i + 1);
setProperty("itm_" + i, _x, 0);
setProperty("itm_" + i, _y, 18.5 * i);
set ("itm_" + i + ".txt", list[a-1]);
}
}
The function runs through and dupes the movie clips, positioning them properly with setProperty. It does not set the txt variable, though... and it's drivin' me crazy trying to figure out WHY!!! I've tried changing the set statement to:
["itm_" + i].txt = list[a-1];
Alas, it was to no avail! Any thoughts, curses, comments on the matter would be _greatly_ appreciated.
THANKS!!!
[Edited by 20 Ton Squirrel on 04-30-2001 at 04:43 PM]
|