# as2 to as3 Migration help...easy question!

**URL:** <https://forum.kirupa.com/t/as2-to-as3-migration-help-easy-question/302585>\
**Category:** flash\
**Created:** [January 3, 2010, 11:51pm UTC](https://forum.kirupa.com/t/as2-to-as3-migration-help-easy-question/302585 "2010-01-03T23:51:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ishiaru](https://avatars.discourse-cdn.com/v4/letter/i/439d5e/32.png) [@ishiaru](https://forum.kirupa.com/u/ishiaru)\
**Post date:** [January 3, 2010, 11:51pm UTC](https://forum.kirupa.com/t/as2-to-as3-migration-help-easy-question/302585/1 "2010-01-03T23:51:06Z")

</div>

Hey guys, first of I would like to apologize if this question has been already answered

I need help translating this follow AS2 code:

```php
onClipEvent(enterFrame){
   if(Key.isDown(Key.LEFT)){
      _x -= 5;
   }else if(Key.isDown(Key.RIGHT)){
      _x += 5;
}

```

I’ve been having a lot of trouble understanding AS3 and I would be eternally grateful for help 😃  
Thanks!
