1 Reply Latest reply on Jul 27, 2006 3:02 AM by pluap

    listenerObject.complete Help

    Psychomaze
      I have an object called my_video and it's on the stage with an instance name of my_video.
      quote:

      import mx.video.*;

      var connection_nc:NetConnection = new NetConnection();
      connection_nc.connect(null);
      var stream_ns:NetStream = new NetStream(connection_nc);

      my_video.attachVideo(stream_ns);
      stream_ns.setBufferTime(5);

      stream_ns.play("001.flv");
      var listenerObject:Object = new Object();
      // listen for complete event; play new FLV
      trace("outside"); //debug message 1
      listenerObject.complete = function(eventObject:Object):Void {
      trace("Complete"); //debug message 2 (DOES NOT SHOW UP)
      if (my_video.contentPath == "001.flv") {
      stream_ns.play("004.flv");
      }
      };
      my_video.addEventListener("complete", listenerObject);
      my_video.contentPath == "001.flv";
      trace("\noutside 2"); //debug message 3


      It plays 001.flv, and I get messages for outside the function but not the "Complete" message to tell it to switch to another video.

      Basically, I don't want any buttons or anything for it, I just want it to play one video and when it is complete, move on the other one. I am using Flash 8 Professional, and this is for a progressive download and the flv are already on the remote server but I still cannot get inside the "listenerObject.complete" status to go inside of the function to do more when the clip is finished. It is as if "import mx.video.*;" is not doing anything and it doesn't matter if I leave it there or comment it out.

      I've spent all morning searching through so many help sites and livedocs that my head is spinning right now.