# Multiple swf communication

**URL:** <https://forum.kirupa.com/t/multiple-swf-communication/280876>\
**Category:** Uncategorized\
**Created:** [February 2, 2009, 2:44pm UTC](https://forum.kirupa.com/t/multiple-swf-communication/280876 "2009-02-02T14:44:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Freeseus](https://avatars.discourse-cdn.com/v4/letter/f/9e8a1a/32.png) [@Freeseus](https://forum.kirupa.com/u/Freeseus)\
**Post date:** [February 2, 2009, 2:44pm UTC](https://forum.kirupa.com/t/multiple-swf-communication/280876/1 "2009-02-02T14:44:22Z")

</div>

how do I get my child swf to communicate with my main swf?

(this is main1.swf)

var homeRequest:URLRequest = new URLRequest(“window1.swf”);  
var homeLoader:Loader = new Loader();  
homeLoader.load(homeRequest);  
addChild(homeLoader);

loads in the child swf

I want the child to call a function that exists on the main swf

(this is window1.swf)

stop();  
myBtn.addEventListener(MouseEvent.CLICK, testThis);

function testThis(event:MouseEvent):void {  
MovieClip(root).activatemyfunction();  
trace(“you have clicked this”)  
}

Obviously, MovieClip(root) is not getting to the main.swf’s root timeline. What code do I need to do this?
