Hi All
I am developing an application to display different time zones. Class works fine only once, later it fails to update the movie with dials of clock. I not sure what could be the issue, I am using delegates as methods weren’t called previously.
import mx.utils.Delegate;
//
class ClockEngine {
var sec:Date;
var ts:Number;
var clock_mc:MovieClip;
//
function ClockEngine (mc:MovieClip, timeofset) {
clock_mc = mc;
ts = timeofset;
var localTime:Date = new Date ();
sec = new Date ();
animate();
}
function animate()
{
setInterval(Delegate.create (this, init), 1000);
}
public function init ():Void {
///
var hours:Number = (Math.round (ts)*60)/60;
var minutes:Number = Math.abs (Math.round (ts)-ts)*100;
var seconds:Number = sec.getSeconds ();
hours += sec.getUTCHours ();
minutes += sec.getUTCMinutes ();
trace (ts+" "+hours+" "+minutes+" "+seconds);
trace("---------------------------------------------");
///
clock_mc.secondHand_mc._rotation = seconds*6;
clock_mc.minuteHand_mc._rotation = minutes*6;
clock_mc.hourHand_mc._rotation = (hours)*30+(Math.round ((minutes*6)/12));
clock_mc.hourHand_mc.showTime_txt.text= "hello";
}
}
I noticed in the trace seconds value doesn’t seem to change, neither does minutes. Values in red are seconds.
5.3 10 59 [COLOR=Red]50[/COLOR]
---------------------------------------------
5.3 10 59 [COLOR=Red]50[/COLOR]
---------------------------------------------
5.3 10 59 [COLOR=Red]50[/COLOR]
---------------------------------------------
5.3 10 59 [COLOR=Red]50[/COLOR]
---------------------------------------------
5.3 10 59 [COLOR=Red]50[/COLOR]
---------------------------------------------
I am new to using classes.
Thanks