# Loading external swfs with their own navigation

**URL:** <https://forum.kirupa.com/t/loading-external-swfs-with-their-own-navigation/299200>\
**Category:** flash\
**Created:** [October 31, 2009, 5:41pm UTC](https://forum.kirupa.com/t/loading-external-swfs-with-their-own-navigation/299200 "2009-10-31T17:41:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![OhCaye](https://avatars.discourse-cdn.com/v4/letter/o/47e85d/32.png) [@OhCaye](https://forum.kirupa.com/u/OhCaye)\
**Post date:** [October 31, 2009, 5:41pm UTC](https://forum.kirupa.com/t/loading-external-swfs-with-their-own-navigation/299200/1 "2009-10-31T17:41:48Z")

</div>

Folks: I am such a newbie. I am trying to teach myself Flash and AS3 using the two Adobe Classroom in a Book Series so I am not sure if I am framing my question correctly. I have found lots of information regarding loading and unloading, but not about establishing communication between parent and child.

I have a home page with four buttons that have nice Mouse Over effects. When I click on them, they load the external swfs nicely. When I click on the external swf, it also unloads just the way I want it to. Here is the relevant code:

var myLoader:Loader=new Loader ();

m\_pageA.addEventListener(MouseEvent.MOUSE\_OVER, colorChangeA);  
m\_pageA.addEventListener(MouseEvent.CLICK, page1content);  
function colorChangeA(evt:MouseEvent):void {  
m\_pageA.gotoAndPlay(1);  
}

function page1content(evt:MouseEvent):void {  
var myURL:URLRequest=new URLRequest(“page1.swf”);  
myLoader.load(myURL);  
addChild(myLoader);  
}

myLoader.addEventListener(MouseEvent.CLICK, unloadcontent);  
function unloadcontent(myevent:MouseEvent):void {  
removeChild(myLoader);  
m\_pageA.gotoAndPlay(1);  
}

Inside the external swf, I have two back and forward buttons (it is a slide show type of thing), that are not accessible when I click on them because if I do, I just unload the content from myLoader. If I remove the unloadcontent function from my main home page FLA, the swf’s buttons work great, but I can’t remove the external swf. I have also experimented with having a close button appear on frame 2 of my home page’s main timeline, and tried adding code for it to unload the swf, to no avail.

It seems to me that I can’t be the only one who has this problem. Lesson 9 of the Adobe Classroom in a Book definitely implies that this can be done, but doesn’t have instruction on how to do it. Can anyone help me or point me in the direction of a good tutorial on communication between swfs?

Thanks!
