title: Loading multiple external swf and navigate using buttons on child
body: <p>I'm trying to load and unload many external swf files into main blank swf. And use navigation buttons (next/back) that located on the externally loaded child pages to navigate (load and unload pages).</p>
  
  <p>I tried to dispatch event from child to main to unload. It works fine only with the first page, as the dispatcher is bubbling only once.</p>
  
  <p>I have a default page to be loaded and dispatcher listener at the main swf as follows:</p>
  
  <pre><code>var cont:Sprite= new Sprite();
  
  var swfLoader:Loader = new Loader();
  
  var swfFile:URLRequest = new URLRequest("Page1.swf"); //default page
  
  addChild(cont);
  
  swfLoader.load(swfFile);
  
  cont.addChild(swfLoader);
  
  
  swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, swfLoadedHandler);
  
  function swfLoadedHandler(event:Event):void {
  
  MovieClip(event.currentTarget.content).addEventListener("eventTriggered", removeLoader);
  
  }
  
  
  function removeLoader(event:Event):void {
  
  SoundMixer.stopAll();
  this.swfLoader.unloadAndStop();
  this.removeChild(cont);
  this.cont = null;
  
  
  swfLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE, swfLoadedHandler);
  
  trace ("dispatched");
  
  }
  </code></pre>
  
  <p>Also the next button code on child page1.swf is as follwos:</p>
  
  <pre><code>nxt_pg.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_8);
  
  function fl_MouseClickHandler_8(event:MouseEvent):void {
  
  content_mc.gotoAndStop(1);
  
  dispatchEvent(new Event("eventTriggered", true));
  
  SoundMixer.stopAll();
  
  //Code of Loading new page here
  }
  </code></pre>
  
  <p>And the same code for back button.</p>
  
  <p>So, I wonder if anyone could help me with code or better technique..Thanks in advance fore your help.</p>