2009. február 17., kedd

Actionscript 3.0 - MoveSmiley

stage.addEventListener(KeyboardEvent.KEY_DOWN, moveSmiley);

function moveSmiley(event:KeyboardEvent):void
{
if (event.keyCode == 39)
{
smiley_mc.x += 10;
}
else if (event.keyCode == 37)
{
smiley_mc.x -= 10;
}
}

var myNumber:Number = 80;

/*
if (myNumber == 10)
{
trace("myNumber equals 10");
}
else if (myNumber == 8)
{
trace("myNumber equals 8");
}
else
{
trace("myNumber does not equal 10 OR 8");
}
*/

Nincsenek megjegyzések: