4 Replies Latest reply on Dec 3, 2010 1:51 AM by Flex Rock

    IFrame(child container) still visible after closing the title window(parent container)

    tuliptaurus

      Hi All ,

       

       

      I have created a sample project using a link button which when clicked opens up an TitleWindow which has an iframe and a text area in a hbox

       

      When you execute the application ,

                Click the link button

                The Popup window opens up showing the title window with the close button

                Click the close button of the title window

                The Title window is removed and the iframe and the text area are not visible

       

       

      Do this a couple of times

      You can notice that the iframe is still visible even when the title window is closed

       


      Can someone explain me how this issue can be resolved and also explain me why the iframe(child container) is still visible when the title window(parent container) is not visible. 

       

       

      Main Application file

       

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

      <mx:Application

          width="100%" height="100%" creationPolicy="all"

          xmlns:mx="http://www.adobe.com/2006/mxml"

          layout="vertical" creationComplete="init()"

          xmlns:containers="containers.*">

         <mx:Script>

         <![CDATA[

            

             import mx.managers.PopUpManager;

             import containers.PopUpBrowser;

            

             public function doRequest():void

                  {

                      var requestPopup:PopUpBrowser = PopUpManager.createPopUp(this, PopUpBrowser) as PopUpBrowser;

                      PopUpManager.addPopUp(requestPopup,this);

                      requestPopup.x = 220;

                      requestPopup.y = 50;

                  }

         ]]>

         </mx:Script>

         <mx:Text fontSize="14" fontWeight="bold" text="Click the link button below to open the Title Window" />

         <mx:Spacer height="100"/>

         <mx:LinkButton label="Click me" fontSize="16" fontWeight="bold" click="doRequest()"/>

       

      </mx:Application>

      PopUpBrowser.mxml Component
      <?xml version="1.0" encoding="utf-8"?>
      <mx:TitleWindow
          close="removeMe()"
          showCloseButton="true"
          styleName="myTitleWindowStyle"
          width="850" height="500"
          title="Klout User Profile"
          paddingTop="1" paddingBottom="1"
          paddingLeft="1" paddingRight="1"
          xmlns:generic="com.serendio.voom.components.generic.*"
          xmlns:flexiframe="http://code.google.com/p/flex-iframe/"
          horizontalScrollPolicy="off"
          verticalScrollPolicy="off" >
         
          <mx:Script>
              <![CDATA[
                  import mx.managers.PopUpManager;
                 
                  public function removeMe():void
                  {
                      PopUpManager.removePopUp(this);
                  }
                 
              ]]>
          </mx:Script>
          <mx:HBox width="100%" height="100%">
          <flexiframe:IFrame source="http://www.google.com" id="iFrame" width="50%" height="100%"/>
          <mx:TextArea text="Open and close the title window few times and watch the iframe remain visible even when the title window is closed"
               fontSize="14" width="50%" height="80%"/>
          </mx:HBox>
      </mx:TitleWindow>
      Thanks,
      Ajantha