I have an ENTER_FRAME event on one of my pages to create a progress bar for an audio track. It is working great, but I when I click on a button to goto the next frame, it continues to run the ENTER_FRAME event continuously. I have many audio tracks in this project and need a progress bar for each. however, once a second one starts, it really begins to bog down the player.
Is there a way to stop an ENTER_FRAME event from continuing after you leave a page? Here is the code i have:
import flash.events.Event;
tb_mc.scaleX = 0;
stage.addEventListener(Event.ENTER_FRAME,EnterFrame);
function EnterFrame(evt:Event):void {
tb_mc.scaleX = audio_mc.currentFrame/audio_mc.totalFrames;
}
This makes a the MovieClip “tb_mc” grow congruent to the MovieClip that holds the audio, “audio_mc”
This works wonderfully, but when I click to go to the next page, the ENTER_FRAME event continues to run. How can I stop it?