6 Replies Latest reply on Sep 2, 2009 9:46 PM by Flex harUI

    Cast error for SystemManager(myLoader.content)


      Hi All,


      Stumpted after hours of debugging, forum and google searching.


      Unable to cast like all the example code.

      Unable to get a system manager.

      Cannot figure how to get a reference to the child application just loaded by the SWFLoader with a SystemManager


                 // TypeError: Error #1034: Type Coercion failed: cannot convert _RecordGuiApp_mx_managers_SystemManager@42b2be1 to mx.managers.SystemManager.
                  // loadedSM = SystemManager(myLoader.content);


      Main App has a popped up window.

      The Panel is in the popup window. SwfLoader in the Panel Not Main App.

      The child app loads correctly because I can see it in the Panel and use it.




      <mx:SWFLoader id="myLoader"


              private function creationComplete():void {
                  trace( "creationComplete()" );
                  var context:LoaderContext = new LoaderContext();
                  // Specify the current application's security domain.
                  context.securityDomain = SecurityDomain.currentDomain;
                  context.applicationDomain = new ApplicationDomain();
                  myLoader.loaderContext = context;
                  myLoader.source = "RecordGuiApp.swf";



      Thanks in Advance,