I’m new to AS3 and I have no idea what I’m doing. I plan on getting a book and learning it, but for now I just need help with a problem that should be simple.
Overview: I have a flash movie on my web site that has navigation buttons, etc. It has a “Play Demo” button that I want to load a demo.swf movie and play over top of the original navigation flash movie. The demo movie will have a “Close Demo” button that will return you to the original movie with the navigation buttons. The demo.swf is rather large with sound. That is why I want to load it seperately.
I’ve managed to load the demo.swf as a child, but I can’t seem to remove it using a button that is contained within demo.swf. I’ve tried to hide it and I’ve even just made the close button navigate to a different page on my website which makes the original flash with navigation reappear. But it only works one time. When I click the play demo button again (adding another child), the close demo button no longer works. Any suggestions??
Here’s what I have in the parent movie:
playDemo_btn.addEventListener(MouseEvent.CLICK, playDemo);
function playDemo(e:MouseEvent):void
{
var loader:Loader = new Loader();
loader.load(new URLRequest("demo.swf"));
stage.addChild(loader);
}
How do I remove the child clip using a button inside the child clip?
Any help would be greatly appreciated. Thanks!