pseudo.Label class
View Sample :: Return to index  
pseudo.Label.Label(pThis:MovieClip)
Label constructor. You never use the constructor to create this component.

Parameters None
Returns Nothing
Example
    None


pseudo.Label.create(pOwner:MovieClip, strName:String, nDepth:Number):pseudo.Label
Use this static function to create new Label on the specified movie clip. Never use constructor directly to do it.

Parameters pOwner The movie clip on which the new Label will be drawn.
strName The new Label instance name.
nDepth The new Label instance depth.
Returns The reference to new Label instance
Example
    var labelTest = pseudo.Label.create(this, "labelTest", 1);
    labelTest.setSize(100, 20);
    
    //Apply the skin to the Label
    
    labelTest.setLook(pseudo.look.XPLook.getInstance());
    
    //Set some default text
    labelTest.setText("Label One ");
    
    //Add an event listener to the Label
    
    var args:Object = new Object();
    args.text = "doubleClick event was envoked for Label One";
    labelTest.addListener("doubleClick", this, onDoSomething, args);
    
    //Calling these functions will finally draw the component
    
    labelTest.update();
    labelTest.draw();
    
    //Create a second Label
    
    var labelTest2 = pseudo.Label.create(this, "labelTest2", 2);
    labelTest2.setSize(100, 20);
    
    
    //Apply the skin to the Label
    
    labelTest2.setLook(pseudo.look.XPLook.getInstance());
    
    //Set some default text
    
    labelTest2.setText("Label Two ");
    
    //Position the second Label field
    
    labelTest2._y = labelTest._y + 30;
    
    //Add an event listener to the Label
    
    var args2:Object = new Object();
    args2.text = "doubleClick event was invoked for Label Two";
    labelTest2.addListener("doubleClick", this, onDoSomething, args2);
    
    //Calling these functions will finally draw the component
    
    labelTest2.update();
    labelTest2.draw()
    
    //Some function to handle the event
    
    function onDoSomething(args:Object):Void
    {
      trace(args.text);
    }
    
    // This code will draw the Label fields using XP look and feel skin.
    // Please notice that you should always use some skin to create the component,
    // this can be done like in this example, and the skin will be compiled into the swf file,
    // or you can use another technique and load the skin at a run time.
           


pseudo.Label.setHtml(bHtml:Boolean):Void
If true is passed into the function then label contains an HTML text, if false, the label contains a non-HTML text.

Parameters bHtml Boolean value
Returns Nothing
Example
    None


pseudo.Label.setAutoSize(bAutoSize:Boolean):Void
Controls automatic sizing and alignment of lable instance.

Parameters bAutoSize Boolean value
Returns Nothing
Example
    None


pseudo.Label.setWordWrap(bWordWrap:Boolean):Void
If the value passed into the function is true, the label has word wrap; if the value is false, the label does not have word wrap.

Parameters bWordWrap Boolean value
Returns Nothing
Example
    None


pseudo.Label.setMultiline(bMultiline:Boolean):Void
If the value passed into the function is true, the label a multiline text ; if the value is false, the label is a single-line text.

Parameters bMultiline Boolean value
Returns Nothing
Example
    None


pseudo.Label.setText(strText:String):Void
Sets the text that will be displayed in the label.

Parameters strText String value
Returns Nothing
Example
    None


pseudo.Label.getText():String
Returns the text that the label contains.

Parameters None
Returns String value
Example
    None


pseudo.Label.getField():TextField
Returns TextField instance that is wrapped by the label.

Parameters None
Returns TextField value
Example
    None


pseudo.Label.getFieldText():String
Returns the text that TextField instance, wrapped by the label, contains.

Parameters None
Returns String value
Example
    None


pseudo.Label.setAlign(strAlign:String):Void
Sets the text alignment that will be displayed in the label. Possible parameters values are: "left", "center", "right".

Parameters strAlign String value
Returns Nothing
Example
    None
Flash UI Components (c)TUFaT.com, All Rights Reserved.