Typewriter effect with a button
hello... hm, have button, dynamic text , input text.
when click on button, input text show in dynamic text, typewriter effect.
i found script... (a cool script sound, when typewriter effect works)
var mysound =new kb(); mysound.play(); var mystring:string = origine.text; var myarray:array = mystring.split("");// seperates each letter addeventlistener(event.enter_frame, framehandler); function framehandler(event:event):void { if (myarray.length > 0) { resultat.appendtext(myarray.shift()); } else { removeeventlistener(event.enter_frame, framehandler); soundmixer.stopall(); } }
so works when launch swf, but... don't know correct way make button...
bouton.addeventlistener(mouseevent.click, gogogo); function gogogo(event:mouseevent):void { //??? }
i don't find it. idea, please?
just move enter_frame event listener , sound play command inside button's event handler
- bouton.addeventlistener(mouseevent.click, gogogo);
- function gogogo(event:mouseevent):void {
- addeventlistener(event.enter_frame, framehandler);
- mysound.play();
- }
More discussions in ActionScript 3
adobe
Comments
Post a Comment