1 Reply Latest reply on Sep 10, 2006 6:04 AM by lus29

    Flash dynamic video player

    dle_240
      I made a flash player that players FLV videos dynamicly. The only problem is when I try to make the controls they don't work. Can someone please help me? Here is the actionscript....

      // initialize net connection and stream
      var netConn:NetConnection = new NetConnection();
      netConn.connect(null);
      var netStream:NetStream = new NetStream(netConn);
      myVideo.attachVideo(netStream);
      netStream.play(url);
      //
      //
      //hide the standard menu-items for right click menu
      my_cm = new ContextMenu();
      //hide the standard menu-items for that object
      my_cm.hideBuiltInItems();
      my_cm.customItems.push(menuItem_cmi);
      function onPause(obj, menuItem) {
      trace("You choose: "+menuItem.caption);
      }
      _root.menu = my_cm;

      myVideo.playButton= play_btn;
      myVideo.pauseButton= pause_btn;
      myVideo.backButton= rewind_btn;
      myVideo.playButton= play_btn;
        • 1. Re: Flash dynamic video player
          lus29
          var connection_nc:NetConnection = new NetConnection();
          connection_nc.connect(null); //This parameter tells the Flash Player that the FLV content will be streamed over HTTP, not RTMP.
          var stream_ns:NetStream = new NetStream(connection_nc);

          var my_video:Video;
          my_video.attachVideo(stream_ns);
          stream_ns.play("VTS_01_1.flv");

          play_btn.onRelease = function() {

          stream_ns.pause(false);

          };

          pause_btn.onRelease = function() {

          stream_ns.pause();

          };

          stop_btn.onRelease = function() {

          stream_ns.seek(0);

          stream_ns.pause(true);

          };



          this.onEnterFrame = function():Void {
          tTime.text = stream_ns.time.toString() + " sec";
          };