# Automatic/Intervaled AS movement with easing

**URL:** https://forum.kirupa.com/t/automatic-intervaled-as-movement-with-easing/127479
**Category:** Uncategorized
**Created:** [November 3, 2004, 10:07am UTC](https://forum.kirupa.com/t/automatic-intervaled-as-movement-with-easing/127479 "2004-11-03T10:07:03Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![antnoyce](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@antnoyce](https://forum.kirupa.com/u/antnoyce)
#### Post date: [November 3, 2004, 10:07am UTC](https://forum.kirupa.com/t/automatic-intervaled-as-movement-with-easing/127479/1 "2004-11-03T10:07:03Z")

</div>

I am using some action script to move a masked movieclip around the stage to specific position “onrelease” of a button, which all works really well, the code is attached to a movieclip and it starts something like this:

[AS]onClipEvent (load) {  
\_x = 0;  
\_y = 0;  
div = 5;  
}  
onClipEvent (enterFrame) {  
\_x += (endX-\_x)/div;  
\_y += (endY-\_y)/div;

\_root.home.onRelease = function() {  
endX = 0;  
endY = 0;  
};  
\_root.works.onRelease = function() {  
endX = -250;  
endY = 0;  
}[/AS]

Anyone know how i can achieve this type of movement without a button action ie: after mc loads it will move the movieclip every 5 seconds or so to a specific position (6 in total) with an easing effect.

New to actionscript, so is there an easy way? Iam using MX

Many thanks  
Ant
