Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ActionScript 3.0 Fullscreen MAJOR problem!

Status
Not open for further replies.

wavematt

Programmer
Apr 16, 2008
9
US
I have a question regarding fullscreen mode in ActionScript 3.0. I already know how to activate fullscreen mode and I've successfully used it without problems in ActionScript 2.0.

So I have an application written in AS3 with a stage size of 640x480. In this application I add a few movieclips to the stage. Once these movieclips are added to the stage, I horizontally center them by doing this...

Code:
this.x = stage.stageWidth / 2;

But this doesn't work in fullscreen mode... because my screen resolution is 1280x800 and when it switches to fullscreen mode in AS3, it actually changes the stage size. Therefore, when I center this object after its in fullscreen mode, the object actually goes too far to the right. This was not how it worked in AS2 so I'm quite confused.

I want my flash file to scale when it goes into fullscreen mode but I would like to always be able to center my objects on the screen regardless of the users screen resolution. Does anyone have any tips on how to fix this?

The only fix I've found so far is to explicity set the x and y positions of these objects. Since I know I want my stage to always be 640x480, I can explicitly set the x positions to 320 to put it in the center. But I'm not sure if this is a problem since I need this to work across any screen resolution.

One other thing to note is that I already know that using the fullScreenSourceRect property fixes my problem. BUT, it uses a bitmap scale to stretch everything, thus making everything look fuzzy and crappy which isn't acceptable.
 
Well first, my application is going to be a business training tool and users are going to be required to be in fullscreen mode to take the training. This way, their boss knows they can only focus on this training and not chatting with people while ignoring the training. So lots of things are being added and removed to the stage after the user is already in fullscreen mode.

Second, they really prefer it to stay as 640x480 so it will scale up and look nice and big on their screen as opposed to having this small content area centered in the middle of their huge 30 inch mac monitor for example.

But anyways, the solution I came up with has worked out so far. It just sucks that I had to do that and I can already see how my solution wouldn't work out in other situations that experience a similar problem. But for my application, it works out.
 
If you set Stage.scaleMode to StageScaleMode.NO_SCALE you can mathematically scale and place the objects in any way you like - although it requires a lot more code.

By the way 640x480 blown up to 2560 x 1600 (30" Apple Cinema Display) would look really bad I tell you ;)

Kenneth Kawamoto
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top