PDA

View Full Version : detect resolution


jeppo78
03-27-2003, 10:11 AM
i want make a script that detect screen resolution and open a page after the results

i read that this
myVariable = System.capabilities.screenResolutionx

take me the resolution in the variable but the results is a number or.... anything thank you is much important

Pal3rm02k
03-27-2003, 10:19 AM
I don't know the answer to your problem but i know a site with resolution detection!!

mjau-mjau (http://www.mjau-mjau.com)

here it checks for 1024x768 resolution.

jeppo78
03-27-2003, 10:32 AM
sorry for my english
i want know what kind of results take me this code because i want verify the screen resolution before that open the site so i may open the site in any resolution

my variable what kind of value take in result thank you

jeppo78
03-27-2003, 10:34 AM
res = System.capabilities.screenResolutionx
if res = 1024*768
go to 1.htm
else go to 800*600
in code but this is my problem
thank you

farafiro
03-27-2003, 10:52 AM
I've seen this piece in moock's web site//make a dynamic text field with multilines
for (a in System.capabilities) {
myTextField.text += a+": "+System.capabilities[a]+" \n";
}

catbert303
03-27-2003, 02:35 PM
if you want to find out the resolution before you open the site you could use some javascript on a splash page,

<script type="text/javascript">
var width = screen.width;
var height = screen.height; // optional
if (width <= 800) {
document.location = 'small.html';
} else if (width <= 1024) {
document.location = 'medium.html';
} else {
document.location = 'big.html';
}
</script>

farafiro
03-30-2003, 05:30 AM
catbert303
why using JS while u can do all from Flash??

catbert303
03-30-2003, 03:01 PM
If you have different flash moves/pages dependent on the resolution why would you want to have another flash movie just to check the screen resolution?

also if the rest of your movie only requires flash 5 or earlier it seems a little over the top to use actionscript that requires flash player 6 just to detect the resolution.

on the other hand if you'll be resizing your movie internally on the basis of the resolution then using flash to detct it would be a better way to do :)

farafiro
03-31-2003, 05:26 AM
i'd agrre only if u said it's for version 5
but for all the other u said, First: what would make you think it'd be done with another movie??
also, if it's to resize the movie only, u don't need to know the resolution, a lotta ways to do that (with listener) from flash itself, and from flash and the HTML page.

catbert303
03-31-2003, 06:56 AM
How about a creating different sized pop up windows? Yes you could detect the resolution from flash then send a call to javascript to resize the window accordingly, but why javascript is perfectly able to find the window size and open the pop up based on this. Javascript also has the ability to work with the avialWidth and availHeight properties of the window object, which for resizing to fullscreen is more use than the actual screen resolution.

Equally resizing the movie may not be an option for a movie that has carefully created bitmap images (not likely to be a problem for me with my lame photoshop skills ;)) which won't take kindly to being resized.

Each to their own I guess :)

farafiro
03-31-2003, 07:09 AM
I understand what you mean
so, if I had to combine flash with Action Script, for this, I'd do it all from flash, why??
for the bmp problem u mention, u can control that from flash
see the reference for:
fscommand, and
Stage.align

catbert303
03-31-2003, 08:13 AM
:confused:

how would that help? you still either have to scale the image (lose image quality) or keep the image a fixed size (have pieces chopped of the edges)

farafiro
03-31-2003, 08:54 AM
so wht I told u see the fecommand
fscommand("allowscale",false)