Mark P.
Mark P.

Reputation: 282

Flash fullscreen with dual monitors

How do I get the dimensions of the monitor the user is watching the video with if they have dual monitors? If I use this --

mc_videoDisplay.height = (Capabilities.screenResolutionY - 26);
mc_videoDisplay.width = Math.floor(mc_videoDisplay.height * 16 / 9);

it's only using the primary monitor so it's all out of whack if they're watching on the extended monitor.

Thanks

Upvotes: 0

Views: 1764

Answers (2)

Jorjon
Jorjon

Reputation: 5434

Make sure you are targeting FP10.2:

Support for full screen mode with multiple monitors

Full screen content will remain in full-screen on secondary monitors, allowing users to watch full-screen content while working on another display.

Then, stageWidth and stageHeight would work.

Upvotes: 2

DoomGoober
DoomGoober

Reputation: 1703

Rather than getting the screen resolution from Capabilities, could you just use the stage width and height?

this.stage.stageWidth
this.stage.stageHeight

If you're going to do this, make sure to set the scaleMode to StageScaleMode.NO_SCALE or else the stageWidth and stageHeight will remain constant (and only the scale will change.)

From: http://livedocs.adobe.com/flex/3/html/help.html?content=05_Display_Programming_10.html :

If the scaleMode property is set to StageScaleMode.NO_SCALE, the Stage's stageWidth and stageHeight properties change to reflect the size of the screen area occupied by the SWF (the entire screen, in this case);

Upvotes: 3

Related Questions