| gooselips 2006-10-13, 6:33 am |
| hello there.
reasonably new to the world of scripting in flash - been using the good old time line for a while though ;)
just a quick question:
trying to scale the bg image to what ever size the browser is re-sized to.
I have been trying to use this code below. I have made sure that all the instances are correctly named and that the published settings are correct (scale 100 x 100).
if anyone has any ideas, i would love to hear them.
function initScale() {
screenInitWidth = 640;
video_mc.initWidth = video_mc._width;
video_mc.ratio = video_mc._height/video_mc._width;
var stuff = new Object();
stuff.onResize = function() {
stretchIt();
}
function stretchIt() {
//image
screenRatio = Stage.height/Stage.width;
if (video_mc.ratio>screenRatio) {
video_mc._width = Math.round(Stage.width + 1);
video_mc._height = Math.round(video_mc._width*video_mc.ratio);
} else {
video_mc._height = Math.round(Stage.height + 1);
video_mc._width = Math.round(video_mc._height/video_mc.ratio);
}
//footer
}
Stage.addListener(stuff);
Stage.scaleMode = "noScale";
stretchIt();
}
initScale(); |