Friday, October 31, 2014

Making a Button in Adobe Flash

Adobe flash has a lot of cool opportunities and ideas, like making a button to make your story advance on through its pages or frames. To make a button, you first start out with making a shape, wether it be a circle or a square, it really doesn't matter. Then you right click on the shape and click "convert to symbol" and once you click that, make it a button. For every button you use, i would advise changing the instance name to button, button1, button2 etc. You also need to code the button to where it stops the frame when it pops up instead of it continuing on the project on its own. To code the button you type this in.

stop();

myButton.addEventListener(MouseEvent.CLICK, myButtonClick);

function myButtonClick(ev:MouseEvent):void
{
gotoAndPlay(2);
}

And then change the instance name "in this case" (myButton) every time you use another button.

No comments:

Post a Comment