5 Replies Latest reply on Oct 30, 2009 12:35 AM by jayuzzz

    How to passing session parameter into installed Air app?

    jayuzzz Level 1

      Hi all,

      I am a newbie here and facing a problem. Hope anyone can help.....


      I am planning to make a secure quiz application that can be integrated with moodle. I already have a secure window that I want and I am using nativewindow to do that. I want to make the secure quiz application invoke just when quiz in moodle started.

      the problem is how can I pass session parameter from moodle into installed air application? I want to make user doesn't need to login again when using my application but just continue the session.


      *** aditional, this is my index.html code.

      *********************************************************begining of my code

      <script src="AIRAliases.js" type="text/javascript"></script>
      <script src="servicemonitor.swf" type="application/x-shockwave-flash" />


      <script type="text/javascript">
      var urlMonitor;
      var invokeEvent;
      function doWindow()
      var options = new air.NativeWindowInitOptions();
      options.transparent = false;
      options.systemChrome = air.NativeWindowSystemChrome.STANDARD;
      options.minimizable = false;
      options.maximizable = false;
      var windowBounds = new air.Rectangle(0,0,air.Capabilities.screenResolutionX,air.Capabilities.screenResolutionY);
      var urlreq="http://www.example.com";//how can I pass the parameter here ?

      var newHTMLLoader = air.HTMLLoader.createRootWindow(true, options, true, windowBounds);
      newHTMLLoader.load(new air.URLRequest(urlreq));

      newHTMLLoader.stage.nativeWindow.alwaysInFront = true;
      newHTMLLoader.stage.nativeWindow.addEventListener(air.NativeWindowBoundsEvent.MOVE,handle move);
      urlMonitor = new air.URLMonitor(new air.URLRequest("http://www.example.com"));
      urlMonitor.addEventListener(air.StatusEvent.STATUS, onStatusChange);
      air.NativeApplication.nativeApplication.addEventListener(air.InvokeEvent.INVOKE, onInvoke);
      function handlemove()

      function onCloseCommand(exitingEvent) {
      var winClosingEvent;
      for (var i = 0; i < air.NativeApplication.nativeApplication.openedWindows.length; i++) {
      var win = air.NativeApplication.nativeApplication.openedWindows[i];
      winClosingEvent = new air.Event(air.Event.CLOSING,false,true);
      if (!winClosingEvent.isDefaultPrevented()) {
      } else {
      if (!exitingEvent.isDefaultPrevented()) {


      function onStatusChange(event)
      if (urlMonitor.available)
      alert("The current network status is Connected");
      alert("The current network status is Disconnected");
      <body onload="doWindow()">



      ************************************************end of my code

      please help me