Skip to main content
Known Participant
December 3, 2009
Question

Full Screen Flash preserving location of movieclips

  • December 3, 2009
  • 1 reply
  • 298 views

Let's say we have a bar stretching across the whole top of the screen with the following code:

import flash.display.Sprite;

import flash.display.StageAlign;

import flash.display.StageScaleMode;

import flash.events.Event;

stage.scaleMode = StageScaleMode.NO_SCALE;

stage.align = StageAlign.TOP_LEFT

stage.addEventListener(Event.RESIZE, resizeHandler);

//function to handle background image resize.

function setBackground() {

this.width = stage.stageWidth;

}

setBackground();

function resizeHandler(event:Event):void {

setBackground();

};

Then, lets say we have text inside of this movieclip on the right and left sides... How do you anchor this text to each side without it scaling?

This topic has been closed for replies.

1 reply

December 3, 2009

You don't do it that way. You can't stretch a parent clip without stretching it's children. You'd need to make your bar across the top a separate clip from the text so you can stretch it and then move the text.

Known Participant
December 3, 2009

Okay, that makes sense.  Then if i pull the text out, how would I anchor it to the right when the stage is resized it follows the edge?