Flash CS3 Documentation |
|||
| ActionScript 2.0 Components Language Reference > Button component > Button.label | |||
Flash Player 6 (6.0.79.0).
Flash MX 2004.
buttonInstance.label
Property; specifies the text label for a button instance. By default, the label appears centered on the button. Calling this method overrides the label authoring parameter specified in the Property inspector or the Component inspector. The default value is "Button".
With a button on the Stage with instance name my_button, the following code sets the label to "Test Button":
my_button.label = "Test Button";
You can also create the button and assign the label entirely in ActionScript using the method UIObject.createClassObject(). First drag the Button component from the Components panel to the current document's library, so the component appears in the library, but not on the Stage. Then, in the first frame of the main timeline, add the following ActionScript:
this.createClassObject(mx.controls.Button, "my_button", 1, {label: "Test Button"});
Flash CS3
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00002589.html