Removing ugly yellow focusRect in Flex
Right now I’m working on a project in which Flex integrates Flash components in its application and we encountered the infamous yellow focus borders when hitting the tab key from inside the application.
It wasn’t as easy as I thought it would be to Google the solution to prevent the ugly yellow rectangles from being displayed. I’ve found the solution in the Flex help though, so I’ll try to improve the search results on Google by providing the solution here.
When you look at the focusRect property description of flash.display.InteractiveObject, it says: “Specifies whether this object displays a focus rectangle. A value of null indicates that this object obeys the stageFocusRect property set on the Stage.”
And there’s your solution! In your Flex application, create a method that is called on creationComplete and in this method add the following code:
stage.stageFocusRect = null;
Now all focus rectangles are globally disabled in your application. It’s as simple as that.
Dank!
Thanks a ton. I’ve been trying to get rid of this little mf for days now!
Thanks for helping googleize this solution
Awesome tip. Thanks so much for sharing this. I was ripping my hair out.