I am building a Flash project which is intended to be a very visually appealing application. In order to accomplish this, I am hoping to make the application fit to 100% size of the browser window and fill its contents with visually appealing images and interactivity.
Some of these objects I would like to maintain a consistent distance from a particular side of the stage, say, the left side. Here is my code I am using to keep a logo 100px from the left side of the application during run-time and re-size:
import flash.events.Event;
var logo:Logo = new Logo();
stage.addEventListener(Event.RESIZE, resizeListener);
function resizeListener(e:Event):void {
logo.x = 100;
}
logo.x = 100;
logo.y = stage.stageHeight / 2;
logo.width = logo.width / 2;
logo.height = logo.height / 2;
addChild(logo);
The problem with this is, for some reason, the logo stays in the spot, and doesn't maintain a consistent distance from the left side of the stage when the application is re-sized. Could someone help me revise the above code to keep the logo 100px from the left side?
Thank you for your help.