title: AS3 maintime delay script while external swf loads and plays
body: <p>I'm having an issue with playing an external SWFs inside the main SWF. Everything loads great, except not on cue. I'm using a simple delay actionscript to pause the main timeline until the external SWFs load, but it doesn't always sync up when testing in browsers.</p>
  
  <p>Is there an AS3 code that I can use to pause the main timeline until the external SWF is finish loading and playing?
  I need to do this multiple times through the movie, btw...</p>
  
  <p>Below is the delay and the <code>loadmovie</code> array I'm using.</p>
  
  <pre><code>&lt;--------------//Timer//---------------&gt;
  
  var timer4:Timer = new Timer(1500, 1);
  timer4.addEventListener(
    TimerEvent.TIMER,
    function(evt:TimerEvent):void {
      play();
    }
  );
  timer4.start();
  
  
  
  
  &lt;--------------//loadMovie//---------------&gt;
  
  function startLoad()
  {
      var mLoader:Loader = new Loader();
      var mRequest:URLRequest = new URLRequest('flip/note_flip.swf');
      mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
      mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);
      mLoader.load(mRequest);
  }
  
  function onCompleteHandler(loadEvent:Event)
  {
          addChild(loadEvent.currentTarget.content);
  }
  
  function onProgressHandler(mProgress:ProgressEvent)
  {
      var percent:Number = mProgress.bytesLoaded/mProgress.bytesTotal;
      trace(percent);
  }
  
  startLoad();
  </code></pre>