0 Replies Latest reply on Apr 30, 2009 7:19 PM by Wonderwendy

    FLV to play and then pause?

    Wonderwendy

      Hello,

                I am using the videosourcepro code for a video player. What I would like to do is have the video play to a specific point and then pause. The code is as follows, opening up with the video playing and then the option of pressing the first button to play the same video

       

      var nc:NetConnection =new NetConnection();
      nc.connect(null);
      var ns:NetStream = new NetStream(nc);
      amyvideo.attachVideo(ns);
      ns.play("1.flv");
      // xml playlist
      // create an XMl object
      var vidList:XML = new XML();
      // ignore white spaces
      vidList.ignoreWhite = true;
      vidList.onLoad = function() {
      // put the nodes of xml into array
      var videoArray:Array = this.firstChild.childNodes;
      // iterate through video array
      // and add videos to the listbox
      for (var i = 0; i<videoArray.length; i++) {
      videoList.addItem(videoArray[i].attributes.desc, videoArray[i].attributes.url);
      }
      // when xml is loaded play first item
      ns.play(videoList.getItemAt(0).data);
      // highlight first video in listbox
      videoList.selectedIndex = 0;
      };
      // create a listener that responds
      // to changes in the listbox
      var vidListener:Object = new Object();
      vidListener.change = function() {
      // play the item selected in listbox
      ns.play(videoList.getItemAt(videoList.selectedIndex).data);
      };
      // register the event listener to listbox
      videoList.addEventListener("change", vidListener);
      // load xml file
      vidList.load("videos.xml");
      button1.onRelease = function(){
      ns.play("1.flv");
      gotoAndPlay(1);
      }

       

       

                          Thank you in advance,

                                                                   WonderWendy