Krilnon,
Thank you for your reply. The following AS2 code is what I used the script for. I’m still a bit lost with AS3 just started using this weekend. Any help to get me up to speed is much appreciated!
var aButtons:Array = new Array(btn0, btn1, btn2, btn3); //—Content source is usually fed from an xml doc.
for (var i:Number = 0; i<aButtons.length; i++) {
var btnPanel:MovieClip = aButtons*; //—Usually I have a duplicateMovieClip here
btnPanel.onRelease = function(){
var pickedNum:Number = aButtons.getIndex(this);
trace("pickedNum: " + pickedNum);
}
}
//—Get Index
Array.prototype.getIndex = function(data) {
for (var i:Number=0; i<this.length; i++) {
if (this* == data) {
return i;
}
}
return -1;
}