Hi, if anyone could help with this it would be great. I’m using AS2 with CS3 and flash player 9.
I’m making some video tutorials, you select the title of the tutorial in the file, it loads the relevant tutorial SWF up into an MC.
I’ve made a slider where you can change the speed of the MC. I’ve used setInterval to do this. The slider sends a global value “tutorialSpeed” to the MC. Everything works great until you load a new tutorial into the MC, everytime a new video is loaded it just gets quicker and quicker and quicker even though the same “tutorialSpeed” value is being sent. I assume it’s something to do with the first line of code being executed many times?
The following code does everything, it’s positioned on the first frame of each tutorial SWF
var intervalID:Number = setInterval(this, "advanceFrame", tutorialSpeed);
stop();
//
function advanceFrame() {
clearInterval(intervalID);
gotoAndStop(_currentframe+1);
intervalID = setInterval(this, "advanceFrame", tutorialSpeed);
trace(intervalID);
}