PDA

View Full Version : seekbar


thephorc
06-16-2008, 01:56 PM
can someone please tell me where to find a seekbar script.. i could only find one for AS2 ..but the startDrag() completely changed in AS3

AS2:

dragging = false;
bar.dragger.onPress = function ()
{
startDrag (this, false, 0, 0, bar.strip._width, 0);
dragging = true;
}
bar.dragger.onRelease = bar.dragger.onReleaseOutside = function ()
{
stopDrag ();
dragging = false;
snd.stop ();
song_pos = this._x;
song_dur = snd.totalTime;
newPosition = (song_pos * song_dur) / bar.strip._width;
snd.play (newPosition);
}
onEnterFrame = function ()
{
if (!dragging) {bar.dragger._x = (snd.playheadTime / snd.totalTime) * bar.strip._width;}
}


AS3:


var dragging:Boolean = false;

bar.dragger.addEventListener(MouseEvent.MOUSE_DOWN , moveDragger);
bar.dragger.addEventListener(MouseEvent.MOUSE_UP, stopDragger);


thats how far i got lol..

do i have to import packages in AS3? ie, import flash.geom.Rectangle;?

anyway ..if someone knows where i can find a script ..id really appreciate that