Recipe 13.8. Adding a Button that Can ToggleProblemYou want to add a button that the user can toggle to a selected or deselected state. SolutionAdd a Button component instance and set the toggle parameter to true. DiscussionMore often than not, buttons are used to trigger some action or actions. In such cases, a button like the one described in Recipe 13.7 is quite suitable. However, sometimes you want to use a button that can toggle between a selected and a deselected state. Such a button provides similar functionality to that of a checkbox, but with a slightly different interface. It's actually quite simple to add a button that can be toggled to your Flash application. All you need to do is follow the directions for adding a Button component instance that are given in Recipe 13.7, and then set the toggle parameter to true rather than the default value of false. By default, the button will be deselected when the application starts. However, you can specify that it should default to the selected state by setting the selected parameter to true. See AlsoRecipe 13.7 |
Tripod >> 3pod Tips & Learning and manuals for educations