Reversing frames on button release

A quick copy&past from some code I posted on another forum. So just ignore the Dutch comments :stuck_out_tongue: Should help you a bit. Demo here: http://www.henxcom.com/mediamonkey/flashfiles/playfuncties.html

[AS]// dit moet je zelf goed invullen!!!
var fps = 30;

// vervangt de standaard play() van een movieclip
function playForward(mc) {
clean(mc);
mc.play();
}

// functie om terug af te spelen.
function playBackward(mc, halt) {
mc.onEnterFrame = function() {
if (this._currentframe == 1) {
(halt) ? delete this.onEnterFrame : this.gotoAndStop(this._totalframes);
}
clearInterval(_root.ff);
clearInterval(_root.fb);
this.prevFrame();
}
}

// “stopt” (pauzeert) de mc/swf
function pauze(mc) {
clean(mc);
mc.stop();
}

// stopt de mc echt, en gaat terug naar het 1e frame
function stoppen(mc) {
clean(mc);
mc.gotoAndStop(1);
}

// deze functie speelt de mc versneld af
// gebruik ‘speed’ als factor: bv 2 voor 2x zo snel, of 0.5 voor de helft zo snel
// gebruik ‘halt’ als boolean om de animatie wel of niet te loopen
function fastForward(mc, speed, halt) {
clean(mc);
var time = 1000/fps/speed;
ff = setInterval( function() {
mc.nextFrame();
if (mc._currentframe == mc._totalframes) {
(halt) ? clearInterval(ff) : mc.gotoAndStop(1);
}
}, time);
}

// deze functie speelt de mc versneld terug af
// gebruik ‘speed’ als factor: bv 2 voor 2x zo snel, of 0.5 voor de helft zo snel
// gebruik ‘halt’ als boolean om de animatie wel of niet te loopen
function fastBackward(mc, speed, halt) {
clean(mc);
var time = 1000/fps/speed;
fb = setInterval( function() {
mc.prevFrame();
if (mc._currentframe == 1) {
(halt) ? clearInterval(fb) : mc.gotoAndStop(mc._totalframes);
}
}, time);
}

// verwijdert alle intervallen en de onEnterFrame, als die wordt gebruikt
function clean(mc) {
if (mc.onEnterFrame) mc.onEnterFrame = null;
if (ff) clearInterval(ff);
if (fb) clearInterval(fb);
}

// Als je die interval geen mooie oplossing vind kun je ook een
// functie bedenken die berekent op welke frame de mc/swf moet staan
// en er direct naar verwijst.[/AS]