# AS3 - Setting the stageWidth and stageHeight

**URL:** <https://forum.kirupa.com/t/as3-setting-the-stagewidth-and-stageheight/223811>\
**Category:** flash\
**Created:** [April 25, 2007, 11:24pm UTC](https://forum.kirupa.com/t/as3-setting-the-stagewidth-and-stageheight/223811 "2007-04-25T23:24:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajax](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@ajax](https://forum.kirupa.com/u/ajax)\
**Post date:** [April 25, 2007, 11:24pm UTC](https://forum.kirupa.com/t/as3-setting-the-stagewidth-and-stageheight/223811/1 "2007-04-25T23:24:04Z")

</div>

Hi,

I wish to set the height and width of the stage to 1,000 pixels by 1,000 pixels but my current code is not changing these properties of the stage.

note: I am compiling this AS3 with the Flex 2.0.1 SDK mxmlc.exe AS3 compiler.

My current code is:

[COLOR=Red]_package {  
 [/COLOR][INDENT][COLOR=Red] import flash.display._;\*

[/COLOR] [COLOR=Red]\* public class ExampleApp extends MovieClip\*  
[/COLOR] [COLOR=Red]_{_[/COLOR][INDENT][COLOR=Red]_// constructor_  
[/COLOR] [COLOR=Red]_public function ExampleApp() \*  
[/COLOR] [COLOR=Red]_ {_[/COLOR][INDENT][COLOR=Red]_ // change stage parameters\*  
[/COLOR] [COLOR=Red]\* stage.stageHeight = 1000;\*  
[/COLOR] [COLOR=Red]\* stage.stageWidth = 1000;\*  
[/COLOR] [COLOR=Red]\* stage.showDefaultContextMenu = false;\*

[/COLOR] [COLOR=Red]\* // add a sample red square to the display list\*  
[/COLOR] [COLOR=Red]\* var \_shpSquare:Shape = new Shape();\*  
[/COLOR] [COLOR=Red]\* \_shpSquare.graphics.beginFill( 0xFF0000 );\*  
[/COLOR] [COLOR=Red]\* \_shpSquare.graphics.drawRect( 0, 0, 100, 100 );\*  
[/COLOR] [COLOR=Red]\* \_shpSquare.graphics.endFill();\*

[/COLOR] [COLOR=Red]\* addChild( \_shpSquare );\*  
[/COLOR] [/INDENT][/INDENT][INDENT][COLOR=Red]\* }\*  
[/COLOR] [/INDENT][COLOR=Red]\* }\*  
[/COLOR] [/INDENT][COLOR=Red]\* }\*[/COLOR]

Any ideas ?

(note that the line of code to turn the default context menu is working ok)

I only want to set the height and width of the stage once in my application.

Cheers,
