Thursday, 29 September 2011

Buttons

I originally has trouble trying to get buttons to work but once I had worked it out it was quite simple. I would do the following:


1. Convert the shape to a symbol  > make it a button.
2. Give it an 'instance name'.
3. Add the following code to it in the actions panel - 


savingtips.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame);
function fl_ClickToGoToAndStopAtFrame(event:MouseEvent):void
{
gotoAndStop(1, "Scene 2");
}


I decided to make my application using different scenes rather than frames as I personally found this easier.

No comments:

Post a Comment