Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 04-18-2006, 12:17 PM   #1
kaiohon
Registered User
 
Join Date: Apr 2006
Posts: 38
Default remove Focus

How to remove focus from InputText field?
I have a InputText field with the default value <Enter name>. When user clicks - he writes whatever he wants. After he presses enter the fiel should loose focus.. that is there should be no cursor blinking in that field.

Currently i have

TextListener = new Object();
TextListener.onSetFocus = function (oldFocus, currentFocus)
{
if (currentFocus._name == input_txt._name )
{
if (input_txt.text == "<Enter name>")
{
input_txt.text = "";
input_txt.textColor = 0x000000;
}

}
}
Selection.addListener(TextListener);
KeyListener = new Object();
KeyListener.onKeyUp = function ()
{
if (Key.getCode() == 13)
{
//the InputText field must loose focus
}
}
Key.addListener(KeyListener);

Can you help?
kaiohon is offline   Reply With Quote
Old 04-18-2006, 12:38 PM   #2
astgtciv
Resu Deretsiger
 
astgtciv's Avatar
 
Join Date: Jul 2005
Location: St-Petersburg, Russia
Posts: 2,329
Default

Selection.setFocus(null);
__________________
overstream.net: add subtitles to online videos (youtube, vimeo, blip.tv...).
astgtciv is offline   Reply With Quote
Old 04-18-2006, 01:13 PM   #3
kaiohon
Registered User
 
Join Date: Apr 2006
Posts: 38
Default

Thanks!!! That worked for me!
kaiohon is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
one template, many looks? subquark ActionScript 1.0 (and below) 1166 10-29-2013 06:18 PM
help with my focus funtions Navarone ActionScript 2.0 4 09-07-2005 01:15 AM
Focus will not leave textbox shwoll ActionScript 2.0 0 05-27-2005 06:32 AM
A tough focus problem juststeve ActionScript 2.0 0 08-11-2004 01:09 AM
Change focus of textfield once length is 2... FarFeTTu ActionScript 1.0 (and below) 3 06-28-2003 10:42 AM


All times are GMT. The time now is 01:00 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.