
Buy Notifications AIR (Miscellaneous)
Notifications AIR (Miscellaneous) Description:
Notifications for Adobe AIR allows you to add Notifications to your programs.
- Unlimited Number of Notificiations (one at a time, the others are queued)
- Sticky Notifications (Not removed until clicked)
- Notifications with images
- Easy implementation
How to Use it
import com.cyprog.notifications.ui.NotificationUI; import com.cyprog.notifications.NotificationManager; import com.cyprog.notifications.NotificationConstants; import com.cyprog.notifications.events.NotificationEvent; import com.cyprog.notifications.events.NotificationManagerEvent; import flash.events.Event; //new instance of Notification Manager //if you don't want to use a sound-clip, call the function only with the first parameter and you can start using it immidiately by calling the "show" function var notMan:NotificationManager = new NotificationManager(NotificationConstants.DISPLAY_LOCATION_AUTO, "/assets/sounds/beep.mp3"); //set the display time to Medium(5 seconds), by default is set to Short (3 seconds) notMan.displayTime = NotificationConstants.DISPLAY_TIME_MEDIUM; //add event listeners for sound loading. If you choice to use a sound-clip don't call the show function until the sound finish loading. notMan.addEventListener(NotificationManagerEvent.FINISH_LOADING_SOUND,onSoundLoadComplete); notMan.addEventListener(NotificationManagerEvent.ERROR_LOADING_SOUND,onSoundLoadError); //add click event listener notMan.addEventListener(NotificationEvent.NOTIFICATION_CLICKED,onNotificationClick); //add close event listener notMan.addEventListener(NotificationEvent.NOTIFICATION_CLOSED,onNotificationClose); //sound successful load handler function onSoundLoadComplete(evt:Event):void{ //remove sound listeners notMan.removeEventListener(NotificationManagerEvent.FINISH_LOADING_SOUND,onSoundLoadComplete); notMan.removeEventListener(NotificationManagerEvent.ERROR_LOADING_SOUND,onSoundLoadError); showNotifications(); } //sound error while loading handler function onSoundLoadError(evt:Event):void{ notMan.removeEventListener(NotificationManagerEvent.FINISH_LOADING_SOUND,onSoundLoadComplete); notMan.removeEventListener(NotificationManagerEvent.ERROR_LOADING_SOUND,onSoundLoadError); trace("Sound loading failed. Please check for valid path"); showNotifications(); } //on click notification handler function onNotificationClick(evt:NotificationEvent):void{ //evt.title returns the notification's title //evt.message returns the notification's message trace(evt.title," CLICKED. Message: " ,evt.message); } //on close notification handler function onNotificationClose(evt:NotificationEvent):void{ //evt.title returns the notification's title //evt.message returns the notification's message trace(evt.title," CLOSED. Message: " ,evt.message); } function showNotifications():void{ //show a new notification notMan.show("Sticky","This is a sticky Notification is not removed until clicked",null,true); //all the following notifications are queued //notification manager can only show one notifiation at a time //show an image notification notMan.show("Image","This is a notification with an image","/assets/images/icon.png"); //show a default notification notMan.show("Notification","Notification message here"); //you can anytime view the number of queued notifications trace(notMan.queuedNotifications); }
Applications for Touch Devices:



Buy it Now