PDA

View Full Version : TextInput Clear on Mouse Click


shebimangalath
12-25-2008, 08:06 AM
Could you please give me the code for "TextInput Clear on Mouse Click"

Here is my test :-


import fl.controls.TextInput;

var ti:TextInput = new TextInput();
addChild(ti);
ti.text = "Hello World";

ti.addEventListener(Event.CHANGE, textEntered);

function textEntered(e:Event){
ti.text = "";
}


It is not working with mouse click.... plss help me..

rawmantick
12-25-2008, 08:24 AM
Here is the list of text field events (http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/text/TextField.html#eventSummary). I'd choose click.

runawayprisoner
12-25-2008, 05:27 PM
Could you please give me the code for "TextInput Clear on Mouse Click"

Here is my test :-


import fl.controls.TextInput;

var ti:TextInput = new TextInput();
addChild(ti);
ti.text = "Hello World";

ti.addEventListener(Event.CHANGE, textEntered);

function textEntered(e:Event){
ti.text = "";
}


It is not working with mouse click.... plss help me..

Cheap and dirty way:



var ti:TextField = new TextField;
ti.type = 'input';
ti.text = 'hello world';

addChild(ti);

ti.addEventListener('click', die);

function die(e:Event):void {
ti.text = '';
}

shebimangalath
12-27-2008, 05:21 AM
thnxxxxxx... its wrkn nw..