So I’m trying to basically cause 6 movieclips (with relevant text boxes) to fade out, then the array is sorted sort of “behind the scenes” and then it’s all faded back in in numerical order.
The fade in works like a dream, they fade in slowly and cleanly in perfect numerical order. The fade out doesn’t work at all, only the last ball seems to fade nicely, the others just kind of POOF and there’s no gradual fade. I’m not sure why. I’ve tried changing EVERYTHING. So if you could shed some light on the error I’d be so grateful because I really can’t see the problem!
function fadeAndSort()
{
var ballFadeOut1:Tween = new Tween(Ball1,"alpha",Strong.easeIn,100,0,5,true);
var ballFadeOut2:Tween = new Tween(Ball2,"alpha",Strong.easeIn,100,0,5,true);
var ballFadeOut3:Tween = new Tween(Ball3,"alpha",Strong.easeIn,100,0,5,true);
var ballFadeOut4:Tween = new Tween(Ball4,"alpha",Strong.easeIn,100,0,5,true);
var ballFadeOut5:Tween = new Tween(Ball5,"alpha",Strong.easeIn,100,0,5,true);
var ballFadeOut6:Tween = new Tween(Ball6,"alpha",Strong.easeIn,100,0,5,true);
var ballFadeOutBonus:Tween = new Tween(BonusBall,"alpha",Strong.easeIn,1,0,5,true);
var textFadeOut1:Tween = new Tween(programNumber1,"alpha",Strong.easeIn,100,0,5,true);
var textFadeOut2:Tween = new Tween(programNumber2,"alpha",Strong.easeIn,100,0,5,true);
var textFadeOut3:Tween = new Tween(programNumber3,"alpha",Strong.easeIn,100,0,5,true);
var textFadeOut4:Tween = new Tween(programNumber4,"alpha",Strong.easeIn,100,0,5,true);
var textFadeOut5:Tween = new Tween(programNumber5,"alpha",Strong.easeIn,100,0,5,true);
var textFadeOut6:Tween = new Tween(programNumber6,"alpha",Strong.easeIn,100,0,5,true);
var textFadeOutBonus:Tween = new Tween(programBonusNumber,"alpha",Strong.easeIn,100,0,5,true);
var delay:Timer = new Timer(6000,1);
delay.addEventListener(TimerEvent.TIMER, runFunction);
delay.start();
function runFunction(event:TimerEvent):void
{
fadeIn();
}
}
function fadeIn()
{
drawnArray.sort(Array.NUMERIC);
programNumber1.text = drawnArray[0];
programNumber2.text = drawnArray[1];
programNumber3.text = drawnArray[2];
programNumber4.text = drawnArray[3];
programNumber5.text = drawnArray[4];
programNumber6.text = drawnArray[5];
programBonusNumber.text = drawnArray[6];
var ballFadeIn1:Tween = new Tween(Ball1,"alpha",None.easeNone,0,1,5,true);
var ballFadeIn2:Tween = new Tween(Ball2,"alpha",None.easeNone,0,1,5,true);
var ballFadeIn3:Tween = new Tween(Ball3,"alpha",None.easeNone,0,1,5,true);
var ballFadeIn4:Tween = new Tween(Ball4,"alpha",None.easeNone,0,1,5,true);
var ballFadeIn5:Tween = new Tween(Ball5,"alpha",None.easeNone,0,1,5,true);
var ballFadeIn6:Tween = new Tween(Ball6,"alpha",None.easeNone,0,1,5,true);
var ballFadeInBonus:Tween = new Tween(BonusBall,"alpha",None.easeNone,0,1,5,true);
var textFadeIn1:Tween = new Tween(programNumber1,"alpha",None.easeNone,0,1,5,true);
var textFadeIn2:Tween = new Tween(programNumber2,"alpha",None.easeNone,0,1,5,true);
var textFadeIn3:Tween = new Tween(programNumber3,"alpha",None.easeNone,0,1,5,true);
var textFadeIn4:Tween = new Tween(programNumber4,"alpha",None.easeNone,0,1,5,true);
var textFadeIn5:Tween = new Tween(programNumber5,"alpha",None.easeNone,0,1,5,true);
var textFadeIn6:Tween = new Tween(programNumber6,"alpha",None.easeNone,0,1,5,true);
var textFadeInBonus:Tween = new Tween(programBonusNumber,"alpha",None.easeNone,0,1,5,true);
}