0 Replies Latest reply on Mar 26, 2009 8:04 PM by nanafuku

    bounce(), notifyUser()  JavaScript problem

    nanafuku Level 1
      Below problems are in JavaScript/HTML only. In Flex both works well.

      In JavaScript/HTML on Mac, dock icon bounces only once in CRITICAL.
      Below 3 cases(type, CRITICAL, "aaa"), same results.
      How do I use JavaScript code to react doc icon repeatedly?

      function notify() {
      if (air.NativeApplication.supportsDockIcon) {
      var critical = document.getElementById("critical");
      var type = (critical.checked ? air.NotificationType.CRITICAL : air.NotificationType.INFORMATIONAL);
      //air.NativeApplication.nativeApplication.icon.bounce(type);
      //air.DockIcon(air.NativeApplication.nativeApplication.icon).bounce(air.NotificationType. CRITICAL);
      air.NativeApplication.nativeApplication.icon.bounce("aaa");
      }
      }

      function setListener()
      {
      nativeWindow.addEventListener(air.Event.DEACTIVATE, notify);
      }
      </script>
      </head>
      <body onload="setListener()">

      And I have another problem on Windows just as Mac.
      Below cases(type, CRITICAL, ,no argumens) are same results.
      Application windows and taskbar flash only once.
      How do I use JavaScript code to flash window and taskbar??

      function notify(){
      if(air.NativeApplication.supportsSystemTrayIcon && air.NativeWindow.supportsNotification) {
      var critical = document.getElementById('critical');
      var type = (critical.checked ? air.NotificationType.CRITICAL : air.NotificationType.INFORMATIONAL);
      window.nativeWindow.notifyUser(type);
      //window.nativeWindow.notifyUser(air.NotificationType.CRITICAL);
      //window.nativeWindow.notifyUser();
      }
      }

      function setListener(){
      window.nativeWindow.addEventListener(air.Event.DEACTIVATE, notify);
      }
      </script>
      </head>
      <body onLoad="setListener()">