May 3, 2009 at 13:45[AS3] Using stage.focus

All InteractiveObject based object can be focused :

displayobject_subclasses

You don’t need the fl.managers.FocusManager to set or remove the focus on objects :

// to set the focus
stage.focus = myTextField;

// to remove the focus
stage.focus = null;

If the focused InteractiveObject is hided, it loose the focus :

stage.focus = myTextField;

trace(stage.focus); // output : [object TextField]

myTextField.visible = false;

trace(stage.focus); // output : null

To remove the crappy yellow rect on all focused InteractiveObject :

stage.stageFocusRect = null;
Written by Rémi.T under Coding.
Tags: , .
1 comment »

1 Comment

  1. Comment by Kawika on September 1, 2010 @ 01:58

    Perfect! I wanted to hide the crappy yellow rectangle, and now I know how!! Thanks!

Leave a comment