Search Our Web Design Blog...

Wednesday, April 18, 2012

  • make a new layer for buttons
  • draw an object/shape
  • select that shape 
  • convert it to a button (modify > convert to symbol > button
  • Change the instance name of your button (in the properties window) to something you can remember
  • Create an actions layer
  • on frame 1 of the actions layer paste in the code below (you will need to open the actions window to do so, window>actions)
  • change the code to have your instance name and a unique function name (same in both parts of the code)
done!

yourButtonsInstanceName.addEventListener(MouseEvent.CLICK, functionname);

function functionname(event:MouseEvent):void
{
stop();
}

No comments:

Post a Comment