Is it technically possible to create a screen saver for Windows using Adobe AIR?
-
1Not AFAIK. Screen savers have to contain specific functions loadable by Windows, and AIR doesn't give you a way to provide those functions. – Ken White Jun 05 '12 at 16:29
-
@KenWhite & Pavel - It actually is possible, I added an answer that hopefully explains it well. – BadFeelingAboutThis Nov 27 '13 at 22:04
2 Answers
A work around is to host a .swf within a Windows form exe. I currently do this with C#/.Net 4.0. First you need to configure the .exe to behave as a screensaver. When you are done, you need to rename your .exe to .scr. Within the windows form, you need to embed a Flash Active X Object, then set the windows form to borderless etc.
If needed, the .swf can communicate to the .scr via the fscommand call. I for example, listen for the mouseMove event, within the .swf, then tell the .scr to close via fscommand.
There is a free utility that converts .swf files to screensavers called InstantStorm, but I personally prefer the Windows form method, as it allows more control.

- 1,024
- 11
- 11
Yes it is.
What you can do is compile your AIR project with -captive-runtime OR -target bundle (Makes it a standalone .exe instead of .air file).
For windows, simply rename your .exe to .scr, right click and choose install or test.
If you want to set it up for configuration and preview modes, you can listen for the application invoke event:
//put this in your app main constructor
NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE, invokEventHandler, false, 0, true);
protected function invokEventHandler(e:InvokeEvent):void {
//you don't actually have to loop as it will always be the first argument
for each(var a:String in e.arguments) {
//p - Show the screensaver in the screensaver selection dialog box
if (a.indexOf("/p")) {
//do something different for preview mode
break;
}
//s - Show the screensaver full-screen
if (a.indexOf("/s")) {
//the main full screen mode
break;
}
//c - Show the screensaver configuration dialog box
if (a.indexOf("/c")) {
//show a configuration window
break;
}
}
}

- 14,445
- 2
- 33
- 40