All
I have a problem that I have read a few other threads about, but the solutions that are offered don’t seem to work for me.
The solution offered was to declare the tween variables outside the function…
I have done this, but every now and then it doesn’t finish the tween.
Here is my code for that part…Any Ideas!!!
var alphaTween:Tween;
var myTimer:Timer=new Timer(150,0);
myTimer.start();
myTimer.addEventListener(TimerEvent.TIMER, addMC);
function addMC(event:TimerEvent):void {
var mc:MovieClip = new mClip();
loadArea.addChildAt(mc,1);
mc.mouseChildren=false;
mc.mouseEnabled=false;
mc.gotoAndStop(Math.ceil(Math.random()*6));
mc.x=Math.random()*loadArea.width*0.9;
mc.y=Math.random()*loadArea.height*0.9;
mc.width=mc.width*Math.random()*1.5;
mc.scaleY=mc.scaleX;
mc.rotation=Math.random()+1*360;
alphaTween = new Tween(mc,"alpha",None.easeNone,1,0,1,true);
alphaTween.addEventListener(TweenEvent.MOTION_FINISH, fadeOut);
function fadeOut(event:TweenEvent):void {
if(loadArea.contains(mc)){
loadArea.removeChild(mc);
}
}
}