all groups > flash actionscript > july 2004 >
You're in the

flash actionscript

group:

evaluate change in text field after time ????


evaluate change in text field after time ???? Tony
7/5/2004 10:12:09 PM
flash actionscript:
Hi...

anyone know how to do this ?

an input text box.
The user starts typing and the movie checks to see when he has stopped.
So I'm guessing this:
an invisible button under the text field that starts a MC on roll over.
This MC eveluates the value of the text field every half second or so
and when it finds the value has not changed for two seconds it triggers
an action (which will be to use the number in the input box - this part
I can do).

Any help much appreciated
Tony
Re: evaluate change in text field after time ???? Shinchi
7/6/2004 3:00:20 AM
Hi..try this.
input_txt is ur textfield name

stop();
var otxt;
input_txt.onSetFocus = function()
{
timeStart();
otxt = input_txt.text;
}
input_txt.onKillFocus = function()
{
clearInterval(timer);
}
var timer;
function timeStart () {
timer = setInterval(checktxt, 500);
}

var counter = 0;
function checktxt () {
if(input_txt.text == otxt)
{
counter++;
if(counter>10)
trace("User stop typing");
}
else
{
counter = 0;
}
otxt = input_txt.text;

}


AddThis Social Bookmark Button