PDA

View Full Version : Animated clock


Steel Rat
09-03-2002, 02:51 PM
Hi, im trying to make an animated clock, ie the numbers morph when they change.

I've made the numbers animation (both as one long stream and seperate numbers) but i cant get them to change properly time.

I can make them change with the time using a tell target action but they just jump and dont show the full animation, does anyone have any ideas of another way of doing it or how to make the tell target work properly??

sfa
09-04-2002, 07:28 AM
In the gotoAndPlay bit, you are telling it to go to the wring frame, just try tracing the numbers and tweaking the formula.

SFA

Steel Rat
09-04-2002, 11:44 AM
It's the right frame, it just dosent play it from where i tell it to, it just shows the 1 frame! :confused:

sfa
09-04-2002, 11:53 AM
Are you sure because when I tried doing adding or subtracting in the gotoAndPlay part I saw some animation.

SFA

sfa
09-04-2002, 11:57 AM
I checked again, you where right, I will keep looking into it.

SFA

Steel Rat
09-05-2002, 07:30 AM
Thanks :)

M0nk3y Sy
09-05-2002, 08:29 AM
Your movie is 25 frames a second, but the code you are using to check the time and set the numbers is over 2 frames, so it's checking the time more than once a second and doesn't play the animation because it keeps getting set back to the first frame of each animation.

to see what I mean just add 23 frames between:


//first frame
newDate = new Date();
Hours = newDate.getHours();
Minutes = newDate.getMinutes();
Seconds = newDate.getSeconds();
with (S) {
gotoAndPlay(((Seconds-1)*10)+(2*Seconds));
}
with (M) {
gotoAndPlay(((Minutes-1)*10)+(2*Minutes));
}
with (H) {
gotoAndPlay(((Hours-1)*10)+(2*Hours));
}
//add spacer frames
//frame 25
gotoAndPlay(1);


Sy

Steel Rat
09-05-2002, 04:17 PM
Genius, all seems so obvious now. Thanks alot