PDA

View Full Version : making my clock into analogue??


Crapatscript
03-20-2002, 04:20 PM
ok, so your making the time tut was pretty easy and understandable.. but i'm haveing trouble making it into analoge...

what i tried was to add this code in the moain action script:

mydate = new date();
time = (mydate.getHours()+":"+myDate.getMinutes()+":"+myDate.getSeconds());
hand.gotoAndStop(time);

to try and force my movie clip forward a frame every second in the way that percentage loaders forcer the bar forward...

it didn't work... know why or am i doing it completely wrong??

mad_A
03-20-2002, 04:32 PM
A couple of things...

You would be better off having more than one hand - otherwise you will need 43,200 frames in your movie!!!!

The reesult for time as you have it coded will be 17:14:35 (well that format). So, are your frames named that way?

I would suggest you have 3 movies, one for each hand (hour, mins, seconds).
Then you could have 12 frames in the hour one, 60 in the mins, and 60 seconds.

To change you would stick a clip event with code in it like this-
mydate = new date();
hour = (mydate.getHours();
min=myDate.getMinutes();
sec=myDate.getSeconds();
hourhand.gotoAndStop(hour);
minhand.gotoAndStop(min);
sechand.gotoAndStop(sec);

That will work. Just be sure to have a clip event, or movie checker so that it constantly updates,

A

Crapatscript
03-20-2002, 04:50 PM
i think you now think i'm an idiot, lol

i was actually planning on having there movies, one for each hand, only reason i have one right now was for the purpose of trying to get the seconds to work...

but the seperate variables makes sense and i should definately have seen that coming...

thanx for the help, i appreciate it..