Avatar billede torni38 Nybegynder
04. februar 2010 - 21:04 Der er 1 kommentar og
1 løsning

countdown

//Minute countdowner (Minutnedräknaren)
//By Kenneth Andersson aka Kenzilla, 2006.
//Use it however you like.
//
//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 = 900;
//Calculate the var total and update the textfield.
this.onEnterFrame = function() {
    minutes = Math.floor(total/60);
    seconds = total%60;
    if (seconds<=9 && minutes<=9) {
        theText.text = "0"+minutes+":"+"0"+seconds;
    } else if (seconds<=9) {
        theText.text = minutes+":"+"0"+seconds;
    } else if (minutes<=9) {
        theText.text = "0"+minutes+":"+seconds;
    } else {
        theText.text = minutes+":"+seconds;
Hej eksperter

hvorfor kan jeg ikke få den her til at virke i flah 4



    }
};
//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);
    }
};
//Then we start an interval with the counter function, 1000 is milliseconds á 1 sec.
setIt = setInterval(this, "counter", 1000);
Avatar billede torni38 Nybegynder
04. februar 2010 - 22:29 #1
Hej eksperter

hvorfor kan jeg ikke få den her til at virke i flah 4

//Minute countdowner (Minutnedräknaren)
//By Kenneth Andersson aka Kenzilla, 2006.
//Use it however you like.
//
//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 = 900;
//Calculate the var total and update the textfield.
this.onEnterFrame = function() {
    minutes = Math.floor(total/60);
    seconds = total%60;
    if (seconds<=9 && minutes<=9) {
        theText.text = "0"+minutes+":"+"0"+seconds;
    } else if (seconds<=9) {
        theText.text = minutes+":"+"0"+seconds;
    } else if (minutes<=9) {
        theText.text = "0"+minutes+":"+seconds;
    } else {
        theText.text = minutes+":"+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);
    }
};
//Then we start an interval with the counter function, 1000 is milliseconds á 1 sec.
setIt = setInterval(this, "counter", 1000);
Avatar billede torni38 Nybegynder
20. juni 2014 - 13:39 #2
Lukker
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
IT-kurser om Microsoft 365, sikkerhed, personlig vækst, udvikling, digital markedsføring, grafisk design, SAP og forretningsanalyse.

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester