# Function From AS2 to AS1

**URL:** https://forum.kirupa.com/t/function-from-as2-to-as1/233347
**Category:** flash
**Created:** [July 23, 2007, 8:49am UTC](https://forum.kirupa.com/t/function-from-as2-to-as1/233347 "2007-07-23T08:49:15Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ChromeDemon](https://avatars.discourse-cdn.com/v4/letter/c/258eb7/32.png) [@ChromeDemon](https://forum.kirupa.com/u/ChromeDemon)
#### Post date: [July 23, 2007, 8:49am UTC](https://forum.kirupa.com/t/function-from-as2-to-as1/233347/1 "2007-07-23T08:49:15Z")

</div>

I have this Function:

```auto

var count:Number = 0;
var maxCount:Number = 300
var duration:Number = 500; 

function beginInterval() {
 if(intervalId != null) {
 clearInterval(intervalId);
 }
};

function executeCallback():Void {
mySender();
test++;
callbacker = "Callback" + test ;
};

beginInterval();
intervalId = setInterval(this, "executeCallback", duration);

```

It works in AS2 but not in AS1 … Does sumone know how i can rewrite this so it works in AS1???

thanx in advance

ChromeD
