Logic behind the error??
it's countdown clock.
at start loads time begin countdown. countdwon continues until condition1 false. while condition1 false, if button15 clicked countdown should continue left.
my question when button15 clicked, countdown not continue left? continues _root.onenterframe = countdown; has kept on going while conditiona false?? how make countdown clock continue condition1 false?
?
var start_datefixed:date = new date();
var start_milfixed:number = start_datefixed.gettime();
var start_secondsfixed:number = start_milfixed/1000;
sndload.sendandload("http://www.web.com/the.php",rscload,"post");
recload.ondata = function(src) {
var a:array=src.split(",,");
var bcountdown = math.floor(60 - a[0]);
timerem.text = math.floor((bcountdown) + (start_secondsfixed));
_root.onenterframe = countdown;
}
function countdown(){
if (conditiona == true) {
var bringtimesrt = timerem.text;
var start_date:date = new date();
var start_mil:number = start_date.gettime();
var start_seconds:number = start_mil/1000;
var remtime = bringtimesrt - start_seconds;
var sec = math.floor(remtime);
var min = math.floor(sec/60);
var hrs = math.floor(min/60);
sec = string(sec % 60);
if(sec.length < 2) {
sec = "0" + sec;
}
min = string(min % 60);
if(min.length < 2) {
min = "0" + min;
}
hrs = string(hrs % 24);
if(hrs.length < 2) {
hrs = "0" + hrs;
}
var theremperiod:string = hrs + " : " + min + " : " + sec;
cntdwnclock.text = theremperiod;
}
}
function newfunction() {
if (condition1==true) {
conditiona
}
}
triggerconditiona = setinterval(newfunction, 2000);
button15.onrelease = function () { // not contine stopped?
var start_datefixed:date = new date();
var start_milfixed:number = start_datefixed.gettime();
var start_secondsfixed:number = start_milfixed/1000;
timerem.text="";
sndload.sendandload("http://www.web.com/the.php",rscload,"post");
}
what of code show supposed stopping countdown?
your problem might have using date class acquire values, though cannot sure. if relying on might updating current time rather picking previous value.
More discussions in ActionScript 1 and 2
adobe
Comments
Post a Comment