# Weird stage width bug

**URL:** https://forum.kirupa.com/t/weird-stage-width-bug/271798
**Category:** flash
**Created:** [September 28, 2008, 8:38pm UTC](https://forum.kirupa.com/t/weird-stage-width-bug/271798 "2008-09-28T20:38:28Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![webmaster4u](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/webmaster4u/32/3478_2.png) [@webmaster4u](https://forum.kirupa.com/u/webmaster4u)
#### Post date: [September 28, 2008, 8:38pm UTC](https://forum.kirupa.com/t/weird-stage-width-bug/271798/1 "2008-09-28T20:38:28Z")

</div>

I have a flash app I’m building that needs to know the stage width.

In firefox I ahve no problems, but in IE6 and 7 if the cache in not cleared the stage width turns to 0.

Here’s my action script code:

```auto

		private var swfStage:Object;
		
		private var stageWidth:Number;
		private var stageHeight:Number;
		public function Personalize() {
                        swfStage = stage;
			swfStage.scaleMode = StageScaleMode.NO_SCALE;
			swfStage.align = StageAlign.TOP_LEFT;
			stageWidth = swfStage.stageWidth;
			stageHeight = swfStage.stageHeight;
                        debugTxt.text = swfWidth;
                 }

```

I’m embedding my swf with swfobject, been doing so for a while and never ran into this problem!!! It’s the weirdest thing. It just started to happen out of the blue as well.

In Firefox I can reload etc and everything is fine.

In Itnernet Explorer however, it breaks after loading it once. The first time the stage width is properly read, but if I browse to a different page (with the swf on that page as well) the stage width becomes 0.

Any help would be greatly appreciated.
