# Swf resizing problem

**URL:** <https://forum.kirupa.com/t/swf-resizing-problem/178034>\
**Category:** flash\
**Created:** [February 7, 2006, 7:58am UTC](https://forum.kirupa.com/t/swf-resizing-problem/178034 "2006-02-07T07:58:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pixi](https://avatars.discourse-cdn.com/v4/letter/p/5fc32e/32.png) [@pixi](https://forum.kirupa.com/u/pixi)\
**Post date:** [February 7, 2006, 7:58am UTC](https://forum.kirupa.com/t/swf-resizing-problem/178034/1 "2006-02-07T07:58:33Z")

</div>

Hi, i have a confusiing problem, i am loading in a background swf into a movie that has no scaling allowed but resizes certain elements leaving others at the original size. The problem i have is that my background swf is invisible until i resize the window. Everything is working great except when the movie is started. Here is a snippet of the code in which bgswf is the problem:

Stage.align = “TL”;  
// \*\*\* Stop the stage from scaling with the browser window.  
Stage.scaleMode = “noScale”;

// initiate postitions and scaling values for objects  
bgswf.\_height = Stage.height;  
bgswf.\_width = Stage.width;  
dimmer.\_height = Stage.height;  
dimmer.\_width = Stage.width;  
originalWidth = bgswf.\_width;  
gallery.\_x = 0;  
gallery.\_y = 0;  
//create a listner that checks to see if the browser window is resized  
sizeListener = new Object();  
sizeListener.onResize = function() {  
// change movieclip properties when the window is resized.  
if (Stage.width\>1010) {  
gallery.\_x = (Stage.width-1010)/2.5;  
news.\_x = ((Stage.width-1010)/2.5)+45;  
menuHolder.\_x = ((Stage.width-1010)/2.5)+45;  
inspire.\_x = ((Stage.width-1010)/2.5)+45;  
\_root.textX = ((Stage.width-1010)/2.5)+45;  
textHolder.\_x = \_root.textX;  
musicIndicator.\_x = Stage.width-20;  
}  
if (Stage.height\>654) {  
gallery.\_y = (Stage.height-654)/2.5;  
news.\_y = ((Stage.height-654)/2.5)+250;  
menuHolder.\_y = ((Stage.height-654))/2.5+500;  
inspire.\_y = ((Stage.height-654)/2.5)+450;  
//musicIndicator.\_y = 5-Stage.height;  
if (galleryOpen == true) {  
\_root.textY = ((Stage.height-654)/2.5+125);  
textHolder.\_y = \_root.textY;  
} else {  
\_root.textY = ((Stage.height-654)/2.5+250);  
textHolder.\_y = \_root.textY;  
}  
}  
bgswf.\_width = Stage.width;  
dimmer.\_height = Stage.height;  
dimmer.\_width = Stage.width;  
dimmer.\_x=0;  
if (originalWidth\<\>bgswf.\_width) {  
bgswf.\_height = (bgswf.\_width/5)\*4;  
originalWidth = bgswf.\_width;  
}  
};  
Stage.addListener(sizeListener);

stop();
