• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to overcome this problem when using auto resizing?

New Here ,
May 02, 2012 May 02, 2012

Copy link to clipboard

Copied

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 STAGE area. Say, I have an aeroplane_mc which starts animating from x:-200 to x: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:

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;

TitlePage.width=swfWidth;
TitlePage.height=swfHeight;

 
}

addEventListener(Event.ENTER_FRAME,initialDisplay);

Thanks in advance for any help.

TOPICS
ActionScript

Views

522

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
May 02, 2012 May 02, 2012

Copy link to clipboard

Copied

this is probably due to

myStage.scaleMode=StageScaleMode.NO_SCALE;

do you need to use NO_SCALE try SHOW_ALL instead

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 02, 2012 May 02, 2012

Copy link to clipboard

Copied

LATEST

Thanks for the reply. I will check as you advised the following code:

var myStage:Stage=this.stage;
myStage.scaleMode=StageScaleMode.SHOW_ALL;
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;

TitlePage.width=swfWidth;
TitlePage.height=swfHeight;

 
}

addEventListener(Event.ENTER_FRAME,initialDisplay);

Note: I tried it, but still the same problem. The SWF shrinks.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines