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!