0 Replies Latest reply on Jul 8, 2010 5:52 PM by sanggpark

    Opening window behind another one

    sanggpark Level 1

      I'm trying to open a new window behind the current one and I can't seem to figure out how.

      Here's an example.

      <?xml version="1.0" encoding="utf-8"?>
      <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
                     import mx.events.FlexEvent;
                     import spark.components.Window;
                     private var window1:Window     = new Window();
                     private var window2:Window     = new Window();
                     private var timer:Timer      = new Timer(3000,1);
                     private function onCreationComplete(event:FlexEvent):void
                          window1           = new Window();
                          window1.title      = "Window 1";
                          window1.width      = 200;
                          window1.height      = 200;
                          window2           = new Window();
                          window2.title      = "Window 2";
                          window2.width     = 200;
                          window2.height     = 200;
                          timer.addEventListener(TimerEvent.TIMER_COMPLETE, openWindow2, false, 0, true);
                     private function openWindow2(event:TimerEvent):void


      My expectation of the above code is that window1 will open behind the main app and window2 will open behind window1. But instead window1 will open on top of the main app and window2 will open on top of the main app with the main app still in focus. Is this a bug in the system? or am I doing something wrong? Is there a fix/workaround for this?