Removing the yellow border around hit areas in AIR.

While developing an Adobe AIR for Android application recently I came across a problem were yellow borders where being placed around hit areas. I was not sure what this was or where it came from. After much searching for keywords on google such as ‘yellow border AIR, yellow border hit area AIR’ I eventually found some information on the ASDocs that Adobe provide.

The stage.stageFocusRect property is by default set to true and is the cause of this issue. By setting this property to false the yellow border around your hit areas will disappear. Personally, I think this property could be named better as it was hard to find and unclear.

Here is the full code to remove the border:

addEventListener( Event.ADDED_TO_STAGE,handleAddedToStage,false,0,true);

function handleAddedToStage(e:Event):void
 removeEventListener(Event.ADDED_TO_STAGE, handleAddedToStage);
 stage.stageFocusRect = false;

Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditShare on StumbleUponShare on TumblrEmail this to someone

One thought on “Removing the yellow border around hit areas in AIR.

Leave a Reply

Your email address will not be published.