How do i remove the yellow border - focusRect - in as3 I've tried Stage.focusRect = false but that doesn't do the job.
How do I remove the yellow border when an object has focus in Flash?
12.8k Views Asked by AudioBubble At
3
There are 3 best solutions below
0

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;
Try:
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.