3 Replies Latest reply on Jun 9, 2006 6:15 PM by Newsgroup_User

    flv actionscript

    alexstl
      Below is code I am trying to use to go to a frame after the end of a flv file is reached. The video plays but the end of file listener does not work. Any help would be greatly appreciated.

      nc = new NetConnection();
      nc.connect(null);
      ns= new NetStream(nc);
      Ticatavid.attachVideo(ns);
      ns.play("ticata_0001.flv");

      stop();

      ns.addASCuePoint(2, "endOfMovie");

      var listenerObject bject = new Object();
      listenerObject.cuePoint = function(eventObject bject):Void {
      gotoAndPlay(2);
      }
      ns.addEventListener("cuePoint", listenerObject);
        • 1. Re: flv actionscript
          Level 7
          Use the onStatus callback instead:

          ns.onStatus = function(infoObject bject) {
          if (infoObject["code"] == "NetStream.Play.Stop") {
          //video has stopped... do stuff
          }
          };

          --
          Dave -
          Adobe Community Expert
          www.blurredistinction.com
          http://www.adobe.com/communities/experts/


          • 2. Re: flv actionscript
            alexstl Level 1
            Its still not working. Here is my code:

            nc = new NetConnection();
            nc.connect(null);
            ns= new NetStream(nc);
            Ticatavid.attachVideo(ns);
            ns.play("ticata_0001.flv");

            stop();

            ns.onStatus = function(infoObjectbject) {
            if (infoObject["code"] == "NetStream.Play.Stop") {
            gotoAndPlay(2);
            }
            }
            • 3. Re: flv actionscript
              Level 7


              Why not follow the example in the docs:

              http://livedocs.macromedia.com/flash/8/main/00002561.html


              --
              Lon Hosford
              www.lonhosford.com
              Flash, Actionscript and Flash Media Server examples:
              http://flashexamples.hosfordusa.com
              May many happy bits flow your way!
              "alexstl" <webforumsuser@macromedia.com> wrote in message
              news:e64ljt$pr2$1@forums.macromedia.com...
              Below is code I am trying to use to go to a frame after the end of a flv
              file
              is reached. The video plays but the end of file listener does not work. Any
              help would be greatly appreciated.

              nc = new NetConnection();
              nc.connect(null);
              ns= new NetStream(nc);
              Ticatavid.attachVideo(ns);
              ns.play("ticata_0001.flv");

              stop();

              ns.addASCuePoint(2, "endOfMovie");

              var listenerObject:Object = new Object();
              listenerObject.cuePoint = function(eventObject:Object):Void {
              gotoAndPlay(2);
              }
              ns.addEventListener("cuePoint", listenerObject);