Hi, Posted this in the ‘Flash 8’ area, but thinking it’s probably more of an action script issue. Help Please!!! …
Hi all,
I’m new to this board so apologies if this is a question/topic that has been raised before. I have been experimenting with full browser flash sites for a while and have been looking at the different ways to set the background image to scale. I am currently using the following script to set the scaling values of the background swf to automatically adjust to the width and hieght of the browser window. However, would I would like to do is have a little more flexibility and limit how ‘distorted’ the background can become.
For a comparison…
www.hi-res.net <this site uses the code I currently have, which simply scales the background image to fit the width and height properties of the stage/browser window.
www.dfgw.co.uk/flash.html <this site shows what I would like to do. If you watch the background image it does scale, but doesn’t distort in the same fashion as Hi-Res. Instead, the code seems to adopt a ‘best fit’ approach, with some of the image moving off the stage in certain extreme width/height scenarios to stop it from distorting.
So, here’s my code (apologies it’s a bit messy). Does anyone have any suggetsions as to what the Action Script stage property for the Movieclip ‘testt’ would be to achieve something similar to DFGW??
// Assign a listener for the Stage object
Stage.addListener(stageListener);
//new stuff here
// ***Stage aligned top left
Stage.align = “TL”;
// *** Stop the stage from scaling with the browser window.
Stage.scaleMode = “noScale”;
stop ();
// initiate postitions and scaling values for objects
testt._width = Stage.width;
testt._height = Stage.height;
// end initial position setting
//create a listner that checks to see if the browser window is resized
sizeListener = new Object();
sizeListener.onResize = function() {
// change movieclip properties when the window is resized.
testt._width = (Stage.width );
testt._height = Stage.height;