Edit: appears to be a Firefox-only bug (gasp)
So I’ve hacked together a scaling flash component for a flexwidth site. Trouble is, it only scales and pops to the appropriate width once the user resizes their browser window. Ideally the flash component would do this on load.
Here’s a link to view it in situ:
http://www.focusdesignonline.com/newsite/
The CSS holder:
#rightholder {
height: 100px;
width: 100%;
}
The actionscript:
// stage aligned top left
Stage.align = "TL";
// stop the stage from scaling with the browser window.
Stage.scaleMode = "noScale";
stop ();
// initial postitions and scaling values for squares
squareOne._x = 0
squareOne._y = 100
squareOne._height = (100)
squareOne._width = (Stage.height)
squareTwo._x = quarterPercent * 2
squareTwo._y = 100
squareTwo._height = (100)
squareTwo._width = (Stage.height)
squareThree._x = quarterPercent * 3
squareThree._y = 100
squareThree._height = (100)
squareThree._width = (Stage.height)
squareFour._x = quarterPercent * 4
squareFour._y = 100
squareFour._height = (100)
squareFour._width = (Stage.height)
// initial postitioning for thumbs
portOne._x = 0
portOne._y = 100
portTwo._x = quarterPercent * 2
portTwo._y = 100
portThree._x = quarterPercent * 3
portThree._y = 100
portFour._x = quarterPercent * 4
portFour._y = 100
// end initial position setting
//create a listener that checks to see if the browser window is resized
sizeListener = new Object();
sizeListener.onResize = function() {
//variable to determine quarter percentage of stage
var quarterPercent = Stage.width * .25;
//first square stage stretch behaviour
squareOne._x = 0
squareOne._y = 100
squareOne._height = (100)
squareOne._width = quarterPercent
//second square stage stretch behaviour
squareTwo._x = quarterPercent
squareTwo._y = 100
squareTwo._height = (100)
squareTwo._width = quarterPercent
//third square stage stretch behaviour
squareThree._x = quarterPercent * 2
squareThree._y = 100
squareThree._height = (100)
squareThree._width = quarterPercent
//fourth square stage stretch behaviour
squareFour._x = quarterPercent * 3
squareFour._y = 100
squareFour._height = (100)
squareFour._width = quarterPercent
//first thumb stage stretch behaviour
portOne._x = 0
portOne._y = 100
//second thumb stage stretch behaviour
portTwo._x = quarterPercent
portTwo._y = 100
//third thumb stage stretch behaviour
portThree._x = quarterPercent * 2
portThree._y = 100
//fourth thumb stage stretch behaviour
portFour._x = quarterPercent * 3
portFour._y = 100
};
Stage.addListener(sizeListener);
All help and input very much appreciated !