In my Flash Application (AS3), I want to get the stage size and use that so my objects (which the user controls) can't go outside of the screen. However, when I use:
stage.stageWidth;
stage.stageHeight;
The values I get aren't actually what I want. They give me the stage size, but if I resize the window, the numbers change as well. Now, in a html page, I don't think that will matter, because the user can't resize it... however, I'd like for it to be more solid than relying on the window size. I also tried to use:
stage.width;
stage.height;
However, those gave me "801" and "601", one greater than my actual stage size. Those values did not change when I resized the window, but they were one greater.
So my question is, how can I get the stage size, regardless of resizing the window to always be 800 by 600? (And perhaps hidden in that question is, "Why do I get 801 and 601?" and "Can I stop people from resizing the window?") Phew! Thank you!
<object width="320" height="240"
>) and indeed in my browser the Flash object is displayed in a box that size. However, when I inspectstage.stageWidth
andstage.stageHeight
I get 800x600. What is going on? – Murmuration