Button.labelPlacement

Availability

Flash Player 6 (6.0.79.0).

Edition

Flash MX 2004.

Usage

buttonInstance.labelPlacement

Description

Property; sets the position of the label in relation to the icon. The default value is "right". The following are the four possible values; the icon and label are always centered vertically and horizontally within the bounding area of the button:

Example

With a button on the Stage with instance name my_button, and a symbol in the Library panel with the linkage identifier happiness, the following code sets the label alignment to the left of the icon:

my_button.icon = "happiness";
my_button.label = "Test Button";
my_button.labelPlacement = "left";

You can also create the button and set the alignment entirely in ActionScript using the method UIObject.createClassObject(). First drag the Button component from the Components panel to the current document's library, so it 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", icon: "happiness", labelPlacement: "left"});


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/00002590.html