Recipe 13.7. Adding a Clickable Button


Problem

You want to add a clickable button to a Flash application.

Solution

Create an instance of the Button component and set the parameters. Alternatively, use an instance of a button symbol.

Discussion

The Button component is specifically intended to be used as a button in your Flash forms. You can create a button by dragging an instance from the Components panel to the stage. You'll want to make sure to give the component an instance name via the Property inspector so that you can assign the appropriate actions to it later. Then, you can set the label parameter by way of the Property inspector or the Component Inspector panel, and your button is ready. The label parameter determines what text is displayed on the button instance.

You can also use a button symbol instance or even a movie clip symbol instance with a Flash form. In order to do so, create the button or movie clip symbol and then drag an instance onto the stage, assigning it an instance name as usual. You can read more about using buttons and movie clips in Chapter 9. Using your own button or movie clip symbol instance means that you can more readily customize the look of the button.




Flash 8 Cookbook
Flash 8 Cookbook (Cookbooks (OReilly))
ISBN: 0596102402
EAN: 2147483647
Year: 2007
Pages: 336
Authors: Joey Lott

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net