# I need some help with Programatic Movement

**URL:** <https://forum.kirupa.com/t/i-need-some-help-with-programatic-movement/168663>\
**Category:** flash\
**Created:** [November 9, 2005, 3:23am UTC](https://forum.kirupa.com/t/i-need-some-help-with-programatic-movement/168663 "2005-11-09T03:23:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Smeegel](https://avatars.discourse-cdn.com/v4/letter/s/46a35a/32.png) [@Smeegel](https://forum.kirupa.com/u/Smeegel)\
**Post date:** [November 9, 2005, 3:23am UTC](https://forum.kirupa.com/t/i-need-some-help-with-programatic-movement/168663/1 "2005-11-09T03:23:52Z")

</div>

Hello,

I am a first time user of this site and a novice with actionscript. I am currently attempting to create an interface that involves the flying in of birds from one point to another using programatic movement. So, to reduce the amount of coding I need to do I’ve attempted to create my own function, but have failed dismally. Here is what I currently have

//progmovement function for all birds  
//handle onEnterFrame event  
function birdFlight(){  
var marker="";  
var bird=""  
if(\_root.running && Math.abs(\_root.marker.\_y-this.\_y)\<1){  
//set position and hang out  
this.\_y = \_root.marker.\_y;  
\_root.running = false;  
} else if (\_root.running){  
this.\_y-=(this.\_y-\_root.marker.\_y)_.5;  
}  
if(\_root.running && Math.abs(\_root.marker.\_x-this.\_x)\<1){  
//set position and hang out  
this.\_x = \_root.marker.\_x;  
\_root.running = false;  
} else if (\_root.running){  
this.\_x-=(this.\_x-\_root.marker.\_x)_.5;  
} else {  
//wait for button press  
}  
};

I have no idea what to do and I am really stuck. If anyone could help me I’d be extremely greatful.

Thanks!
