private var timeSinceKeyPress:Timer;
private function init() {
textfield.addEventListener(KeyboardEvent.KEY_UP,keyPressed);
timeSinceKeyPress = new Timer(500);
timeSinceKeyPress.addEventListener(TimerEvent.TIMER, stoppedTyping);
}
private function keyPressed(event:KeyboardEvent):void {
timeSinceKeyPress.reset();
timeSinceKeyPress.start();
}
private var stoppedTyping(event:TimerEvent):void {
// whatever it needs to do.
}
So what it does is: When the first character is typed it starts a timer to check wether that's 500 ms ago already, if so, stop checking and do whatever you do. If someone types in between the timer is reset.
Code isn't checked so might be some slight mistakes, but this is the way you should look for a solution.
Kind regards,
Sonja Duijvesteijn
2006/6/1, Sonja Duijvesteijn <
[EMAIL PROTECTED]>:
I don't have any working code but it would be something like:
private var timeSinceKeyPress:Timer;
private function init() {
}2006/6/1, David Harris < [EMAIL PROTECTED]>:Hi Guys,
Does anyone have an example like this:
I have a text input box and the user types in information.
When they have finished typing I would like to fire off an event.
The approach I would like is that once they have stopped typeing for
500ms, the event gets fired.
Has any done something like this and would like to shared code?
Cheers,
David
------------------------ Yahoo! Groups Sponsor --------------------~-->
Get to your groups with one click. Know instantly when new email arrives
http://us.click.yahoo.com/.7bhrC/MGxNAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~->
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
| Web site design development | Computer software development | Software design and development |
| Macromedia flex | Software development best practice |
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

