# How to overcome this problem when resizing the SWF file according to browser size?

**URL:** <https://forum.kirupa.com/t/how-to-overcome-this-problem-when-resizing-the-swf-file-according-to-browser-size/328272>\
**Category:** flash\
**Created:** [May 2, 2012, 8:14pm UTC](https://forum.kirupa.com/t/how-to-overcome-this-problem-when-resizing-the-swf-file-according-to-browser-size/328272 "2012-05-02T20:14:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![learner\_7n](https://avatars.discourse-cdn.com/v4/letter/l/b2d939/32.png) [@learner\_7n](https://forum.kirupa.com/u/learner_7n)\
**Post date:** [May 2, 2012, 8:14pm UTC](https://forum.kirupa.com/t/how-to-overcome-this-problem-when-resizing-the-swf-file-according-to-browser-size/328272/1 "2012-05-02T20:14:23Z")

</div>

Hi,

I am resizing the flash (.swf) file accroding to the browser window to fit on any screen resolution. But the problem I am facing now is related to animations which cross the [COLOR=#0000ff]\*\*STAGE \*\*[/COLOR]area. Say, I have an \*\*aeroplane\_mc \*\*which starts animating from [COLOR=#0000ff]x[/COLOR]:-200 to [COLOR=#0000ff]x[COLOR=#000000]:[/COLOR][/COLOR]1200 (my stage **width=1000 & height=600** ), the my flash (swf) file gets shrink.

Because of this problem I cannot make any animation which moves out of stage. Please help me in resolving this problem.

The code to resize the window is as below:

```auto
var myStage:Stage=this.stage;
myStage.scaleMode=StageScaleMode.NO_SCALE;
myStage.align=StageAlign.TOP_LEFT;

function initialDisplay(event:Event):void{
var swfWidth:int=myStage.stageWidth;
var swfHeight:int=myStage.stageHeight;

Background.width=swfWidth;
Background.height=swfHeight;
 
}

addEventListener(Event.ENTER_FRAME,initialDisplay);

```

Thanks in advance for any help.
