J'ai fais une petite modif de manière a ce que l'aiguille des heures avance en même temps que celle des minutes.
clocks.digitalClock.autoSize = true;
clocks.digitalClock._visible = false;
clocks.onEnterFrame = function() {
var now = new Date();
var hourPart = (now.getHours()* 60)+now.getMinutes();
var minutesPart = now.getMinutes();
var secondsPart = now.getSeconds();
if (now.getHours() > 11){
// hourPart = hourPart - 12;
}
if (now.getHours() == 0){
// hourPart = 12;
}
with(this.analogClock){
minutes._rotation = (minutesPart / 60) * 360;
hour._rotation = (hourPart/720) * 360;
seconds._rotation = (secondsPart / 60) * 360;
}
if (hourPart < 10)
hourPart = "0" + String(hourPart);
if (minutesPart < 10)
minutesPart = "0" + String(minutesPart);
if (secondsPart < 10)
secondsPart = "0" + String(secondsPart);
this.digitalClock.text = hourPart + ":" + minutesPart + ":" + secondsPart;
}
s = new Object();
s.onKeyDown = function(){
if(Key.isDown(83)){
_root.clocks.analogClock._visible = !_root.clocks.analogClock._visible;
_root.clocks.digitalClock._visible = !_root.clocks.digitalClock._visible;
}
}
Key.addListener(s);
Réduire