Im creating a FBF microsite for a project of mine, and im having issues with the creation of the GUI
Basically its a full page flush of a colour, a logo that is hovering center (always) and a nav bar that runs 'docked' to the bottom of the screen.
Here is the AS for the code.
Code: Select all
Stage.align = "TL";
Stage.scaleMode = "noScale";
// Center logo on load
logo._x = Stage.width / 2;
logo._y = Stage.height / 2;
this.createEmptyMovieClip("menu_mc", this.getNextHighestDepth());
menu_mc.lineStyle(0, 0xC5946B, 100, true, "none", "round", "miter", 1);
menu_mc.beginFill(0xC5946B);
menu_mc.moveTo(Stage.width - Stage.width , Stage.height - 50);
menu_mc.lineTo(Stage.width, Stage.height - 50);
menu_mc.lineTo(Stage.width, Stage.height);
menu_mc.lineTo(Stage.width - Stage.width, Stage.height);
menu_mc.lineTo(Stage.width - Stage.width , Stage.height - 50);
menu_mc.endFill();
bg.onResize = function() {
var imageAspectRatio = this._width/this._height;
var stageAspectRatio = Stage.width/Stage.height;
if (stageAspectRatio>=imageAspectRatio) {
this._width = Stage.width;
this._height = Stage.width/imageAspectRatio;
} else {
this._height = Stage.height;
this._width = Stage.height*imageAspectRatio;
}
this._x = Stage.width/2;
this._y = Stage.height/2;
// Center logo on resize
logo._x = Stage.width / 2;
logo._y = Stage.height / 2;
};
Stage.addListener(bg);
bg.onResize();
How do i go about making sure that when its resized the prev mc's are removed and a new 1 is done.
(my AS isnt as good as i thought so speak down to me all you like )
Thanks for any hints,
Buddha