Hi all. I’m no novice to Flash, but this has just got me completely stumped. I’m trying to make a movieclip that is always the width of the stage, and always vertically centered, using an onEnterFrame function. However…it’s just refusing to work. I’ve looked at it over and over and can’t figure out why it just won’t resize/go to the correct co-ordinates.
I’ve attached the .fla so you can have a peek. Please help!
The code I’m confused about is:
stop();
Stage.scaleMode = “noscale”;
var resizeListener:Object = new Object();
Stage.addListener(resizeListener);
setBarPosition = function(){
setProperty(bars_mc, _width, Stage.width);
setProperty(bars_mc, _x, 0);
setProperty(bars_mc, _y, Stage.height/2);
}
setBarPosition();
resizeListener.onResize = function(){
setBarPosition();
}
///////////////////////////////////////////////////////////////////////////////////////////
//EDIT - No worries, I found out what was wrong. I changed it to:
setBarPosition = function(){
setProperty(bars_mc, _width, Stage.width);
setProperty(bars_mc, _x, -(Math.round((Stage.width - 800)/2)));
setProperty(bars_mc, _y, 300);
}
For anyone that is trying to do full browser flash, I HEAVILY recommend http://www.genericwebaddress.com/articles-flash/fullscreen-flash-movie-tutorial-02.html
Apparently when Flash is set to ‘noScale’ the co-ordinate system is a bit…different. So yeah, have a read. =)