Hey guys,
I am having trouble getting my seek bar for the flv player I made.
This is the code I have right now...it's just the onEnterFrame function that needs to convert the correct time from wherever the seek_mc is in relation to the loaded bar...but I figure this will give me problems, so I will make a bar the length of how long the loaded bar will get to and read from that, but I just need to convert the percentage to time?
Code:
// slide actions
controls.seek_mc.onPress = function() {
this.dragging = true;
this.startDrag(false, loadBar._x, this._y, loadBar._x+loadBar._width, this._y);
};
controls.seek_mc.onRelease = function() {
this.dragging = false;
stream_ns.seek(this.seekTime);
this.stopDrag();
};
controls.seek_mc.onReleaseOutside = function() {
this.dragging = false;
stream_ns.seek(this.seekTime);
this.stopDrag();
};
controls.seek_mc.onEnterFrame = function() {
var dist = Math.floor((stream_ns.time / duration) * 100);
this.seekTime = Math.floor((dist / controls.loadBar._width) * 100);
//trace(this.seekTime);
//trace(dist);
};