Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

how to know size of window

Explorer ,
Feb 21, 2014 Feb 21, 2014

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)

TOPICS
ActionScript
618
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Feb 21, 2014 Feb 21, 2014

The Stage class has stageWidth and stageHeight properties

Translate
LEGEND ,
Feb 21, 2014 Feb 21, 2014

The Stage class has stageWidth and stageHeight properties

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 21, 2014 Feb 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 22, 2014 Feb 22, 2014
LATEST

tnx, but the last part was related to current size, rather than height and width. i checked the docs and found that it is related with current size according to scale method, and that there is an event in the case of size change. as the thing i have in mind is related with cell phones and those may have different screen sizes, i choose to scale according to the size of the screen (i used that in actionscript 1, but i did not remember any of that)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines