PDA

View Full Version : Flash FLV Player



afroman
03-24-2007, 04:31 PM
Hi, i followed a tutorial on how to create a flash FLV player using A/S. The player is working ok, but the problem i have is when i had the codes for the progress bar and the scrubber, they dont seem to work. The progress bar does not move at all, while the scruber start moving from the middle of the display. Can anybody help me with this. By the way i am using Flash 8. I dont know if that makes any difference, but the tutorial was base on Mx.

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

var stream_ns:NetStream = new NetStream(connection_nc);

theVideo.attachVideo (stream_ns);

stream_ns.play("Club_01.flv");

myPlayVidBtn.onRelease = function() {
stream_ns.pause();
}

myRewindVidBtn.onRelease = function() {
stream_ns.seek(0);
}

var videoInterval = setInterval(videoStatus,100);
var amountLoaded:Number;
var duration:Number;

stream_ns["onMetaData"] = function(obj) {
duration = obj.duration;
}


function videoStatus() {
amountLoaded = stream_ns.bytesLoaded / stream_ns.bytesTotal;
myLoader.myLoaderBar._width = amountLoaded * 220;
myLoader.myScrub._x = stream_ns.time / duration * 220;
}


Any help would be appreciated