I have two arrays, and when the mouse is over the first array, I want the second array to scale “x” amount every 10 seconds. So to do this I set up a timer. So whenever the mouse is over the first array the timer starts… One problem! All of the second array scales at the same time! Since it is a timer event I can’t use “e.target” to specify what object in array to get, but if I can somehow get the e.target info from the mouse over event in first array I could save in string outside of function to get right name in second array because they are similarly named:
but here is part of code
var btnArray:Array = [btn1, btn2, btn3, btn4];
var scaleArray = [btn1Loader, btn2Loader, btn3Loader, btn4Loader];
for each (var c in btnArray)
{
c.addEventListener(MouseEvent.ROLL_OVER, fadeIn);
c.addEventListener(MouseEvent.ROLL_OUT, fadeOut);
c.alpha = 1;
}
function fadeIn(e:MouseEvent):void
{
TweenMax.to(e.target, 1, {alpha:0, repeat:-1, yoyo:true,ease:Linear.easeNone});
//HOW CAN I GET THIS INFO OUTSIDE FUNCTION???
var currentLoader:String = e.target.name + "Loader"
myTimer.start();
}
function fadeOut(e:MouseEvent):void
{
TweenMax.to(e.target, 1.5, {alpha:1});
//c.removeEventListener(MouseEvent.MOUSE_OVER, startScale);
myTimer.stop();
}
myTimer.addEventListener(TimerEvent.TIMER, nextOne)
function nextOne(e:TimerEvent):void{
for each (var c in scaleArray){
c.scaleX = 10
}
}