Detection

This isnt really a flash question, but can you detect what screen resolution people are set at in order to give them a particular version of your site?

System.capabilites.screenResolution.x, screenResolution.x

hope that helps!

Thanks!

One more question though… how can I pass that info to Flash MX in order for it to make a decision on which redirect to goto?

or am I an idiot and you gave a property that Flash reads on its own?

I can write a javascript function to redirect on screen size. All you would have to do is add it to your html file. If you are interested I can write it real quick and post it here.

Yeah thanks - that would be really great. I appreciate the help!
Peace

Hey Lost,
Do you know if it is possible to get the height and width of a picture with JS? Cos a friend of mine needs that. [SIZE=1]Sorry for polluting the forum…[/SIZE] :slight_smile:

pom :asian:

Hey Ryall, I have attached a .zip file with 2 .html files and a readme file.

The script I used only gets the width of the screen. I did this on purpose because there are variables that effect the height of the screen. Mac and Window scrollbars are one major effect, since Window scrollbars are resizeable, this could send the script wicky in the wacky woo, if ya know what I mean. I am sure it would work fine if I added height, but it’s more coding than you really need.

This script works in both IE6 and Netscape 6, those are the only things I could test it on since that is all I have. Also, I only run an 800x600 monitor so I don’t know for sure if it will work for above that, but in theory it should, I have used methods like this where it worked.

For those of you who don’t feel like downloading my file I have placed the code here (but the file contains comments on what each thing does)…

var size = (screen.availWidth);
size <= 800 ? window.location=“http://www.lostinbeta.com/” : window.location=“http://www.google.com/”;
}

Ilyas: your not polluting the forum :slight_smile: I have never actually tried getting image size from js, but I could give it a whirl, if I figure anything out I will definitely let you know.

Hey Ilyas, I am hard at work with david’s pop-up window problem, but I will try to get to your friends problem asap. Just out of curiousity…why does your friend need this script? I mean, You can easily get the height and width of an image by right clicking on it and selecting properties. Is there something I am overlooking that could be done with a script like this?

Well I seemed to have gotten done davids code sooner than expected (although I am not sure if I did what he wanted, so I am waiting for a reply from him), so I got crankin on the image size thing.

I did get a script working, but it only works for Internet Explorer. Since I don’t usually use javascript in a way that works with Netscape, I am not sure if I can do that. I will give it a try, but until then I posted the .zip file of the IE working one, complete with image and .html file.

I had to at least give something because its 2:46am here and I am tired, but I don’t usually give up until I get everything completed that I had to do. Knowing that I gave an IE working script sets my mind at ease and will hopefully allow me to sleep without contantly thinking about how to do it (although I still have to figure out about netscape).

I hope this helps your friend Ilyas.

yikes, I just realized I never attached the .zip for the screen size redirect, I am slipping in my old age of 18.

Here ya go Ryall

Thanks!

Hey, no problem Ryall, glad I could help.

Sorry for making you wait for the .zip file, I still can’t believe I forgot that the first time.