i have this code snippet that i originally got from the snippet library, but i'm applying it to a new document. i made a square and converted it to a symbol, then gave an instance name of myMovieClip. i put this actionscript code in the first frame with it:
stage.addEventListener(KeyboardEvent.KEY_DOWN, keymoving);
function keymoving(event:KeyboardEvent):void
{
switch (event.keyCode)
{
case Keyboard.UP:
{
myMovieClip.y -=5;
break;
}
case Keyboard.DOWN:
{
myMovieClip.y +=5;
break;
}
case Keyboard.LEFT:
{
myMovieClip.x -=5;
break;
}
case Keyboard.RIGHT:
{
myMovieClip.x +=5;
break;
}
}
}
and now i get this error: Constructor functions must be instance methods
North America
Europe, Middle East and Africa
Asia Pacific