AS3 Support
Question:
Does Screentime support AS3 SWFs?
Answer:
The current version of Screentime was written for AS2 but it does work with AS3 SWFs with a few limitations.
1) Do NOT set your AS3 SWF to display fullscreen. Screentime will do this automatically. If you set the displayState to be fullscreen your screen saver will launch but however your animation will not run.
2) The STF class is implemented for AS1 and AS2. If you need STF commands you can access them indirectly using the fscommand interface. This interface does not support return values.
It's a bit strange but if you really need it this will help. fscommand takes two parameters. The first parameter the fullname of the STF command. The second parameter is a URL style variable string that comantains the name and value pairs for each parameter required for the command.
var command_str:String = "STF.commandName";
var param_str:String = "?paramName1="+escape(value1) + "¶mName2="+escape(value2);
fscommand(command_str, param_str);
Example:
var command_str:String = "STF.launchAndQuit";
var param_str:String = "?URL="+escape("http://www.screentime.com");
fscommand(command_str, param_str);
The following sample code launches a browser window (STF.launchAndQuit()) when when it detects and keydown of keycode 49,50 and quits the screen saver (STF.quit()) on mouse movements and other keydowns.
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoved);
function keyPressed(e:KeyboardEvent){
if(e.keyCode == 49){
var command_str:String = "STF.launchAndQuit";
var param_str:String = "?URL="+escape("http://www.screentime.com");
fscommand(command_str, param_str);
}
else if(e.keyCode == 50){
var command1_str:String = "STF.launchAndQuit";
var param1_str:String = "?URL="+escape("http://www.screentime.com/about");
fscommand(command1_str, param1_str);
}
else{
fscommand("STF.quit");
}
}
function mouseMoved(e:MouseEvent){
fscommand("STF.quit");
}
We are working on full AS3 support for the next version.
If you have additional questions or have ideas on how to improve an FAQ, contact us. Please include a link to the FAQ in your email.