Hi,
I am using this great code made by Kenneth Andersson.
I have been trying to add a stop start button.
Any ideas would be great.
Thanks
Code://First we need a dynamic textfield with instance name "theText", check. //Then we set the total number of minutes. I picked 64 to reduce the //result-view-waiting-time. 119 would just be... boring. total = 45; //Calculate the var total and update the textfield. this.onEnterFrame = function() { minutes = Math.floor(total/60); seconds = total%60; theText.text = "0"+minutes+":"+seconds; if (seconds<=9) { theText.text = "0"+minutes+":"+"0"+seconds; } }; //Function for the countdown, can be changed to total++ if you want to //count "into the future" or something. Well I dunno. //clearInterval = When minutes and seconds is 00:00 it stops. counter = function () { total--; if (minutes == 0 & seconds == 1) { clearInterval(setIt); } if (total == 30) { warning.text="Warning, times almost up!"; gotoAndPlay(_currentframe+1); } if (total == 00) { gotoAndPlay(_currentframe+1) } }; //Then we start an interval with the counter function, 1000 is milliseconds á 1 sec. setIt = setInterval(this, "counter", 1000); stop();




Reply With Quote