Aspire UI Components (Flash ActionScript 3.0) Docs

uiLabel

Strictly speaking, the uiLabel component is not a UI control - it is not focusable and the user does not interact with the component. It is used to display text alongside an image. Use the uiText instead if you want to display text only. Likewise, the uiImage class should be used if you just want to display an image.


Using uiLabel

ActionScript 3.0 Example

import com.ghostwire.ui.containers.uiBox;
import com.ghostwire.ui.containers.uiForm;
import com.ghostwire.ui.controls.uiLabel;
import com.ghostwire.ui.controls.uiPushButton;
import com.ghostwire.ui.controls.uiTextInput;
import com.ghostwire.ui.enums.ALIGN;
 
// ** label **
var passLabel:uiLabel = new uiLabel("Password","alert.png");
passLabel.alignY = ALIGN.CENTER;
 
// ** text input **
var passInput:uiTextInput = new uiTextInput();
passInput.alignY = ALIGN.CENTER;
passInput.displayAsPassword = true;
 
// ** push button **
var passBtn:uiPushButton = new uiPushButton("Submit");
passBtn.alignY = ALIGN.CENTER;
 
// ** box layout container **
var passBox:uiBox = new uiBox();
passBox.spacing = 10;
passBox.addChild(passLabel);
passBox.addChild(passInput);
passBox.addChild(passBtn);
 
// ** top level form container **
var passForm:uiForm = new uiForm();
passForm.defaultButton = passBtn;
passForm.addChild(passBox);
 
// ** add to display list **
addChild(passForm);

uiLabel example


Text Position

By default, the text is positioned to the right of the image. You can change this setting via the textPosition property. Qualified values for the textPosition property are POSITION.BOTTOM, POSITION.LEFT, POSITION.RIGHT, and POSITION.TOP1).

passLabel.textPosition = POSITION.BOTTOM;

The text position can be adjusted


"uiimage" and "uitext"

The uiLabel component is actually a composite embedding a uiImage instance and a uiText instance. You can access these embedded uiImage and uiText instances via the properties uiimage and uitext respectively.


API Reference

For more information on the members of the com.ghostwire.ui.controls.uiLabel class, please refer to the API Reference.


1) Import com.ghostwire.ui.enums.POSITION
 
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki