title: Flash AS3: (VideoEvent.COMPLETE, completePlay) - listener is triggered before video is completed
body: <p>I have a flash video using the standard FLV Playback component that comes with Flash. I'm using ActionScript 3 to modify the appearance and set up an event listener. I've set it up to go to a new URL using "externalInterface" when the video completes play. The URL is set in a variable using SWFObject.</p>
  
  <p>On only a few instances (3 people out of 50 - tested using Amazon Turk), people reported being taken directly to the new url, before the video even started playing. It's difficult to repeat the issue, but it did happen to me once. It doesn't have anything to do with cache, since it has been reported on people going to the url for the first time.</p>
  
  <p>Here's the url to the video: <a href="http://www.partstown.com/is-bin/INTERSHOP.enfinity/WFS/Reedy-PartsTown-Site/en_US/-/USD/ViewStaticPage-UnFramed?page=tourthetown" rel="nofollow noreferrer">http://www.partstown.com/is-bin/INTERSHOP.enfinity/WFS/Reedy-PartsTown-Site/en_US/-/USD/ViewStaticPage-UnFramed?page=tourthetown</a></p>
  
  <p>Here's the code:</p>
  
  <pre><code>import flash.external.*;
  import fl.video.*;
  var myVideo:FLVPlayback = new FLVPlayback();
  
  var theUrl:String = this.loaderInfo.parameters.urlName;
  var theScript:String = this.loaderInfo.parameters.scriptName;
  
  
  myVideo.source = this.loaderInfo.parameters.videoPath;//"partstown.flv";
  myVideo.skin = this.loaderInfo.parameters.skinPath;//"SkinUnderPlayStopSeekMuteVol.swf"
  myVideo.skinBackgroundColor = 0xAEBEFB;
  myVideo.skinBackgroundAlpha = 0.5;
  myVideo.width = 939;
  myVideo.height = 660;
  
  
  myVideo.addEventListener(VideoEvent.COMPLETE, completePlay);
  function completePlay(e:VideoEvent):void {
   myVideo.alpha=0.2;
   ExternalInterface.call(theScript);
  }
  
  
  addChild(myVideo);
  </code></pre>
  
  <p>Why would the listener be triggered before the event complete? How can I fix it?</p>
  
  <p>Thanks!</p>