FORUMS: list search recent posts

time of day: switch out animation

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Crystal Coffelt
time of day: switch out animation
on Mar 28, 2009 at 5:28:57 am

I have a job where the client wants to switch an animation (movieclip) on the stage between the times of 10 a.m. and 12p.m. EST then the off time will just revert back to the original animation.

Can someone point me in the right direction, link to a tutorial? I've never done this before.


Return to posts index

Graham Quince
Re: time of day: switch out animation - AS2 option
on Mar 28, 2009 at 6:32:19 pm

Have a look at the getHours() and getMinutes functions:

var hour:Date = new Date();
var minute:Date = new Date();
hours = hour.getHours();
minutes = minute.getMinutes();

This code sets up two variables, then usesthe functions to return string values for the current hours and minutes. The code above uses local PC time, though there is a function (check the help files) that gets a standard internet time if that's important.

Once Flash has the time, then a simple 'less than' check will allow you to change movieclip.

Graham

http://www.YouTube.com/ShiveringCactus - Free FX for amateur films


Return to posts index

Crystal Coffelt
Re: time of day: switch out animation - AS2 option
on Mar 29, 2009 at 9:06:37 pm

Thanks! This is what I needed.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]