Goto to when typewriter effect completed

[font=verdana, arial, helvetica][size=2]Hi,

I am using this code (within one frame) for a typewriter effect. [indent]

TextField.prototype.typeWriter = function(str, ms) {

var me = this;
var i = 0;
var itv = setInterval(function () {
me.text = str.substring(0, i);
i+=2;
if (i>str.length) {
clearInterval(itv);
}
updateAfterEvent();
}, ms);
};
mystring = “text”;
txt.typeWriter(mystring, 20);

[/indent]Which code should I add to go to another frame when the text is completed?

Thanks!

Jerryj[/size][/font]

would it be ok, to post an .fla here for us to see???

Hi,

I am not at home at the moment, but it’s quite simple to use. Just create a dynamic textfield with the instance name ‘txt’, and place this code on the keyframe where the field is.

txt.typeWriter(mystring, 20);

The number in this piece effects the speed of the effect.


mystring = "text";

In “text” you can put the text that you want to see in the textfield.

Let me know if it works,

Jerryj.