hey everyone. I’m having a problem with some code and maybe you can help me out.
I have two arrays. One is used for button names and the other is used for the links for the buttons. The buttons are generated dynamically with attachMovie and the names are also modified via AS. My problem comes in at looping through the links array and applying them to the buttons.
myText = ["First", "Second", "Third"];
myLinks = ["http://google.com", "http://yahoo.com", "http://aol.com"];
total = myText.length;
//<----------here is where the problem resides------------>//
for (i=0; i<total; i++) {
_root.attachMovie("button", "button"+i, i, {_x:200, _y:50+(i*33)});
_root["button"+i].text_txt.text = myText*;
_root["button"+i].onRelease = function() {
//<-------specifically the following line--------->//
// it doesn't seem to loop through the i, however,
// if i change "i" to a specific value in the array like "1"
// it will produce "http://yahoo.com" as expected.
// also, i'm using trace instead of getURL to save time.
trace(myLinks*);
};
}
thanks guys.