Making text type itself (paradox)
I have an array containing some text strings. These strings must type themselves in the text field depending on the frame. First string on first frame, second on second and so on. But if i change frames too fast, text from the first frame continue to type itself on the second frame and it looks like "1e2x3t456789" (if strings would "text" and "123456789"). So the question is how to stop function frameLooper when i'm going to the next frame, if this function starts when i'm going to the next frame : D
var textarr:Array = new Array("","","text","123456789");
button_1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToNextFrame);
function fl_ClickToGoToNextFrame(event:MouseEvent):void
{
nextFrame();
var textstr:String = textarr[currentFrame];
var symbolarr:Array = textstr.split("");
addEventListener(Event.ENTER_FRAME, frameLooper);
textfield.text="";
function frameLooper(event:Event):void {
if (symbolarr.length > 0) {
textfield.appendText(symbolarr.shift());
} else {
removeEventListener(Event.ENTER_FRAME, frameLooper);
}
}
}