Well I was just sitting here looking through some of the tuts, when all of a sudden I just “saw” the easiest way to make an analog clock! =)
Wasn’t really thinking about it, it just came outta nowhere… scary… :-\
see, just make your, umm… uhh… the stick that shows the position… say noon (12 AM) make it point upwards, fiddle with the center of it, and throw it into some sorta clock thingy circle (make suer u name the instance, I called mine “showsec”)… u know what I mean…
then have two frames on your main stage, make an “actions” layer, with frame 2 having a “gotoandplay 1”. THEN, simply type in this for frame 1: (using seconds here)
mytime = new date();
seconds = mytime.getseconds();
setProperty("_root.showsec", _rotation, sec*6);
and that’s it!! =)
For minutes just alter the variable “seconds” to: mytime.getminutes()
heres the code for the hour show… here I just called the “mytime=.gethours()” for “hour2”
I added the “((minute/60)*30))” so we’d get the numbers between the hours aswell, otherwise it would stay on one hour number until it changed… that would then be an hour… before it changes… get it? This way it updates with every minute-shift…
Nice, Eilsoe (nice name!), but as a matter of fact, we already had a tute about that on this site Anyway, there’s another way to do that with setInterval but it’s a bit more complicated.