# Need some help

**URL:** <https://forum.kirupa.com/t/need-some-help/254876>\
**Category:** Uncategorized\
**Created:** [March 16, 2008, 8:12pm UTC](https://forum.kirupa.com/t/need-some-help/254876 "2008-03-16T20:12:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Z\_Hero](https://avatars.discourse-cdn.com/v4/letter/z/e79b87/32.png) [@Z\_Hero](https://forum.kirupa.com/u/Z_Hero)\
**Post date:** [March 16, 2008, 8:12pm UTC](https://forum.kirupa.com/t/need-some-help/254876/1 "2008-03-16T20:12:06Z")

</div>

Yoh, I’m new here, and I’ve had Adobe Flash CS3 for…4 weeks, I think. Anyways, working on a game and, as all the sites and tutorials say, the hardest part is AI. Anyways, I’ve decided to take a different approach to it, one noted in the Megaman Zero games. Anyways, here’s my code.

onClipEvent(enterFrame){  
tx = this.\_x; //The enemy’s x  
mx = \_root.char.\_x; // the main character’s x  
rx = tx - mx; // The enemy’s x minus the character’s x  
}

onClipEvent (enterFrame) {  
tx = mx - 10; //When this frame appears, go to the Main character’s x and stay there.  
}

What I wanted that to do was make the frame that it was on AND the frames after it to move where ever the main character is (char) -10 on the x axis. But for whatever reason, it doesn’t work.

Thanks in Advance
