PDA

View Full Version : BUG: stageWidth/Height



psykovsky
May 25th, 2007, 07:35 AM
In AS3 documentation it says:

When the value of the scaleMode property is set to StageScaleMode.NO_SCALE, the stageWidth property represents the width of Flash Player. This means that the stageWidth property varies as you resize the Flash Player window. When the value of the scaleMode property is not set to StageScaleMode.NO_SCALE, the stageWidth property represents the width of the SWF file as set during authoring in the Document Properties dialog box. This means that the value of the stageWidth property stays constant as you resize the Flash Player window. This property cannot be set.Now, in flash9 with AS3 no matter what the scaleMode is set to when I try to read stageWidth or stageHeight I allways get the size of Flash Player window instead of the SWF file dimensions (as set during authoring in the Document Properties dialog box). Does any of you have this bug? If it's not a bug, then please let me konw how to make this to work.

Regards,
Psykovsky

gvozden
May 25th, 2007, 11:13 AM
works fine for me
tested with example from Flash help

awflasher
May 25th, 2007, 11:22 AM
I don't think it is a bug :(

devonair
May 25th, 2007, 11:58 AM
Well, I'm never quick to call anything a bug, but it doesn't seem to function as documented..

I created a .swf file 800 x 600 pixels and used this quick script to test it out:
stage.scaleMode = StageScaleMode.NO_BORDER; // anything but NO_SCALE should keep constant width
stage.align = StageAlign.TOP_LEFT;

var stageText:TextField = new TextField();
stageText.autoSize = TextFieldAutoSize.LEFT;
addChild(stageText);

stage.addEventListener(Event.ENTER_FRAME, stageListener);

function stageListener(e:Event):void {
stageText.text = "stage width = " + e.target.stageWidth;
}

I published that to an html file set to 100% dimensions and opened the html file. According to the documentation, at least as I understand it, even with the flash player resized, the stageWidth property should always remain 800. It doesn't though - it resizes as the flash player resizes. Using the exact same script with the scaleMode set to NO_SCALE has the same result. Whether that's a bug, or I'm misunderstanding something, I don't know..

gvozden
May 25th, 2007, 02:09 PM
yes you're right about bug
I misunderstood question

R_G
May 26th, 2007, 09:55 AM
Yup. I'm having same bug.