|
SWiSH Forum Forum użytkowników programów SWiSH |
 |
Skrypty do programu SWiSH2 i SWISHmax - Problem z odliczaniem
przybor71 - Nie 12 Kwi, 2009 11:10 Temat postu: Problem z odliczaniem mam pytanie może Ktoś zobaczyc co źle zrobiłem w tym kodzie ma to być licznik czasu.
Kod: |
onFrame (1) {
now = new Date();
target_date = new Date (2008, 01 ,1);
diff = now.getTime() - target_date.getTime();
//trace("target: " + target_date.getTime() + " now: " + now.getTime() + " diff: " + diff);
yR = Math.floor((diff) / 1000 / 60 / 60 / 24);
dR = Math.floor((diff) / 1000 / 60 / 60 / 24);
hR = Math.floor((diff) / 1000 / 60 / 60 - (24 * dR));
mR = Math.floor((diff) / 1000 / 60 - (24 * 60 * dR) - (60 * hR));
sR = Math.ceil((diff) / 1000 - (24 * 60 * 60 * dR) - (60 * 60 * hR) - (60 * mR));
years_lata.text = yR;
days_remaining.text = dR;
hours_remaining.text = hR;
minutes_remaining.text = mR;
seconds_remaining.text = sR;
}
onFrame (2) {
prevFrameAndPlay();
} |
|
|