# Goto to when typewriter effect completed

**URL:** <https://forum.kirupa.com/t/goto-to-when-typewriter-effect-completed/130508>\
**Category:** Uncategorized\
**Created:** [December 5, 2004, 11:00pm UTC](https://forum.kirupa.com/t/goto-to-when-typewriter-effect-completed/130508 "2004-12-05T23:00:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jerryj](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@jerryj](https://forum.kirupa.com/u/jerryj)\
**Post date:** [December 5, 2004, 11:00pm UTC](https://forum.kirupa.com/t/goto-to-when-typewriter-effect-completed/130508/1 "2004-12-05T23:00:35Z")

</div>

[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]
