1 Reply Latest reply on Apr 29, 2007 8:45 PM by Scott S_DW

    Automatically closing a Flash Video

    billlamar
      I am currently working on a project for my Flash class and I have a media section where movies are selected from a menu and the video opens inside the same movie (beside the menu). I wanted to know if there was a way (through ActionScript) to have the movie automatically close when it is over, so the user can select another movie from the menu.
        • 1. Re: Automatically closing a Flash Video
          Scott S_DW
          create a listener that listens for the movie (videoPlayer in this script) to finish, and then unload the movie when it is called.


          stop();

          var listener:Object = new Object();
          listener.complete = function(evt:Object):Void {
          trace("Video complete");
          trace(evt.state);
          trace(evt.playheadTime);
          unloadMovie("_parent.blank_mc");
          }
          videoPlayer.addEventListener("complete", listener);

          hope this helps
          Scott