Ok so this has been bugging me for awhile a so far I've ignored it because it's not a huge deal but I have a type writer effect using the code below, the problem is I want, when a button is clicked, for it to finish completely. Just jump right to the end. Basically the typing starts and then when said button is clicked, it displays all the text as opposed to just stopping in the middle or heading to the next frame.
I've seen ways to restart it, ways to stop it in the middle, but I've yet to see a way for it to quickly finish. I don't care if I need to replace the code I'd just like to be able to do this.
--------------
var mySound:Sound = new kb();
var mySoundChannel:SoundChannel = mySound.play(0);
import flash.utils.Timer;
import flash.events.TimerEvent;
var i=0;
var myString:String = "Text here shows up in text box"
var mytimer:Timer = new Timer(10,myString.length);
mytimer.addEventListener(TimerEvent.TIMER, timerHandler);
mytimer.start();
function timerHandler(event:TimerEvent):void{
T1.appendText (myString.charAt(i));
i++;
if (i==myString.length){mySoundChannel.stop();}
}