# Width and height set in HTML --where do I find them in AS3?

**URL:** https://forum.kirupa.com/t/width-and-height-set-in-html-where-do-i-find-them-in-as3/261211
**Category:** Uncategorized
**Created:** [May 24, 2008, 10:44am UTC](https://forum.kirupa.com/t/width-and-height-set-in-html-where-do-i-find-them-in-as3/261211 "2008-05-24T10:44:11Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![oli\_G1](https://avatars.discourse-cdn.com/v4/letter/o/d26b3c/32.png) [@oli\_G1](https://forum.kirupa.com/u/oli_G1)
#### Post date: [May 24, 2008, 10:44am UTC](https://forum.kirupa.com/t/width-and-height-set-in-html-where-do-i-find-them-in-as3/261211/1 "2008-05-24T10:44:11Z")

</div>

hi, this may be a lame question but… what exactly is “stage”, or “Stage” in AS2?. I mean… the stageWidth property (Width in as2) - it’s the width of my flash movie, which I set in document properties in flash, right? by default, when you create a new fla, it’s 550.

but **where do I find the width value set in the HTML file when embedding the swf**?  
[COLOR=Gray]\<embed src=“movie.swf” width=“1000” …  
[COLOR=Black]I always thought that when I set the width in HTML to 1000 and open the file in browser, then stage.stageWidth = 1000. But stageWidth remains at the value of 550, the original size set in the fla file, no matter what width I set in HTML.

I need this because all of the objects in my movie are positioned and resized at runtime. I need a movieclip to be x=0,y=0 and to have the width value set to the value defined in HTML, in this case 1000. but when I use myMovieClip.width=stage.stageWidth, it’s only 550 px wide.  
[/COLOR][/COLOR][COLOR=Gray]  
[COLOR=Black]Pls help![/COLOR]  
[/COLOR]

---

<div class="post-metadata">

### Author: ![tpspoons](https://avatars.discourse-cdn.com/v4/letter/t/b4bc9f/32.png) [@tpspoons](https://forum.kirupa.com/u/tpspoons)
#### Post date: [May 24, 2008, 11:04am UTC](https://forum.kirupa.com/t/width-and-height-set-in-html-where-do-i-find-them-in-as3/261211/2 "2008-05-24T11:04:35Z")

</div>

Have a look at [this](http://www.kirupa.com/developer/mx2004/fullscreen.htm) tutorial on kirupa, it should provide some answers.

---

<div class="post-metadata">

### Author: ![oli\_G1](https://avatars.discourse-cdn.com/v4/letter/o/d26b3c/32.png) [@oli\_G1](https://forum.kirupa.com/u/oli_G1)
#### Post date: [May 24, 2008, 5:41pm UTC](https://forum.kirupa.com/t/width-and-height-set-in-html-where-do-i-find-them-in-as3/261211/3 "2008-05-24T17:41:12Z")

</div>

> [@tpspoons;2330513](#):
>
> Have a look at [this](http://www.kirupa.com/developer/mx2004/fullscreen.htm) tutorial on kirupa, it should provide some answers.

Thanks for the link, it helped a bit, but…  
It still doesn’t fully work. I managed to stretch the controls (it’s a video player) to the width and height set in HTML, but I need to scroll to find them.  
Check it out here: [http://oliver.bratritriku.cz/CSFD/flvplayer/player.html](http://oliver.bratritriku.cz/CSFD/flvplayer/player.html)

All objects have the correct size and placement, but the dimensions set in fla are bigger than those in HTML, so you need to zoom in, zoom out (to enable the scrolling cursor) and move the whole movie to see them.

If anyone knows how to fix this, please help!

---

<div class="post-metadata">

### Author: ![McGuffin](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/mcguffin/32/408_2.png) [@McGuffin](https://forum.kirupa.com/u/McGuffin)
#### Post date: [May 24, 2008, 5:47pm UTC](https://forum.kirupa.com/t/width-and-height-set-in-html-where-do-i-find-them-in-as3/261211/4 "2008-05-24T17:47:30Z")

</div>

From the AS3 docs on the flash.display.Stage.stageWidth property:

> 

When the value of the scaleMode property is set to StageScaleMode.NO\_SCALE, the stageWidth property represents the width of Flash Player. This means that the stageWidth property varies as you resize the Flash Player window. When the value of the scaleMode property is not set to StageScaleMode.NO\_SCALE, the stageWidth property represents the width of the SWF file as set during authoring in the Document Properties dialog box. This means that the value of the stageWidth property stays constant as you resize the Flash Player window. This property cannot be set.

ie. this number will not change if scaleMode is set to NO\_SCALE.

Stage.width should change along with your movie.
