# Need Help using class in AS3

**URL:** <https://forum.kirupa.com/t/need-help-using-class-in-as3/295429>\
**Category:** flash\
**Created:** [August 30, 2009, 2:44am UTC](https://forum.kirupa.com/t/need-help-using-class-in-as3/295429 "2009-08-30T02:44:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jorhfm](https://avatars.discourse-cdn.com/v4/letter/j/45deac/32.png) [@Jorhfm](https://forum.kirupa.com/u/Jorhfm)\
**Post date:** [August 30, 2009, 2:44am UTC](https://forum.kirupa.com/t/need-help-using-class-in-as3/295429/1 "2009-08-30T02:44:48Z")

</div>

Hi  
I’m realtive new to Flash, and I want to make a game where I can move my character using the arrows. I’m trying to do the function that receives the inputs inside a class, but I can’t call the function without errors.  
This is my Player.as:

```auto
package teste{

    import flash.display.*;
    import flash.ui.Keyboard;
    import flash.events.*;

    public class Player extends MovieClip {

        public function Move(event:KeyboardEvent) {
            if (event.keyCode == 37 || event.keyCode == 65) {
                trace("a");
            }

        }

    }
}

```

And this is the code inside the first frame of my .fla:

```auto
import teste.Player;

var pla:Player = new Player();

pla.Move(event);

```

I get the following error in the line 5 of my .fla:  
1120: Access of undefined property event.

Someone could help me?

Thanks for all the attention.
