# Works in Flash, not in Browser?!?!?

**URL:** <https://forum.kirupa.com/t/works-in-flash-not-in-browser/201470>\
**Category:** flash\
**Created:** [September 21, 2006, 4:07pm UTC](https://forum.kirupa.com/t/works-in-flash-not-in-browser/201470 "2006-09-21T16:07:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![newbie\_geek](https://avatars.discourse-cdn.com/v4/letter/n/d9b06d/32.png) [@newbie\_geek](https://forum.kirupa.com/u/newbie_geek)\
**Post date:** [September 21, 2006, 4:07pm UTC](https://forum.kirupa.com/t/works-in-flash-not-in-browser/201470/1 "2006-09-21T16:07:08Z")

</div>

So this is a new one to me. I have developed this code:

[AS]var myListener:Object = new Object();  
myListener.onResize = function() {  
//  
var NewH:Number;  
var NewW:Number;  
NewH = Stage.height;  
NewW = Stage.width;  
//  
trace("W = "+NewW);  
trace("H = "+NewH);

```
if (Stage.width/800&gt;Stage.height/600) {
ground._width = NewW;
ground._height = ground._width*0.75;
}

if (Stage.width/800&lt;Stage.height/600) {
ground._height = NewH;
ground._width = ground._height*1.333;
}

```

};  
Stage.addListener(myListener);

myListener.onResize();[/AS]

And it works GREAT to resize my backround image to fill the movie as it gets resized, that is until i export it and try to view it online (or preview it in dreamweaver before uploading). The culprit appears to be the resizing section of code:

```auto
if (Stage.width/800>Stage.height/600) {
	ground._width = NewW;
	ground._height = ground._width*0.75;
	}
	
	if (Stage.width/800<Stage.height/600) {
	ground._height = NewH;
	ground._width = ground._height*1.333;
	}

```

Any insight would be greatly appreciated!
