I spent a few hours going nuts with this one today, so save yourself some time by reading this post. Suppose that you have some content that you want to scale when the flash player is re-sized. Suppose also that you have added this line in order to accomplish it:
stage.scaleMode = StageScaleMode.SHOW_ALL;
Now imagine that you test that program and are stretching the window around. Everything seems to be working great, except that there are some items that you have used masks on and the mask is floating around all over the place!
There is a VERY simple fix for this. In AS3 projects you MUST add the mask itself to the display list, or it will NOT scale with your project.
So, for example:
var myMask:Sprite = new Sprite();
// YOU MUST FIRST ADD IT TO THE DISPLAY LIST OR IT WILL NOT SCALE WITH THE CONTENT!!!
myContent.mask = myMask
I figured this out by just trying it on a hunch. I’m guessing that by adding it to the display list it has something to reference for what size it is ‘supposed’ to be. When you simple add a mask to a display object’s mask property, it does not make it a child of that object automatically; therefore it does not scale with it. Weird if you ask me, but there it is. I hope this helps!