Weird stage width bug

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:


		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.