0 Replies Latest reply on Jan 14, 2010 2:26 PM by Yozef0

    LocalConnection between AS3 App into Loaded AS2

    Yozef0 Level 1

      So I have an app that loads an AS2 Compiled SWF into it.

       

      The Main App (AS3)

       

       

      // the SWFLoader loads the ChildSWF, and on (Event.COMPLETE, openLocalConn);
      
      
      private function openLocalConn(e:Event):void {
         my_send_lc = new LocalConnection();
         my_send_lc.send("ConnCountryList", "publicMethod", "jo");
         my_send_lc.addEventListener(StatusEvent.STATUS, onStatus);
      }
      
      
      private function onStatus(event:StatusEvent):void {
         switch (event.level) {
           case "status":
              trace("**** LocalConnection.send() SUCCESS ****" + event.toString());
              break;
           case "error":
              trace("**** LocalConnection.send() FAILED ****");
              break;
         } 
      }
      
      

       

       

       

      Loaded SWFChild (AS2)

       

      trace ("Loaded Child SWF");
      var getArray_lc : LocalConnection = new LocalConnection();
          getArray_lc.client = this;
          getArray_lc.connect("ConnCountryList");
          getArray_lc.allowDomain('*');
      
      
      function publicMethod(jo:String) {
          trace('Eureka');
      }
      

       

       

      So When I run the MainApp, The ChildSWF gets Loaded (traceout: Loaded Child SWF, it's calls the openLocalConn(), it Gives me another traceout: **** LocalConnection.send() SUCCESS ****,

       

      BUT I GET no traceout for the called publicMethod() in the ChildSWF in which I am supposed to see: Eureka