[CS3][AS2] Hello with this 100% flash website code
Hi all,
this has always been haunting me for a while, I mean doing a 100% Flash website, which takes the browser.
I've been able to make the Background take the browsers width and height at 100% using this code
Code:
Stage.align = "TL";
Stage.scaleMode = "noScale";
setProperty(bg_mc, _width, Stage.width);
setProperty(bg_mc, _height, Stage.height);
var resizeListener:Object = new Object();
Stage.addListener(resizeListener);
resizeListener.onResize = function () {
setProperty(bg_mc, _width, Stage.width);
setProperty(bg_mc, _height, Stage.height);
};
For the Bground its ok, but on a layer above the background layer, I have a movieclip (cover_mc) which contains some graphics for a website. What i want to do is
When I resize the broswer, also resize the movieclip cover_mc to fit the users screen and to keep it centered.
I have the Fla Attached as a zip file, can someone please help me wiz it? I going mad with this since i've never made a 100% flash !
i still can figure out how to resize the cover_mc when the broswer is resize.
here is the code im using
Code:
stop();
// noScale prevents content in the movie resizing (unless we tell it to!)
Stage.scaleMode = "noScale";
Stage.showMenu = false;
// LT means all positions measured from the top left hand corner
Stage.align = "TL";
// a function to be called when the movie resizes
// this will resize the background clip to fill the stage
bg_mc.onResize = function() {
this._width = Stage.width;
this._height = Stage.height;
};
// get the bg clip to listen for events (onResize)
// broadcast by the stage object
Stage.addListener(bg_mc);
bg_mc._x = bg_mc._y = 0;
bg_mc.onResize();
//trace(bg_mc._height);
cover._x = Stage.width/2;
cover._y = Stage.height/2;
cover.onResize = function(){
this._x = Stage.width/2;
this._y = Stage.height/2;
}
Stage.addListener(cover);
cover.onResize();