I have successfully implemented a seek/slider bar into my Flash (Professional) 8 movie, but I’m haivng a small problem with it.
On the stage, I have Movie Clip (instance name: MovieF) as well as this slider to control where you are in the MovieF clip. It let’s you scroll back and forth during the animation, but unfortunately the dragger (the thing that indicates where you are on the seekbar timeline) does not move with the animation. From the start, it stays fixed. You can move it around with the mouse but, of course, when you release it, it stays where you left it instead of moving to the right side of the bar.
My code is pasted below. Does anyone know what I can add to this to make the drager move along the bar at the same rate as the placed movie clip?
I can upload the current state of this animation somewhere if that would help. I’d really appreciate any help. I’ve been looking all over for days on how to accomplish this. Thanks.
Here’s my code (Note that MovieF is the name of the placed movie clip the bar is controlling):
var interval:Number = bar._width/MovieF._totalframes;
var frame:Number = 0;
MovieF.play();
dragger.onPress = function() {
this.startDrag(false, bar._x, bar._y+bar._height/2, bar._x+bar._width, bar._y+bar._height/2);
this.onEnterFrame = function() {
frame = dragger._x-bar._x;
MovieF.gotoAndPlay(Math.ceil(frame/interval));
};
};
dragger.onRelease = dragger.onReleaseOutside=function () {
this.stopDrag();
delete this.onEnterFrame;
};