PDA

View Full Version : Stage.width & Stage.height


CyanBlue
03-31-2003, 09:40 PM
When I type this script in the new Flash movie of 550 x 400, I get to see the wrong information...trace("Stage.width = " + Stage.width);
trace("Stage.height = " + Stage.height);Stage.width = 546
Stage.height = 396What's up with this???

pixelwit
03-31-2003, 10:54 PM
Try this:onMouseDown = function(){
trace("Stage.width = " + Stage.width);
trace("Stage.height = " + Stage.height);
}Not real sure why but it seems you have to click the stage once to force the correct values.

Try placing your code on frame 50 or something then test the movie without clicking the stage. Then restart the movie and click the stage before you hit frame 50.

The first way shouldn't work but the second way should.

-PiXELWiT
http://www.pixelwit.com

CyanBlue
03-31-2003, 11:06 PM
Thank you for the reply, pixelwit... ;)

Haha... This isn't funny...

I see this on both examples...Stage.width = 1276
Stage.height = 913Where does Flash get these numbers???

Oh... I get these numbers just to compare...System.capabilities.screenResolutionX = 1280
System.capabilities.screenResolutionY = 1024Stage.width and Stage.height are supposed to return the Flash stage properties, right??? Why 1276 x 913 from 550 x 400 movie??? Hm...

pixelwit
03-31-2003, 11:15 PM
When you test your movie isn't the viewable area larger than 500x400?

Try resizing the stage (drag the horizontal bar at the top of the stage or resize the whole Flash app) then being sure you're using the onMouseDown function I defined earlier click the stage and see if you get a new value.

The viewable area is the stage size.

-PiXELWiT
http://www.pixelwit.com

P.S. I want your monitor. :)

CyanBlue
04-01-2003, 04:36 AM
The viewable area is the stage size.Ah... Now I get it... Thanks a lot... ;)

Yup... I minimized the Flash itself to the minimum and I didn't find a place to click... Dumb I am, eh??? ;)

Yup... The size changes everytime I resize the Flash itself... I thought that it'll return the fixed size, but it's not... I don't know how useful it can be though...

It's abit funny that MM provides a way to check how big the current viewable screen is, yet does not provide anything about the size of the actual stage... Hm... Why??? :(

PS>> What are you going to do with this 7 year old monitor??? :D

pixelwit
04-01-2003, 09:50 AM
Originally posted by CyanBlue
Yup... The size changes everytime I resize the Flash itself... I thought that it'll return the fixed size, but it's not... I don't know how useful it can be though...

PS>> What are you going to do with this 7 year old monitor??? :D Flash's reporting of the stage's current viewable area can be quite useful for making sites/apps that change their appearance/layout when the browser window is resized.

I'll use your fresh 7 year "young" monitor to replace my old blurry overly bright fading fast little monitor.

And if you want a simple solution, you could always store a few variables such as stageWi=550 and stageHi=400. But you knew that right?

-PiXELWiT
http://www.pixelwit.com

CyanBlue
04-01-2003, 09:58 AM
replace my old blurry overly bright fading fast little monitor.This sounds darn familiar... Do you have that 13" green crt monitor too??? I do have one somewhere in one of those boxes... :D

Yup... Resizable movie... That's the only thing I could think of, but then I don't think I will go near that... Hum... Come to think of it, I never though of learning the program called Flash... I said what the !@#$ is that one good for when I first saw FutureSplash... :D

I use that method, but I still think MM is stupid not to provide the way to access that kind of information... :p