| 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.
|