# Animated textstring with AS

**URL:** <https://forum.kirupa.com/t/animated-textstring-with-as/102715>\
**Category:** Uncategorized\
**Created:** [February 26, 2004, 9:54am UTC](https://forum.kirupa.com/t/animated-textstring-with-as/102715 "2004-02-26T09:54:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![monAmour](https://avatars.discourse-cdn.com/v4/letter/m/6a8cbe/32.png) [@monAmour](https://forum.kirupa.com/u/monAmour)\
**Post date:** [February 26, 2004, 9:54am UTC](https://forum.kirupa.com/t/animated-textstring-with-as/102715/1 "2004-02-26T09:54:56Z")

</div>

I’m trying to build a prototype for strings to be loaded into textfields.  
I want to break up a string and put each and every char in it in to the textfield with a 1 second interval.

This is what I’ve come up with, I don’t get any script errors but nothing seems to work anyway.  
Any ideas how to accomplish this?

[AS]  
var myText:String = “Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wi”;

TextField.prototype.animateString = function(strObj:String) {  
var charCount:Number = strObj.length-1;  
var c:Number = 0;  
function animStr(strObj:String, strLength:Number) {  
if (c \< strLength) {  
var input:String = strObj.charAt©;  
this.text = this.text + input;  
c++;  
animInt = setInterval(animStr, 1000);  
}  
else {  
clearInterval(animInt);  
}  
}

```
animStr(strObj, charCount);

```

}

theText.animateString(myText);  
[/AS]

Expl: This script is within the first frame of my movie. The textField named “theText” is also put there.
