2 Replies Latest reply on Aug 16, 2010 4:03 AM by olsharpe

    Handling JavaScript Window Status Update..

    olsharpe

      Hi,

       

      I am developing a Flex/AIR application which renders HTML content from financial based system.

       

      I have created a subclass of the HTMLHost class in order to handle Javascript events such as window.open().

       

      This works well, but the web application in question stores session information with in the window status. I am having trouble to reflect this in my AIR native windows. Is it possible to make the status bar visible and display the data sent from Javascript?

       

      My HTMLHost subclass is as follows;

       

      package

      {

      import flash.display.NativeWindow;

      import flash.display.NativeWindowInitOptions;

      import flash.display.NativeWindowType;

      import flash.display.StageScaleMode;

      import flash.geom.Rectangle;

      import flash.html.*;

      import flash.net.URLRequest;

       

       

      public class HtmlHost extends HTMLHost

      {

       

      public var htmlControl:HTMLLoader;

       

      public function HtmlHost(defaultBehaviors:Boolean=true)

      {

      super(defaultBehaviors);

      }

       

      override public function createWindow(windowCreateOptions:HTMLWindowCreateOptions):HTMLLoader

      {

      var initOptions:NativeWindowInitOptions = new NativeWindowInitOptions();

      initOptions.minimizable = false;

      initOptions.type = NativeWindowType.UTILITY;

      var bounds:Rectangle = new Rectangle(

      windowCreateOptions.x,

      windowCreateOptions.y,

      windowCreateOptions.width,

      windowCreateOptions.height);

       

      var htmlControl:HTMLLoader = HTMLLoader.createRootWindow(true, initOptions, windowCreateOptions.scrollBarsVisible, bounds);

      htmlControl.htmlHost = new HtmlHost();

      htmlControl.stage.nativeWindow.alwaysInFront = true;

       

       

      return htmlControl;

      }

      override public function updateTitle(title:String):void

      {

      trace ("TITLE UPDATE");

      trace (title);

      htmlLoader.stage.nativeWindow.title = title;

      }

       

      override public function updateLocation(locationURL:String):void

      {

      trace ("LOCATION UPDATE");

      trace(locationURL);

      htmlLoader.load(new URLRequest(locationURL));

       

      }

       

      override public function updateStatus(status:String):void

      {

      trace ("STATUS UPDATE");

      trace(status);

       

       

      }

       

       

      override public function windowClose():void

      {

      htmlLoader.stage.nativeWindow.close();

      }

      }

      }

       

      Any help would be greatly appreicated!

       

      Thanks

       

      Oliver