4 Replies Latest reply on May 21, 2009 7:03 AM by ValentinB

    Opening a PopUp in a new NativeWindow with PopUpManager

    ValentinB

      Hi everybody !

       

      I'm stuck with a problem in my application, and after one hour of searching, I can't get my problem solved.

      So here is the deal.

       

      I'm creating a new NativeWindow in my main application and I load the swf file of my second application in it :

       

      // ------------------------------------------------

      var

       

      options:NativeWindowInitOptions = new NativeWindowInitOptions();

      options.systemChrome = NativeWindowSystemChrome.NONE;

       

       

      options.type = NativeWindowType.NORMAL;

      historyWindow =

      new NativeWindow(options);

      historyWindow.title =

      'New Window';

      historyWindow.stage.scaleMode = StageScaleMode.NO_SCALE;

       

      historyWindow.activate();

       

       

      var loaderswf:Loader = new Loader();

      loaderswf.load(

      new URLRequest("history.swf")); //this is a second MXML Application

      loaderswf.contentLoaderInfo.addEventListener(Event.COMPLETE,loadFlash);

       

       

      function loadFlash(event:Event):void{

           historyWindow.stage.addChild(event.target.loader);

      }

      // ------------------------------------------------

       

      Then, in this window (so in my 'history' MXML Application), I'm trying to add a TitleBox as a PopUp this way :

       

      // ------------------------------------------------

      public

       

      var _window:TitleWindow;

       

       

       

       

      import mx.controls.TextArea;

       

       

       

      var textArea:TextArea = new TextArea;

      textArea.text =

      "Some Text";

      textArea.height = 100;

      _window = TitleWindow(PopUpManager.createPopUp(

      this, TitleWindow));

      _window.addChild(textArea);

      // ------------------------------------------------

       

       

      But nothing happens. The PopUp doesn't appear...

      Is there a problem with the "parent" param of the createPopUp() function?

       

      Thanks !