# Scaling flash and browser resizing

**URL:** https://forum.kirupa.com/t/scaling-flash-and-browser-resizing/237852
**Category:** flash
**Created:** [September 4, 2007, 5:43pm UTC](https://forum.kirupa.com/t/scaling-flash-and-browser-resizing/237852 "2007-09-04T17:43:45Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![pr3fect](https://avatars.discourse-cdn.com/v4/letter/p/ce73a5/32.png) [@pr3fect](https://forum.kirupa.com/u/pr3fect)
#### Post date: [September 4, 2007, 5:43pm UTC](https://forum.kirupa.com/t/scaling-flash-and-browser-resizing/237852/1 "2007-09-04T17:43:45Z")

</div>

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/](http://www.focusdesignonline.com/newsite/)

The CSS holder:

```auto

#rightholder {
    height: 100px;
    width: 100%;    
}

```

The actionscript:

```auto

// 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 !
