How do i remove the yellow border - focusRect - in as3 I've tried Stage.focusRect = false but that doesn't do the job.
3 Answers
- 7,932
 - 7
 - 61
 - 93
 
- 
                    2Little addition: you need to set this before you use focus. (at least it works like this at me) – Ákos Nikházy Aug 13 '12 at 11:57
 
I faced the same problem while I was making a Game. I wanted focus on my main class by typing:
stage.focus = this;
but a yellow rectangle appeared.
Then I typed:
stage.focus = this;
this.focusRect = false;
but this time, not a yellow rectangle but a yellow line appeared.
Then I typed:
this.focusRect = false;
stage.focus = this;
And this time it worked. No yellow rectangle or line appeared. So, I realized that order does matter sometimes.
If you're working with class just import:
import flash.display.Stage;
- 44,650
 - 9
 - 93
 - 104
 
- 61
 - 2
 
Try:
focusRect = false;
In your class' constructor. Worked for me :-)
From the docs: flash.display.InteractiveObject.focusRect(focusRect:Object):void
Specifies whether this object displays a focus rectangle. It can take one of three values: true, false, or null. Values of true and false work as expected, specifying whether or not the focus rectangle appears. A value of null indicates that this object obeys the stageFocusRect property of the Stage.
- 29
 - 1