|
SWiSH Forum Forum użytkowników programów SWiSH |
 |
SWiSH Max - Cykl daty
vanioch - Sob 15 Paź, 2011 15:49 Temat postu: Cykl daty Witam, wykorzystując wbudowany countdown chciałem osiągnąć taki efekt: do daty docelowej zostało mniej niż 10 dni, więc uaktualniam datę docelową o 3 lata do przodu.
Pod buttonem taki kod niestety w polu tekst wyświetla się cały czas 2 dni do końca a data docelowa się nieuaktualnia:
Kod: |
onFrame (1) {
var now: Object = new Date();
var target_date: Object = new Date (2011, 9, 18);
var diff: Number = target_date.getTime() - now.getTime(); //różnica 2 dni
var dR: Number = Math.floor((diff) / 1000 / 60 / 60 / 24);
if (dR<10){
target_date=target_date.getFullYear()+3;
_root.days_remaining.text = dR;
}
else
{_root.menu.clapo.days_remaining.text = dR;}
}
onFrame (2) {
prevFrameAndPlay();
} |
[ Dodano: Sro 19 Paź, 2011 09:35 ]
Pomoże ktoś?
|
|