Skip to main content
Participant
September 9, 2006
Question

Flash dynamic video player

  • September 9, 2006
  • 1 reply
  • 167 views
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;
This topic has been closed for replies.

1 reply

September 10, 2006
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";
};