Hi guys, I’ve been working on my class for a while now and everything is running without errors however my PlayerPic doesn’t actually move when the arrow keys are pressed which it’s meant to. Can some please help me.
package {
import flash.display.MovieClip;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.events.KeyboardEvent;
import flash.ui.Keyboard;
public class PlayerPic extends MovieClip {
public function PlayerPic()
{
// constructor code
trace ("PlayerPic Constructer")
}
function arrowMove(event:KeyboardEvent):void
{
if (event.keyCode == Keyboard.LEFT)
{
this.x -= 5;
if (this.x < 0)
{
this.x = 0;
}
}
if (event.keyCode == Keyboard.RIGHT)
{
this.x += 5;
if (this.x > 250)
{
this.x = 250;
}
}
if (event.keyCode == Keyboard.UP)
{
this.y -= 5;
if (this.y < 0)
{
this.y = 0;
}
}
if (event.keyCode == Keyboard.DOWN)
{
this.y += 5;
if (this.y > 550)
{
this.y = 550;
}
}
}
}
}