Ah! Well how about that. Brilliant, thanks! --- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote: > > stageWidth/Height starts out at the cmpiled size, but by the time you see your app, it is the actual size. > > -----Original Message----- > From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of David Barrett > Sent: Friday, March 07, 2008 1:17 AM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] How to find out stage width? > > How do I determine the size, in pixels, of the total flash player? I > understand there's a confusing relationship between width and stage > width, as explained in [1]. In other words: > > (stageWidth,stageHeight) == Whatever -default-size you compiled with > > But how do I determine the *actual* width/height of the player? Does > that question make sense? I have the feeling it's such an obvious > question that you'll think I'm trying to ask something hard, when it's > probably really, really easy. > > -david > > [1] > http://bottomupflash.wordpress.com/2007/08/27/why-isnt-stagewidth-stagewidth/ > > > So you might be embedding you SWF into an HTML page and then you > > discover that stageWidth/stageHeight are almost but not entirely > > unrelated to the actual dimensions of the embedded component. Or, > > rather, it's more complex than that: they equate exactly to the > > dimensions you provide, but drawing a box from > > (0,0)->(stageWidth,stageHeight) doesn't actually bound the embedded > > component as you'd expect. For example, assume you embed a simple > > 800×200 component into a page that tries to simply outline itself in > > red. You'll get something crazy like: > > > > Crazy Green/red boxes > > > > Basically, the red box you draw outlining the stage seems almost > > entirely unlike the component outline. However, there's this other > > box that does look suspicious: if you draw a green box from > > (0,0)->(500,350) it'll mysteriously be centered and scaled perfectly. > > The reason? mxmlc.exe has a "-default-size" parameter that - when not > > set - is apparently set to 500×350. Intead, add -default-size 800 200 > > (or whatever dimensions you want), and it'll come out right: > > > > > -- > Flexcoders Mailing List > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com > Yahoo! Groups Links >