3 Replies Latest reply on Apr 4, 2011 1:16 PM by kglad

    Close Window When MP3 Ends Play

    reknball

      I'm trying to create a webpage that will close itself when an mp3 audio file finishes playing.  Right now I'm trying to do this simply by playing the mp3 from a keyframe in the timeline as an event.  On the timeline I've placed a blank keyframe with an ActionScript attached to it that looks like this:

      import flash.external.ExternalInterface
      ExternalInterface.call("closeWindow");
      stop();

       

      The HTML page that embeds the Flash running the mp3 has a Javascript function called closeWindow that looks like this:

      <script language="JavaScript">
      function closeWindow(){window.close();}
      </script>

       

      Very simple very easy.  But WHY DOESNT THIS WORK?  The ExternalInterface call should fire off the Jscript on the HTML but it's not doing it.

      Any suggestions out there?