# AS3 to AS2 Conversion Help

**URL:** <https://forum.kirupa.com/t/as3-to-as2-conversion-help/328610>\
**Category:** flash\
**Created:** [May 29, 2012, 7:46pm UTC](https://forum.kirupa.com/t/as3-to-as2-conversion-help/328610 "2012-05-29T19:46:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dibidoolandas](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@Dibidoolandas](https://forum.kirupa.com/u/Dibidoolandas)\
**Post date:** [May 29, 2012, 7:46pm UTC](https://forum.kirupa.com/t/as3-to-as2-conversion-help/328610/1 "2012-05-29T19:46:59Z")

</div>

Hey guys, I haven’t had a ton of time to futz with this problem and I’m a bit of a coding noob so forgive me that, but I found a solid AS3 function that skews a movieclip based on mouse position that’s also relatively simple:

```auto
import flash.events.Event;

stage.addEventListener(MouseEvent.MOUSE_MOVE, kk)

function kk(evt:Event):void
{
   
   var rotY: Number = (mouseY-(stage.stageHeight/2))/(stage.height/2)*(10);
var rotX: Number = (mouseX-(stage.stageWidth/2))/(stage.width/2)*(-10);
box_mc.rotationX = rotY;
box_mc.rotationY = rotX;
}

```

Only problem is I actually need the code in AS2, since the site we’re developing has already been started in AS2 and we’ll be plugging this into it. Is there a way to convert this down to AS2? Thanks for your time!
