fl.controls

# ButtonLabelPlacement - AS3 Flash

Package | fl.controls
Class | public class ButtonLabelPlacement
Inheritance | ButtonLabelPlacement Object

Language Version: | ActionScript 3.0

Product Version: | Flash CS3

Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0

The ButtonLabelPlacement class defines constants for the values of the `labelPlacement` property of a Button, CheckBox, or RadioButton component.

View the examples

Related API Elements

LabelButton.labelPlacement

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | constructor : Object A reference to the class object or constructor function for a given object instance. | Object

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | hasOwnProperty(name:String):Boolean Indicates whether an object has a specified property defined. | Object
|  | isPrototypeOf(theClass:Object):Boolean Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. | Object
|  | propertyIsEnumerable(name:String):Boolean Indicates whether the specified property exists and is enumerable. | Object
|  | setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void Sets the availability of a dynamic property for loop operations. | Object
|  | toLocaleString():String Returns the string representation of this object, formatted according to locale-specific conventions. | Object
|  | toString():String Returns the string representation of the specified object. | Object
|  | valueOf():Object Returns the primitive value of the specified object. | Object

Public Constants

| Constant | Defined By
--- | --- | ---
|  | BOTTOM : String = "bottom" [static] The label appears below the icon. | ButtonLabelPlacement
|  | LEFT : String = "left" [static] The label appears to the left of the icon. | ButtonLabelPlacement
|  | RIGHT : String = "right" [static] The label appears to the right of the icon. | ButtonLabelPlacement
|  | TOP : String = "top" [static] The label appears above the icon. | ButtonLabelPlacement

Constant Detail

### BOTTOM

Constant

`public static const BOTTOM:String = "bottom"`

Language Version: | ActionScript 3.0

Product Version: | Flash CS3

Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0

The label appears below the icon.

### LEFT

Constant

`public static const LEFT:String = "left"`

Language Version: | ActionScript 3.0

Product Version: | Flash CS3

Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0

The label appears to the left of the icon.

### RIGHT

Constant

`public static const RIGHT:String = "right"`

Language Version: | ActionScript 3.0

Product Version: | Flash CS3

Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0

The label appears to the right of the icon.

### TOP

Constant

`public static const TOP:String = "top"`

Language Version: | ActionScript 3.0

Product Version: | Flash CS3

Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0

The label appears above the icon.

Examples How to use this example
ButtonLabelPlacementExample.as
The following example demonstrates the possible values for the ButtonLabelPlacement class:
Copy

    package {
        import fl.controls.Button;
        import fl.controls.ButtonLabelPlacement;
        import flash.display.Sprite;

        public class ButtonLabelPlacementExample extends Sprite {
            private var topButton:Button;
            private var bottomButton:Button;
            private var leftButton:Button;
            private var rightButton:Button;

            public function ButtonLabelPlacementExample() {
                // ButtonLabelPlacement.TOP
                var topButton:Button = new Button();
                topButton.setStyle("icon", Icon);
                topButton.labelPlacement = ButtonLabelPlacement.TOP;
                topButton.label = ButtonLabelPlacement.TOP;
                topButton.move(10, 10);
                topButton.setSize(120, 120);
                addChild(topButton);

                // ButtonLabelPlacement.BOTTOM
                var bottomButton:Button = new Button();
                bottomButton.setStyle("icon", Icon);
                bottomButton.labelPlacement = ButtonLabelPlacement.BOTTOM;
                bottomButton.label = ButtonLabelPlacement.BOTTOM;
                bottomButton.move(140, 10);
                bottomButton.setSize(120, 120);
                addChild(bottomButton);

                // ButtonLabelPlacement.LEFT
                var leftButton:Button = new Button();
                leftButton.setStyle("icon", Icon);
                leftButton.labelPlacement = ButtonLabelPlacement.LEFT;
                leftButton.label = ButtonLabelPlacement.LEFT;
                leftButton.move(270, 10);
                leftButton.setSize(120, 120);
                addChild(leftButton);

                // ButtonLabelPlacement.RIGHT
                var rightButton:Button = new Button();
                rightButton.setStyle("icon", Icon);
                rightButton.labelPlacement = ButtonLabelPlacement.RIGHT;
                rightButton.label = ButtonLabelPlacement.RIGHT;
                rightButton.move(400, 10);
                rightButton.setSize(120, 120);
                addChild(rightButton);
            }
        }
    }

    import flash.display.Sprite;

    class Icon extends Sprite {
        public function Icon() {
            this.graphics.beginFill(0xFF0000);
            this.graphics.drawRect(0, 0, 20, 20);
            this.graphics.endFill();
        }
    }

© 2015 Adobe Systems Incorporated. All rights reserved.
Mon Apr 10 2017, 12:28 PM -07:00