Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between stage.width and stage.stageWidth

In actionscript 3 (as3) What is the difference between calling stage.width and stage.stageWidth

This was something I remember I got confused about in the past (Adobe's api docs are an artform in obfuscation :) ). Thought I should post it on stackoverflow.

like image 524
eLouai Avatar asked Sep 14 '11 19:09

eLouai


1 Answers

stageWidth is basically width of the player window. You probably need this number if you want to know size of your scene. stage.width is calculated as any other width in actionscript. This means, it is width of bounding box around child objects of the stage. For example stage.width of empty.stage is 0. Or if you have only one small square 10 px wide on scene lets say 200px wide, stageWidth is 200, but stage.width is 10

.stageWidth VS .width, visually

like image 152
Kejml Avatar answered Oct 24 '22 08:10

Kejml