Hi, im kinnda practicing AS3 and now im trying to make a good character control class, but i'm dealing with some issues, it seems like the character is not answering to the event listeners that i added in the class....
here's the code of the class
package
{
import flash.display.MovieClip;
import flash.events.KeyboardEvent;
import fl.transitions.Tween;
import fl.transitions.TweenEvent;
import fl.transitions.easing.*;
public class character extends MovieClip
{
public var goesUp:Tween;
public function character():void
{
this.addEventListener(KeyboardEvent.KEY_UP, jump);
this.addEventListener(KeyboardEvent.KEY_DOWN, dosomething);
}
private function jump(event:KeyboardEvent)
{
goesUp = new Tween(this.name,"y",None.easeNone,0,100,2,true);
goesUp.start();
trace(this.name);
}
private function dosomething(event:KeyboardEvent)
{
trace("YOU PRESSED DOWN");
}
}
}
just in case someone wants to test it, i uploaded the .fla and the .as to mediafire here
tips, suggestions...are welcomed, =P.