How do I interact with a loaded swf?
Hi,
I have a "lesson" that I'm building that will display a series of "pages" based on an XML file. I have simple navigation buttons that work to page through the XML file. but I'd like to use load an external SWF file with buttons to use as my navigation panel. Everything is AS 3.0. The code to load the navigation movie looks like this:
// load navigator
navLoader = new Loader;
navLoader.contentLoaderInfo.addEventListener(Event.INIT, handleInit);
navLoader.x = 50;
navLoader.y = 200;
lessonSprite.addChild(navLoader);
navLoader.load( new URLRequest("Navigator1.swf"));
The loaded navigation movie has two buttons. How do I add an event listener to those buttons so that they call a function in the parent movie so I can detect when the user clicks on the button named "GoNext" in the loaded movie? I've tried several ways but I've had no luck. Could someone please point me in the right direction? This navigation panel is only one application of this sort of communication that I'll need in other parts of this type of lesson so I really need to figure out how to detect user interaction interaction with the loaded movie. Guess I need to know how to call a function in the parent movie from the loaded movie.
Thanks,
Peter H.