Designing Your Screen Saver in Flash

Design your application in Flash as you would any Flash animation or web application.

Include the ScreenTimeScreenSaver component, and call STF methods to add Mac and Windows desktop functionality.

Drag and drop the component on the first frame of your movie. If you see the ScreenTime V3 icon in your FLA, your project is "desktop ready". Make the component invisible in your screen saver by giving it an instance name and setting its _visible property to false or by moving it off the Stage.

Allow the component one frame to initialize itself. Add STF commands to subsequent frames for required desktop functionality.

If your saver is just great eye candy and doesn't use STF commands, the component is NOT REQUIRED.

Asynchronous Command Model:

ScreenTime methods run asynchronously, so return values are not immediately available, and must be accessed using a "callback" event. To utilize a return value, register a callback function with an argument matching the data type of the STF function result. This function will be called by ScreenTime upon the completion of the command and will be passed the command result.

The following sample, which retrieves a unique user id, demonstrates the Asynchronous Command Model.


var userID:String;
onGetUserGUIDReturn = function(returnValue:String) {  // define callback
	userID = returnValue;
}
mApplication.registerCallBack("getUserGUID", onGetUserGUIDReturn, this);   
// register callback function
mApplication.getUserGUID();