PDA

View Full Version : help with scrubber for FLV


gsinibaldi
11-17-2005, 08:58 PM
Hi,

I'm messing with the dynamic video playlist toot from MM. I have the thing working and am trying to add some controls, specifically a scrub bar.

Heres my code (does not work)
//scrubber
createEmptyMovieClip("vFrame",getNextHighestDepth());
vFrame.onEnterFrame = videoStatus;
var amountLoaded:Number;
var duration:Number;

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

function videoStatus() {
amountLoaded = ns.bytesLoaded / ns.bytesTotal;
loader_mc.loadbar_mc._width = amountLoaded * 239.5;
loader_mc.scrub_mc._x = ns.time / duration * 239.5;
}

loader_mc.scrub_mc.onPress = function() {
vFrame.onEnterFrame = scrubit;
loader_mc.scrub_mc.startDrag(false,0,this._y,239,t his._y);
}

loader_mc.scrub_mc.onRelease = loader_mc.scrub_mc.onReleaseOutside = function() {
vFrame.onEnterFrame = videoStatus;
loader_mc.scrub_mc.stopDrag();
}

function scrubit() {
ns.seek(Math.floor((loader_mc.scrub_mc._x/239)*duration));
}

For some reason the scrubber isint getting the info from the netStream object(ns). What am I missing?

Thanks for any help

Greg