3 Replies Latest reply on Oct 18, 2010 4:47 AM by edwinmerced

    Issue with a component

    edwinmerced Level 1

      Good evening Flex community.

       

      I have a Flex (Air) project being built with Flash Builder 4.

       

      In the main application I have a button that places a component in the center of the application (a Window Panel with an integrated swf file). The swf file is a movie  built with Adobe Captivate and is claaed by a SWFLoader component. The button works fine. The swf movie plays nicely in the component (as expected).


      The issue is: When I close the component , the component is removed and I am back to my application BUT (big but here) I can still here the movie playing in the background (when I close the movie before its ending).

       

      This is my code in the component:

       

      <?xml version="1.0" encoding="utf-8"?>
      <s:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx" width="600" height="400"
               close="handleCloseEvent();" title="Demostración">
          <fx:Declarations>
              <!-- Place non-visual elements (e.g., services, value objects) here -->
          </fx:Declarations>

         
              <fx:Script>
                  <![CDATA[
                      import mx.managers.PopUpManager;
                     
                      // Handle the close button and Cancel button.
                      private function handleCloseEvent():void {
                          PopUpManager.removePopUp(this);
                      }           
                     
                      // Handle the OK button.
                      private function processLogin():void {
                          // Check credentials (not shown) then remove pop up.
                          PopUpManager.removePopUp(this);
                      }
                  ]]>
              </fx:Script>
          <mx:SWFLoader x="10" y="10" width="578" height="347" source="demonstrations/untitled_demo1.swf" autoLoad="true" scaleContent="true"/>
             
          </s:TitleWindow>

       

      Any help in clarifying my issue will be appreciated

       

      Thank you