1 Reply Latest reply on Jul 16, 2010 5:28 PM by chris.campbell

    PopUps after reparenting displayobject to new Window still show in Main Window

    aman_thind Level 1

      Hello,

       

      I am working on an attach/detach functionality in AIR where a user can export a displayobject from the main application into a separate air mx.core.Window.

       

      However, even once the object has been reparented into the native window, all its pop ups and tooltips continue to display in the main window.

       

      Let me display this with a simple example:

       

      Sample Code:

       

      <?xml version="1.0" encoding="utf-8"?>

       

      <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

       

      <mx:Script>

       

      <![CDATA[

       

      import mx.core.Window;

       

        [Bindable]

       

        private var cdata:Array = ["Test1", "Test2", "Test3"];

       

      private function popout():void

       

      {

       

              var popoutWin:Window = new Window();

       

              popoutWin.addChild(cc);

       

              popoutWin.open();

       

      }

       

      ]]>

       

      </mx:Script>

       

        <mx:HBox>

       

        <mx:Button label="PoP" click="popout()" />

       

            <mx:Canvas id="cc">

       

            <mx:ComboBox id="cb" dataProvider="{cdata}" />

       

            </mx:Canvas>

       

        </mx:HBox>

       

      </mx:WindowedApplication>

       

      -----------

       

      If you popup "cc", you will always see the dropdowns in main window instead of the new window. If you popup "cb", it will behave only as long as you had not opened the combobox before. (probably because the systemManager property used by the PopupManager gets set to that of the native window only for the root component that gets moved)

       

      Any help would be highly appreciated.