# How to modify the code to work after 30 seconds?

**URL:** <https://forum.kirupa.com/t/how-to-modify-the-code-to-work-after-30-seconds/323868>\
**Category:** flash\
**Created:** [July 21, 2011, 7:07pm UTC](https://forum.kirupa.com/t/how-to-modify-the-code-to-work-after-30-seconds/323868 "2011-07-21T19:07:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![learner\_7n](https://avatars.discourse-cdn.com/v4/letter/l/b2d939/32.png) [@learner\_7n](https://forum.kirupa.com/u/learner_7n)\
**Post date:** [July 21, 2011, 7:07pm UTC](https://forum.kirupa.com/t/how-to-modify-the-code-to-work-after-30-seconds/323868/1 "2011-07-21T19:07:22Z")

</div>

Hi,

I have the following code with type writing effect which is working cool. But I want this code to start after 30 seconds so that some of the animation will be finished playing animation.

```auto
How to modify the code, Please.

var myText:String; 
var counter:int = 0; 

var format : TextFormat = new TextFormat();
format.size = 13;
format.font = "Verdana";
format.bold = false;
format.color = 0x65FFFF; 
//format.color = 0xFFFFFF; 

var textField : TextField = new TextField();
textField.width = 600;
textField.height = 650;
textField.selectable = false;
textField.wordWrap = true;
textField.defaultTextFormat = format;
textField.x = textField.y =10;
addChild(textField);
                
var textLoader:URLLoader = new URLLoader(new URLRequest("Text.txt"));
textLoader.addEventListener(Event.COMPLETE, function(e:Event){initText(e.target.data);});

function initText(string:String):void{
    myText = string; 
    addEventListener(Event.ENTER_FRAME, writeText); 
}

function writeText(e:Event):void{
    if (counter <= myText.length){
            textField.text = myText.substr(0,counter); 
            counter++; 
    }
    else{
        removeEventListener(Event.ENTER_FRAME,writeText); 
    }
}

```

Thanks in advance for any help.

Regards.
