# Communication between loaded swf and container swf

**URL:** https://forum.kirupa.com/t/communication-between-loaded-swf-and-container-swf/323781
**Category:** Uncategorized
**Created:** [July 18, 2011, 7:16am UTC](https://forum.kirupa.com/t/communication-between-loaded-swf-and-container-swf/323781 "2011-07-18T07:16:44Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![coolpills](https://avatars.discourse-cdn.com/v4/letter/c/73ab20/32.png) [@coolpills](https://forum.kirupa.com/u/coolpills)
#### Post date: [July 18, 2011, 7:16am UTC](https://forum.kirupa.com/t/communication-between-loaded-swf-and-container-swf/323781/1 "2011-07-18T07:16:44Z")

</div>

Hi,

I need to communicate from loaded swf to the container swf in AS 3.0. This is the code for document class of loaded swf followed by code for source swf document class. Please let me know how i can call the method xyz() from the external swf ???

```auto
package com.scottgmorgan {
     import flash.display.Sprite;
     public class ExternalMovie extends Sprite {
          public function ExternalMovie():void {
               //nothing in our constructor right now.
          }
          
     }
} 

```

code for source movie

```auto
package com.scottgmorgan {
     import flash.display.Loader;
     import flash.net.URLRequest;
     import flash.events.Event;
     import flash.display.LoaderInfo;
     import flash.display.Sprite;
     
     public class SourceMovie extends Sprite {
          public function SourceMovie():void {
               var loader:Loader = new Loader();
               loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete);
               loader.load(new URLRequest('ExternalMovie.swf'));
          }
          private function onLoadComplete(e:Event):void {               
 //nothing ight now.
          }

   public function xyz():void {
               trace("Hello world");
              
          }

     }

```

}
