as3 CountDown
Samedi 8 août 2009Réaliser un compte a rebours facilement avec as3.
Nous aurons besoin un champ de texte pour afficher la date, un timer et la classe CountDown de Kazuma Ieiri.
code as 3
import flash.utils.Timer; import flash.events.TimerEvent; import jp.hbkr.baka.CountDown; var timer:Timer = new Timer(1000); var a:Array; timer.addEventListener(TimerEvent.TIMER, tick); timer.start(); function tick(event:TimerEvent):void { a = CountDown.getCountDown(2010, 1, 1, 12, 0, 0); timerContentTXT.text = a[0]+" Jours "+a[1]+" H " + a[2] + " mn et " + a[3]+"s"; }
Télécharger la source ici CountDown (119)





