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);
_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.

Please follow and like us:

Leave a Comment