Skip to main content
Known Participant
February 21, 2014
Answered

how to know size of window

  • February 21, 2014
  • 1 reply
  • 678 views

hi, i want to know the size of the window where the flash presentation is running (intended for use in air app).

i tried this:

trace(this.width);

trace(stage.width);

both print 0 as output

tnx

__edit__

i just tried:

trace(stage.fullScreenWidth);  also outputs 0 (first i tried Stage instead of stage and it output an error)

This topic has been closed for replies.
Correct answer Ned Murphy

The Stage class has stageWidth and stageHeight properties

1 reply

Ned Murphy
Ned MurphyCorrect answer
Legend
February 21, 2014

The Stage class has stageWidth and stageHeight properties

Known Participant
February 21, 2014

yup, this time it came something different than 0. quick question, if i make my movie say 640*480, tell it to stretch, and run it in a screen of 800*600 what would come as output, 640 or 800?

--edit--

i just tried this: made two frames, in the first one i told it to stop. then while it was on stop i changed window size and in the next frame i told it to trace width. it traced new size