FullScreen Flash mask gotcha

Long time between posts… but thought I’d document this so that anyone else coming across the issue can get a quicker fix than I found.

The problem I was having was with a masked area that wasn’t resizing along with the rest of the content when stage.displayState = StageDisplayState.FULL_SCREEN

The fix for this was to ensure that the mask was actually added to the stage before being applied to the DisplayObject you wanted to mask. Here’s some code:

var __mask:Shape = new Shape();
__mask.graphics.beginFill(0xffcc00, 1);
__mask.graphics.drawRect(GRAPH_X, GRAPH_Y – 40, GRAPH_WIDTH, GRAPH_HEIGHT+39);
__mask.graphics.endFill();
addChild(__mask);
_barsHolder.mask = __mask;

The fix wasn’t entirely obvious as masks don’t generally need to be added to the DisplayList to function properly. Obviously when you’re having the Flash go fullscreen you do.

Hopefully that helps someone else avoid the issue I was having.

Be Sociable, Share!
Tagged with: , ,
Posted in Actionscript, Flash

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Posts this month
July 2011
M T W T F S S
« Oct   Aug »
 123
45678910
11121314151617
18192021222324
25262728293031
Archives