Video scrubber jumps

I’ve created a simple video player. I set it up with a video scrubber so that (naturally) the scrubber moves with the progress of the video and you can drag it to move to a different part of the video.

My problem is that when I grab the scrubber and move it, then when I release it it jumps several pixels to the right before proceeding along with the video. The jump can be as little as one or two pixels or as large as 12 pixels.

Below is the part of the code that controls the scrubber’s position. pc is the mc that contains the scrubber, and pc.width is set to the same width as the video screen.


var nsStream:NetStream;
...
function updateDisplay(e:TimerEvent):void {   // runs constantly
	if (progScrubbing) {  // dragging the scrubber
		nsStream.seek(pc.scrubber.x * duration / pc.width);
	} else {  // scrubber follows video -- HERE SCRUBBER MAKES INITIAL "JUMP"
		pc.scrubber.x = nsStream.time * pc.width / duration;
	}
}
function mouseUpHandler(e:Event):void {  // MOUSE_UP handler
	progScrubbing = false;
}

I have set up tracing to isolate what is causing the jump and it seems to be nsStream. Meaning, nsStream.time seems to jump when the scrubber is released. I have no clue what causes this or how to fix it.

How do I make the scrubber stay put where it’s released?