# Rotating and Moving a Video Clip using keyboard

**URL:** <https://forum.kirupa.com/t/rotating-and-moving-a-video-clip-using-keyboard/217435>\
**Category:** flash\
**Created:** [February 26, 2007, 11:01pm UTC](https://forum.kirupa.com/t/rotating-and-moving-a-video-clip-using-keyboard/217435 "2007-02-26T23:01:09Z")\
**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 26, 2007, 11:01pm UTC](https://forum.kirupa.com/t/rotating-and-moving-a-video-clip-using-keyboard/217435/1 "2007-02-26T23:01:09Z")

</div>

Hi

Im am trying to rotate a movie clip and then move it in the direction it is facing usign 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
