Ecriture du script

Dans le bouton date:
on (release){
now = new Date()
joursemaine = now.getDay()
jourmois = now.getDate()
switch (joursemaine){
case 0: joursemaine = "Dimanche" ; break
case 1: joursemaine = "Lundi" ; break
case 2: joursemaine = "Mardi" ; break
case 3: joursemaine = "Mercredi" ; break
case 4: joursemaine = "Jeudi" ; break
case 5: joursemaine = "Vendredi" ; break
case 6: joursemaine = "Samedi" ; break
}
mois = now.getMonth() + 1
an = now.getYear() - 100 + 2000
an = joursemaine + ":" + jourmois + ":" + mois + ":" + an
_root.texte.text = an
}

Dans le bouton heure:
on (release){
now = new Date()
heure = now.getHours()
minute = now.getMinutes()
seconde = now.getSeconds()
if(seconde<10) seconde="0" + seconde
if(minute<10) minute="0" + minute
heure = heure + ":" + minute + ":" + seconde
_root.texte.text = heure
}

Programme source : date_heure.fla | Programme objet : date_heure.swf