| Previous | Next | |
This sample shows you how to add a dynamic icon to the Windows system tray or Mac Dock.
On the Mac animating the icon is done by calling a Mac OS API that bounces the application's icon. The command used is mApplication.bounceDockIcon(). This command does not work if you build your SWF into a widget type application as widgets, defined by Apple, do not show an icon in the dock.
On Windows call mApplication.showIconInSystemTray() to display your exe's standard icon in the system tray.
You can display an animated icon by adding a 16x16 pixel animation to your swf and calling mApplication.setSystemTrayIcon() with the top-left pixel location of the square. This command tells mProjector to clip the region out of your SWF and play it in the system tray. Anti-aliasing and alpha rendering of the icon may not be accurate unless you are using Flash 8 and a filter on on the icon MovieClip. See the "Flash-Shaped Windows" sample for a explanation.
startIconAnimation = function() {
if (mSystem.isMac()) {
mApplication.bounceDockIcon(true);
} else {
mApplication.setSystemTrayIcon(1,1); // start drawing icon from upper left of SWF
gotoAndPlay(3); // start animating icon in SWF
}
}You can download this sample, "Alert Icon", from the mProjector Samples page -- http://www.screentime.com/software/mprojector/flas.html#alertIcon.
| Questions or Feedback? | Previous | Next |