# \[FMX\]setInterval moveTo function

**URL:** <https://forum.kirupa.com/t/fmx-setinterval-moveto-function/48288>\
**Category:** flash\
**Created:** [April 12, 2004, 7:16am UTC](https://forum.kirupa.com/t/fmx-setinterval-moveto-function/48288 "2004-04-12T07:16:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dboers](https://avatars.discourse-cdn.com/v4/letter/d/bbe5ce/32.png) [@dboers](https://forum.kirupa.com/u/dboers)\
**Post date:** [April 12, 2004, 7:16am UTC](https://forum.kirupa.com/t/fmx-setinterval-moveto-function/48288/1 "2004-04-12T07:16:44Z")

</div>

I have four buttons on the stage which I want to move 20 pixels up (easing) and fade in from 0 to 100. But I want them to appear with a interval of 1 second. I came up with the following function:

```auto
function showClips(yPos, alpha, speed) {
 var endY = yPos - this._y;
 this._y += eindY /speed;
 var endA = alpha - this._alpha;
 this._alpha += endA / speed;
 if (clips.length) {
 clips[0]._visible = true;
 clips.splice(0, 1);
} else {
clearInterval(id);
}
updateAfterEvent();
}
var clips = [];
 var index = 0;
 while (index++ < 4) {
 var clip = eval("but_"+(index < 5 ? "0" : "")+index);
 clip._visible = false;
 clips.push(clip);
}

var id = setInterval(showClips, 1000, 304, 100, 3);

```

But it isn’t working. The clips just appear on the stage without movement and fading. What is wrong with my function?
