âš ī¸ Warning âš ī¸ Deprecated Code! This video tutorial contains outdated code.
💡 If you wish to update it, any AI assistant will update the code for you in seconds.

Button Component Tutorial

Published : November 14, 2014   •   Last Edited : November 24, 2025   •   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"; 
    }
}