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

Parameters None
Returns Nothing
Example
    None


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

Parameters pOwner The movie clip on which the new Edit will be drawn.
strName The new Edit instance name.
nDepth The new Edit instance depth.
Returns The reference to new Edit instance
Example
    var edtTest = pseudo.Edit.create(this, "edtTest", 1);
    edtTest.setSize(100, 20);
    
    //Apply the skin to the edit field
    
    edtTest.setLook(pseudo.look.XPLook.getInstance());
    
    //Set some default text
    edtTest.setText("Can Edit");
    
    //Add an event listener to the edit field
    
    var args:Object = new Object();
    args.text = "doubleClick event was invoked for edtTest";
    edtTest.addListener("doubleClick", this, onDoSomething, args);
    
    //Calling these functions will finally draw the component
    
    edtTest.update();
    edtTest.draw();
    
    //Create a second edit field
    
    var edtTest2 = pseudo.Edit.create(this, "edtTest2", 2);
    edtTest2.setSize(100, 20);
    
    //Apply the skin to the edit field
    
    edtTest2.setLook(pseudo.look.XPLook.getInstance());
    
    //Set some default text
    
    edtTest2.setText("Can't Edit");
    
    //Calling this function and passing false as a parameter
    //will make the edit field not editable
    
    edtTest2.setEdit(false);
    
    //Position the second edit field
    
    edtTest2._y = edtTest._y + 30;
    
    //Add an event listener to the edit field
    
    var args2:Object = new Object();
    args2.text = "doubleClick event was invoked for edtTest2";
    edtTest2.addListener("doubleClick", this, onDoSomething, args2);
    
    //Calling these functions will finally draw the component
    
    edtTest2.update();
    edtTest2.draw()
    
    //add a third edit field
    
    var edtTest3 = pseudo.Edit.create(this, "edtTest3", 3);
    edtTest3.setSize(100, 20);
    
    //Apply the skin to the edit field
    
    edtTest3.setLook(pseudo.look.XPLook.getInstance());
    
    //Calling this fraction and passing true as a parameter will make our edit field a password field
    
    edtTest3.setUsePassword(true);
    
    //Position the second edit field
    edtTest3._y = edtTest2._y + 30;
    
    //Add an event listener to the edit field
    
    var args3:Object = new Object();
    args3.text = "doubleClick event was invoked for edtTest 3";
    edtTest3.addListener("doubleClick", this, onDoSomething, args3);
    
    //Calling these functions will finally draw the component
    
    edtTest3.update();
    edtTest3.draw();
    
    //Some function to handle the event
    function onDoSomething(args:Object):Void
    {
      trace(args.text);
    }
    
    // This code will draw the edit 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 complied into the swf file,
    // or you can use another technique and load the skin at a run time.
           


pseudo.Edit.isFocused():Boolean
Use this function to determine whether the edit field has focus

Parameters None
Returns Boolean value indicating whether the edit field has focus.
Example
    None


pseudo.Edit.setEdit(bEdit:Boolean):Void
Use this function if you want to make the field editable or not editable. By default a new edit field created editable

Parameters bEdit Boolean value
Returns Nothing
Example
    None


pseudo.Edit.setSelectable(bSelect:Boolean):Void
Use this function set the edit field selectable or not. Default value is selectable.

Parameters bSelect Boolean value
Returns Nothing
Example
    None


pseudo.Edit.setUsePassword(bUsePassword:Boolean):Void
Use this function to set the edit field a password field.

Parameters bUsePassword Boolean value
Returns Nothing
Example
    None


pseudo.Edit.isEditable():Boolean
Use this function to find out if the edit field is editable or not.

Parameters None
Returns Boolean true or false value
Example
    None
Flash UI Components (c)TUFaT.com, All Rights Reserved.