3

I want to create an AIR application in which i need to show the notification that when AIR application is minimize then at some interval of time message shows from the system tray similar like giving information.

I have visited this LINK, its a nice component but tutorial is not that much good as component. I need to create a component like that or source is available from this site so modification in this component will also be acceptable. so please help me.

EG: When you minimize the Yahoo Messenger and some one is sign-out or sign-in then it gives notification i want component similar like that...

Thanks in Advance

Sagar Rawal
  • 1,442
  • 2
  • 12
  • 39

1 Answers1

2

First Step, We have created a Custom Popup control for Notifications display.

In the second step, we have controlled the display of that popup using the following code

if(!this.stage.nativeWindow.visible || this.stage.nativeWindow.displayState == NativeWindowDisplayState.MINIMIZED)
{
    stage.nativeWindow.alwaysInFront = true;
    fadeTimer = new Timer(5000,1);
    fadeTimer.start();
    fadeTimer.addEventListener(TimerEvent.TIMER_COMPLETE, fadePopUp);

    popUpWindow = new PopUpWindow();
    popUpWindow.isAlerts = true;
    popUpWindow.Message = "<b>You have "+event.numNewMessages+" new notification messages<b>";

    popUpWindow.type = NativeWindowType.LIGHTWEIGHT;
    popUpWindow.open(true);
    popUpWindow.fadeInEffect.play();            
    popUpWindow.nativeWindow.x = Capabilities.screenResolutionX - popUpWindow.width - 10;
    popUpWindow.nativeWindow.y = Capabilities.screenResolutionY - popUpWindow.height - 35;
}

The condition used above is what we have used to find out, whether our application window is minimized to System Tray or not. Even though it is not a perfect fix, It didn't fail me yet. It's quiet stable for my app.

Dinesh
  • 2,026
  • 7
  • 38
  • 60
  • Thanks for your Reply, but need some more help here popupwindow is of which type? and also one more thing what is thirdEyeMessage and isThirdEyeAlerts? – Sagar Rawal Feb 22 '12 at 05:05
  • Those are my Popup's properties. Basically they have used to set the Notification Message to display and Display style. – Dinesh Feb 22 '12 at 05:24
  • tag is used to create my custom Popup Window. It is MXML based component and available only in AIR based applications. – Dinesh Feb 22 '12 at 05:27