5 Replies Latest reply on Mar 4, 2009 4:45 PM by xtimedt69

    Unloading a .swf after an .flv plays

    xtimedt69
      Hello,

      I am a flash novice. I am using AS 2.0 for this job out of expediency.

      I am using an .swf file to play an .flv file, the video plays on top of an .html page, while it plays it blocks the links on the page. At the end of the .flv file, I would like the entire .swf to unload and clear the page so that the links are usable again.

      I have a button on the video that when clicked completely removes the entire .swf from the page.

      Here is the code to load the .flv (it is on frame one of the main movie applied to a "video" object):

      var my_nc:NetConnection = new NetConnection();
      my_nc.connect(null);
      var my_ns:NetStream = new NetStream(my_nc);
      my_video.attachVideo(my_ns);
      my_ns.setBufferTime(10);
      my_ns.play("johnlong.flv");
      my_ns.onStatus = function(info) {
      if (info.code == "NetStream.Buffer.Empty") {
      my_video.clear();
      }
      };

      Note that:

      my_ns.onStatus = function(info) {
      if (info.code == "NetStream.Buffer.Empty") {
      my_video.clear();

      Is supposed to clear the .flv but while it works locally it does not work on the server.

      Here is the code on the button:


      on (release) {

      //unload Movie Behavior
      if(this._parent == Number(this._parent)){
      unloadMovieNum(this._parent);
      } else {
      this._parent.unloadMovie();
      }
      //End Behavior

      }

      Is there a way to activate the unload button after the .flv finishes playing?

      Please be specific I am a code novice.

      Thank you,

      Dave