Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0

Reply
 
Thread Tools Rate Thread Display Modes
Old 03-07-2007, 08:06 PM   #1
Mandy
Registered User
 
Join Date: Jun 2005
Posts: 9
Question help with screen resolution detection and SWF resizing.

I have spent the last eight hours trying to script this out myself but I haven't had any luck. So I thought I would come here as you all have always been so helpful.


I'm trying to script something (possibly using capabilities.screenResolutionX) that will detect the user's screen resolution and resize my SWF to a certain size.

I am trying to use capabilities.screenResolution but I haven't gotten it to work for me. I'm willing to try anything though I just want something that works. It doesn't have to be what I have already tried.

What I am doing....
I love how my SWF looks in 800x600 but when you get higher up in resolutions my SWF gets smaller which I don't like. So I want to be able to size my SWF depending on the user's resolution.

Thanks for any help you can give me.
Mandy is offline   Reply With Quote
Old 03-07-2007, 08:29 PM   #2
Noct
Toys in the Attic...
 
Noct's Avatar
 
Join Date: Oct 2006
Location: Albany, NY
Posts: 2,617
Default

Well, you just need a series of ifs (or a switch), to change your file when it opens dependant on the value of the resolution.

On the first frame of your file:

ActionScript Code:
if(System.capabilities.screenResolutionX==1024){ //Place your actions for 1024 resolution here } else if(System.capabilities.screenResolutionX==800){ //Place your actions for 800 resolution here }

If you want more flexibility to the values, use a range. That way if someone has a custom resolution, that is dealt with too.

ActionScript Code:
if((System.capabilities.screenResolutionX>1024)&& (System.capabilities.screenResolutionX<1280)){ //Place your actions here }

But, with that said...
It is usually better to evaluate the stageSize then the resolution, as that can change based on the browser window. (If someone doesn't have thier browser full screen, but is running @1024, it would still mess up your file.)
To deal with that you would also have to set your Stage scale to false.
__________________
http://withersmultimedia.com

Last edited by Noct; 03-07-2007 at 08:33 PM.
Noct is offline   Reply With Quote
Old 03-21-2007, 09:53 PM   #3
Mandy
Registered User
 
Join Date: Jun 2005
Posts: 9
Default

I was ill and offline after posting this question so my apologies for not thanking you for the reply sooner.

I will try all of your suggestions and let you know how it turns out. Thanks for the help!
Mandy is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:06 AM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2010 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.