Monday, July 4, 2011

Create your own character in flash-able to move

  • Create a character ( may be a circle here just for demo)
  • Right click the circle, convert to symbol, select movie clip and then give a name to the character finally pressing ok
  • Right click the character, actions and then select the expert mode



  • type in the following codes:
onClipEvent(enterFrame)
{
if(Key.isDown(Key.UP)){
_y=_y-5;
}
if(Key.isDown(Key.DOWN)){
_y=_y+5;
}
if(Key.isDown(Key.RIGHT)){
_x=_x+5;
}
if(Key.isDown(Key.LEFT)){
_x=_x-5;
}
}

  • Press ctrl+enter
  • you'll get a new screen with your character in it, try pressing UP, DOWN, RIGHT and LEFT keys, you'll for sure enjoy it
The source code can be downloaded from the link

No comments:

Post a Comment