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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detect screen resolution and scale movie accordingly.. 1

Status
Not open for further replies.

basepointdesignz

Programmer
Jul 23, 2002
566
GB
Hi,

Is there a way for a movie to detect the user's screen resolution and if it's 800x600 or below, the movie is scaled to 75% and anything above to keep it to 100%?

I'm developing my company CD-ROM (.exe) and I've tailored it to fit an 800x600 screen but the text and some of the graphics look a bit fuzzy. i know that this may be my monitor but I don't want the user to see it in this poor quality state, especially as I'm trying to promote a design business (doesn't look very good if my stuff is lame).
I want to keep a small border around the movie as I think it looks better that way, but that's just me I guess!

I've tried it on all other resolutions and it looks great.

I don't want to go down the 'resize everyting in the movie' road, so is there a way to do what I want?

Any ideas?

Cheers,

Paul @ basepoint designz..


basepoint designz
renegade@tiscali.co.uk
 
trace(System.capabilities.screenResolutionY)
trace(System.capabilities.screenResolutionX)

will give you the values and you can then scale or not scale
 
Hi,

That's brilliant. Then I suppose you put it all in in an IF statement?

I'm just starting with ACTION SCRIPT and I'm not sure how to format it. Could I be really cheeky and ask you to give me a sample of the code I'll need. Sorry to ask!



Cheers,

Paul @ basepoint designz..


basepoint designz
renegade@tiscali.co.uk
 
quick example......you only have to check for one value

if(System.capabilities.screenResolutionX<=800){
myclip._xscale = 75;
myclip._yscale = 75;
}
 
Hi,

Thanks Bill. Just another couple of quick question..

<< Does the myclip variable refer to the whole movie, including all the scenes or just the first scene?

<< I presume I put this script in the first frame of the first scene. Is this correct?

Thanks again..


Cheers,

Paul @ basepoint designz..


basepoint designz
renegade@tiscali.co.uk
 
if you have scenes


in that case you might be better having 2 versions of the file..one for 800x600 and another for larger monitors

to do that make a new file with only one frame and an empty clip on stage

add this to frame actions

this.onEnterFrame = function(){
if(System.capabilities.screenResolutionX!==undefined){
if(System.capabilities.screenResolutionX<=800){
loadMovie(&quot;800.swf&quot;,emptyClip);
}else{
loadMovie(&quot;other.swf&quot;,emptyClip)
}
delete this.onEnterFrame
}
}

 
... Is there a way for a movie to detect the user's screen resolution
and if it's 800x600 or below, the movie is scaled to 75% and anything above to keep it to 100%?...

Regards,

cubalibre2.gif
 
if there are piles of clips and images and buttons and text boxes on different scenes then getting them all and scaling them may be a nightmare

depends how the movie is structured something like this might do (big might)
Code:
var i = 0;
for(i in _root){
if(typeof(_root[i])==&quot;movieclip&quot;)
trace(i)
}
 
IMHO...

A javascript resolution sniffer with a re-direct to 2 different pages, with a simple copy of the same .swf but scaled down within on one of the pages, might be easier to set up in your case...

Regards,

cubalibre2.gif
 
Im not so sure if anybody is still using below 800x600 resolution. If your design is 800x600, then I think its ok. Any ways, if you really need to consider below 800x600 then why not use:

Code:
if(System.capabilities.screenResolutionX<800){
_root._yscale = 75;
_root._xscale = 75;
}
[code]

I think this could affect the other scenes as well.

This would have been a lot easier if on a web page coz you can manipulate using javascript also

biggie




The Man of Tomorrow is forged by his battles today.
 
Hi,

Thanks all. I'll test out some of your suggestions. It's not a problem if it doesn't work but I'd like it to be a bit better looking at the low res..

What I could do is put a note on the CD label about being best viewed at 1024x768 or above..

Cheers,

Paul @ basepoint designz..


basepoint designz
renegade@tiscali.co.uk
 
according to the counter for month of May based on 38113581 visitors:

800x600 14702904 (44%)
1024x768 13992243 (42%)
1280x1024 1636875 (4%)
1152x864 1027458 (3%)
640x480 764664 (2%)
Unknown 463074 (1%)
1600x1200 228132 (0%)
 
2cxc,

where do you get stats like that? It's a good arguement basis with my boss. he has this notion that since he is using 1024x768 resolution, everybody else is also using the same resolution.

biggie

The Man of Tomorrow is forged by his battles today.
 
Hi,

Thanks for those stats 2cxc. I didn't realised that the users using 1024x768 was as high as that (nearly the same as for 800x600). I think it must be to do with the influx of newer better monitors and the fact that a lot more users are better aquainted with the desktop settings these days..

Once again, thanks to everyone..

Cheers,

Paul @ basepoint designz..


basepoint designz
renegade@tiscali.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top