Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Removing Focus from input text field

Explorer ,
Apr 03, 2012 Apr 03, 2012

How to remove focus from

1. The input field if the user clicks outside the input field.

TOPICS
ActionScript
1.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 03, 2012 Apr 03, 2012
LATEST

While it depends partly on what is outside the textfield, one way would be to add an event listener to the stage and then check what was clicked.  If it happened to be the stage, set the focus onto the stage.

stage.addEventListener(MouseEvent.MOUSE_UP, focusStage);

function focusStage(evt:MouseEvent):void {
    if(evt.target == stage){
       stage.focus = stage;
    }
}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines