you just make the delay a number variable
put an mc on the stage and call it toggleDelay_mc and put this code on a frame
may i also suggest you use setTimeout instead of setInterval - it works like setInterval but setTimeout is only called once and does not therefore have to be cleared
Code:
var threeSecDelay:Boolean = false;
var delay:Number;
function moveAlong():Void {
//play();
trace("delay = "+delay);
}
toggleDelay_mc.onRelease = function() {
trace("pressed");
threeSecDelay = !threeSecDelay;
if (threeSecDelay) {
delay = 3000;
} else {
delay = 6000;
}
setTimeout(moveAlong, delay);
};
this line
threeSecDelay = !threeSecDelay;
toggles the boolean - threeSecDelay