MovieClip.prototype.play2 = function(direction, playback, begin, end, callback, clips) {
var o = this;
playback = (playback == undefined) ? (1000/24) : playback;
end = (end == undefined) ? function() {return o._totalframes} : end;
begin = (begin == undefined) ? 1 : begin;
if (clips == undefined) {
o.gotoAndStop(begin);
o.curFrame = o._currentframe;
} else {
var len = clips.length;
for (var n = 0; n<len; n++) {
o[clips[n]].gotoAndStop(begin);
o[clips[n]].curFrame = o[clips[n]]._currentframe;
}
}
_global["id"+o._name] = setInterval(function () {
if (clips == undefined) {
o.curFrame += direction;
o.gotoAndStop(o.curFrame);
if (o.curFrame == end) {
clearInterval(_global["id"+o._name]);
delete (o.curFrame);
callback(o);
}
} else {
for (var n = 0; n<len; n++) {
o[clips[n]].curFrame += direction;
o[clips[n]].gotoAndStop(o[clips[n]].curFrame);
}
if (o[clips[0]].curFrame == end) {
clearInterval(_global["id"+o._name]);
for (var n = 0; n<=len; n++) {
delete (o[clips[n]].curFrame);
}
callback(o);
}
}
}, playback);
};
This is a great prototype for specific play needs. But how do I stop it??? The usual commands does not seem to work. Any ideas are very welcome. I am not a total newbie, but almost :glasses:
Give it a try and you will see!