Assigned numbers to movie clip to plug in formula... not working
- by Matthew MlgPro Harding
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.
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[i].addEventListener(MouseEvent.CLICK, outputNumber);
buttonArray[i].theTrigger = [i + 1];
}
function outputNumber(e:MouseEvent):void {
trace( e.target.theTrigger);
buttonArray[i].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