| Previous | Next | |
Windows: Not Applicable
Macintosh: Flash 8 or 9 AS2.0 SWF + mProjector
1.0;
mApplication.bounceDockIcon(repeats:Boolean) : Voidrepeats - A value of true means the icon will continue to bounce until the command is called again with a false. Sending repeats=false will bounce the icon twice then stop.
Nothing.
Method; Bounces icon in the Mac OS X Dock to alert the user your application needs attention. This command will not bounce the icon when your application is the active application.
This example bounces the animates the Dock icon when alertUser(true) is called and stops the animation when alertUser(false) is called. It alos conatins code for an analogous solution on the PC for the System Tray icon.
// Start Animation
// Mac: bounces icon using Mac API
// Windows: sets draw rect in SWF for System Tray icon and starts the animation
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
}
}
// Stop Animation
// Mac: stops bounce
// Windows: stops icon redraw, resets icon to exe icon
stopIconAnimation = function() {
if (mSystem.isMac()) {
mApplication.bounceDockIcon(false);
} else {
mApplication.setSystemTrayIcon(-1,-1); // Stops drawing icon from SWF
mApplication.showInSystemTray(false); // Resets the icon...
mApplication.showInSystemTray(true); // to be the exe icon.
gotoAndPlay(1); // goto frame that doesn't animate icon
}
}
// onActivate event handler
// starts icon animation
alertUser = function(activate:Boolean) {
if ((!activate) and (current_runmode == "background_app")) {
startIconAnimation();
} else if (activate) {
current_runmode = "visible_app"; // reset state to visible app
stopIconAnimation(); // stops animation on Windows
}
}mApplication.setDockIconBadge(), mApplication.setSystemTrayIcon(), mApplication.showInSystemTray(), mApplication.flashTaskBarButton(), mWindow.flashTaskBarButton()
Animating the Dock or System Tray Icon
| Questions or Feedback? | Previous | Next |