8

How do i remove the yellow border - focusRect - in as3 I've tried Stage.focusRect = false but that doesn't do the job.

1.21 gigawatts
  • 16,517
  • 32
  • 123
  • 231

3 Answers3

22
stage.stageFocusRect = false;

More info: Rockabit blogpost

:)

ndequeker
  • 7,932
  • 7
  • 61
  • 93
4

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;
gniourf_gniourf
  • 44,650
  • 9
  • 93
  • 104
3

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.