Dec 06

I am working on an ActionScript 3.0 module in my day job, and although I am new to ActionScript, I rarely touch the documentation (yeah yeah, I know I should do it more often =) ), most of the time it works, may be because I was on Java before.

Last day, I needed to find out the stage’s height somewhere, so I just typed

stage.h

and thanks to intelli-sense, it quickly told me that it was

stage.height

i was looking for. But something strange happened and i was not getting the value i expected. After a couple of hours of hair pulling, it dawned on me that I should be using

stage.stageHeight

instead of

stage.height

to get stage’s height.

I can’t say whether Adobe/Macromedia’s decision to use

stage.stageHeight

and

stage.stageWidth

instead of

stage.height

and

stage.width

was right, but the property name is not abundantly clear in what it is going to return.

Technorati Tags: , ,

written by ishaq