# Goto to when typewriter effect completed

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

---

<div class="post-metadata">

**Author:** ![dunger99us](https://avatars.discourse-cdn.com/v4/letter/d/bcef8e/32.png) [@dunger99us](https://forum.kirupa.com/u/dunger99us)\
**Post date:** [March 28, 2006, 1:17pm UTC](https://forum.kirupa.com/t/goto-to-when-typewriter-effect-completed/72424/2 "2006-03-28T13:17:01Z")

</div>

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

---

<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:** [March 28, 2006, 1:36pm UTC](https://forum.kirupa.com/t/goto-to-when-typewriter-effect-completed/72424/3 "2006-03-28T13:36:16Z")

</div>

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.

```auto
txt.typeWriter(mystring, 20);

```

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

```auto

mystring = "text";

```

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

Let me know if it works,

Jerryj.
