PDA

View Full Version : how can you detect user's screen resolution from .exe?


Sir Patroclo
10-17-2002, 07:35 AM
Hi, it's me again:

I made this 800 x 600 movie, and set it up to be a stand alone projector... I need to know the resolution of the user's screen so I can go fullscreen on 800 x 600 and leave the size alone if the resolution is higher...

Greetings to all

Sir Patroclo

farafiro
10-17-2002, 12:16 PM
trace(System.capabilities.screenDPI)
trace(System.capabilities.screenResolutionX)
trace(System.capabilities.screenResolutionY)

Sir Patroclo
10-18-2002, 12:24 AM
Thanx Farafiro.
I received a similar answer in the Flashkit forums last night, and worked out a simple code that other newbies could find useful:
This goes in the first frame of the movie:

//here you declare the variable "X" wich is the horizontal resolution of the user's monitor

X = System.capabilities.screenResolutionX;


//here you set an if statement, where the movie goes fullscreen only if the value of X is equal to 800, as in "800 x 600"

if (x==800) {
fscommand("fullscreen", "true");
} else {
stop();
}

Hope this helps someone else

Sir Patroclo

farafiro
10-20-2002, 08:40 AM
but u should keep in mind also that the fscommand only works in a standalone movies only (not over the web)

sintax321
10-22-2002, 09:41 PM
What would the code look like for a SWF and not a exe? :confused:

pom
10-22-2002, 10:19 PM
Same thing. :D Because it is the same thing. Only offline.

pom :D