How To Make Flash Continuously Play?
I have a countdown timer and a click counter and I don't want for either of those to reset if the page were closed / refreshed. What I want is that once the timer and click counter start, nothing will interupt them. But the problem is that if i simply go to another page and back it resets everything. Can anyone help with this? Here is my code...
var numOfDays=30;
var total_time=numOfDays*24*60*60
var timer:Timer=new Timer(1000,total_time);
timer.addEventListener(TimerEvent.TIMER,onTimerRuns)
timer.start();
function onTimerRuns(e:TimerEvent=null)
{
var sec=total_time-timer.currentCount;
sectxt.text=String(sec%60);
var min=Math.floor(sec/60);
mintxt.text=String(min%60);
var hour=Math.floor(min/60);
hrtxt.text=String(hour%24);
var day=Math.floor(hour/24);
daytxt.text=String(day);
}
onTimerRuns();
var clicks:Number=0;
bidbutton.addEventListener(MouseEvent.CLICK,addTime);
function addTime(e:MouseEvent):void
{
total_time += 30;
clicks+=.01;
price.text=formatF(clicks);
}
function formatF(n:Number):String
{
n = Math.round(n*100)/100;
var s:String = n.toString();
if(s.indexOf(".")==-1)
{s=s+".";}
var n = s.split(".")[0];
var f:String = s.split(".")[1].toString();
while(f.length<2)
{f=f+"0";}
return n+"."+f;
}
