1 Reply Latest reply on Apr 7, 2010 11:25 AM by Flex harUI

    Error in loading swf

    openadobe

      Hello,

      I am facing a problem while loading an swf into an mxml application.

       

      I have loaded a swf file into my flex application using SWFLoader as below
      <mx:SWFLoader id="myLoader" source="dummy.swf" />

       

      This SWF is created using Macromedia Flash 8 instead of Flex.

      I want to control this externally loaded swf. For that,I am exposing an interface to control this swf as follows:

       

      swfinterface=e.currTarget.application as PInterface

      This interface allows me to call upon few functions that operate on the loaded swf.

       

      What i am doing is using System Manager class as follows:

       

      public var mySWF:SystemManager;

      private function initApp():void {
      mySWF = SystemManager(myLoader.content);
      }

       

      However i am getting the following error:

       

      Type Coercion failed: cannot convert flash.display::AVM1Movie@206ed41 to mx.managers.SystemManager.

       

      Please let me know possible solutions to this.