Log in

View Full Version : SetInterval and so.addVariable



slyredfox
07-03-2007, 11:26 AM
Hi, I recently did a project and I couldn't figure this part out (I'm still a newb to actionscript programming). I have this code ...

clearInterval(nDelayID);
stop();
var nDelayID:Number = setInterval(this, "pause", 4000);
// where 4000 is 4000 milliseconds
function pause():Void {
clearInterval(nDelayID);
play();
// or nextFrame();
}

I want to provide the control (to set the pause outside of Flash) ... Basically, I want to add ...

so.addVariable("pause", "4000");

But, I know I need to re-code both the SetInterval and So.AddVariable - I don't know how to do it. Any help showig me the change and explainig what you did (so, I learn it) would be appreciated. TY.

Medyman
07-03-2007, 07:25 PM
http://www.permadi.com/tutorial/flashVars/
http://www.tripleaxis.com/blog/?p=80

Let me know if you have any questions. :)