Button Component Tutorial

Published :
Author :
Adam Khoury
In this Flash AS3 instructional video and free fla source file download beginners can learn how to use the flash button component to dynamically create buttons, place buttons, and make button component instances toggle property work. There are more properties for the button component instance that you can research to pinpoint the exact functionality you require in your application when using the button component. import fl.controls.Button; var myButton:Button = new Button(); myButton.label = "Hide Clip"; myButton.name = "btn1"; myButton.toggle = true; myButton.move(225, 30); addChild(myButton); myButton.addEventListener(Event.CHANGE, changeHandler); function changeHandler (event:Event):void { if (event.currentTarget.selected == true) { my_mc.visible = false; myButton.label = "Show Clip"; } else { my_mc.visible = true; myButton.label = "Hide Clip"; } }