So I am attempting to vertically evenly space these movie clips so I came up with a math formula involving n( the button number) but Its not working.
**Here is my code:
**var buttonArray:Array = [ side_banner.btn1, side_banner.btn2, side_banner.btn3, side_banner.btn4];
var buttonCount:uint = buttonArray.length;
for (var i:uint=0; i< buttonCount; i++) {
buttonArray*.addEventListener(MouseEvent.CLICK, outputNumber);
buttonArray*.theTrigger = [i + 1];
}
}
function outputNumber(e:MouseEvent):void {
trace( e.target.theTrigger);
buttonArray*.y = (((stage.stageHeight - 400)/4)*(e.target.theTrigger)) - ((stage.stageHeight - 400)/4)/2
}
But apparently each movie clip doesn’t actually have a numerical value just a numeric name… how can I get the “n” btn number to use my formula?
Thanks