you're on the right track.
Yes, you have to first give each of the buttons instance names... I like to use a sequence naming scheem, like btn_0, btn_1, btn_2 ect so that I can easily address them through a loop. Then, I would code like this:
| Code: |
var links:Array = new Array(
"link_url_1.html",
"link_url_2.html"
);
for(x=0; x< links.length; x++)
{
_root["btn_"+x].my_index = x;
_root["btn_"+x].onPress = function(){
getURL(_root.links[this.my_index], "_top"«»);
}
}
|
I hope that helps.
Post edited by: sstark, at: 2007/10/25 18:09
Post edited by: sstark, at: 2007/10/25 18:17