# Moving an Movie Clip in the direction it is facing

**URL:** https://forum.kirupa.com/t/moving-an-movie-clip-in-the-direction-it-is-facing/217479
**Category:** flash
**Created:** [February 27, 2007, 11:05am UTC](https://forum.kirupa.com/t/moving-an-movie-clip-in-the-direction-it-is-facing/217479 "2007-02-27T11:05:41Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![chaztheman](https://avatars.discourse-cdn.com/v4/letter/c/eb9ed0/32.png) [@chaztheman](https://forum.kirupa.com/u/chaztheman)
#### Post date: [February 27, 2007, 11:05am UTC](https://forum.kirupa.com/t/moving-an-movie-clip-in-the-direction-it-is-facing/217479/1 "2007-02-27T11:05:41Z")

</div>

Hi

Im am trying to rotate a movie clip and then move it in the direction it is facing using the keyboard (left, right = rotate. Up, down = forward and backwards)

I have almost done it using trigonometry but flash doesn’t know what angle the movie clip is facing.

Here is the code i used:  
[INDENT]on (keyPress “\<Up\>”) {  
Dist = 2  
Angle =  
currentY = this.\_y;  
currentX = this.\_x;  
this.\_x = currentX;  
this.\_y = currentY;  
this.\_x = currentX + Dist_math.cos(Angle);  
this.\_y = currentY + Dist_math.sin(Angle);  
}

[/INDENT]As you can see i dont know what to put ‘Angle’ equal to.

Thankyou!!!

Chaztheman
