Hi everyone,
I’m new to flash. I’ve created a flash file that is a marketing loop.
I created frame labels in the timeline and added movie clips to the timeline. I animate each movie clip using AS3. Once the animation for a movie clip is complete, I go to the next frame label and animate the objects in that label.
However, the file is freezing and it’s a memory leak problem. How can I remove objects that I’ve created in the time line so they no longer exist when the file moves to the next frame label?
Below is an example of my code for a frame label:
stop();
import fl.transitions.Tween;
import fl.transitions.TweenEvent;
import fl.transitions.easing.*;
import flash.utils.Timer;
import flash.events.TimerEvent;
//position of text
text5_mc.alpha=0;
tools_mc.x=650;
//bring in text
var text5AlphaTween:Tween=new Tween(text5_mc,“alpha”,Regular.easeIn,0,1,1,true);
//listen for text to complete motion, move in tools image
text5AlphaTween.addEventListener(TweenEvent.MOTION_FINISH,donetext5);
function donetext5(e:TweenEvent):void {
var toolsInTween:Tween=new Tween(tools_mc,“x”,Regular.easeIn,650,0,1,true);
text5AlphaTween.removeEventListener(TweenEvent.MOTION_FINISH,donetext5);
//listen for image motion to complete, move out text
toolsInTween.addEventListener(TweenEvent.MOTION_FINISH,text5Out);
function text5Out(e:TweenEvent):void{
var text5OutTween:Tween=new Tween(text5_mc,“alpha”,Regular.easeIn,1,0,1,true);
toolsInTween.removeEventListener(TweenEvent.MOTION_FINISH,text5Out);
//listen for text motion to complete, move out image
text5OutTween.addEventListener(TweenEvent.MOTION_FINISH,toolsOut);
function toolsOut(e:TweenEvent):void {
var toolsOutTween:Tween=new Tween(tools_mc,“x”,Regular.easeIn,0,-642,1,true);
text5OutTween.removeEventListener(TweenEvent.MOTION_FINISH,toolsOut);
//listen for image motion to complete, go to next frame label
toolsOutTween.addEventListener(TweenEvent.MOTION_FINISH,atPage7);
function atPage7(e:TweenEvent):void {
toolsOutTween.removeEventListener(TweenEvent.MOTION_FINISH,atPage7);
MovieClip(root).gotoAndStop(“page7”);
}
}
}
}
Any advice on how I can stop the memory leak?
Thanks