celli

Timer with GSAP

Recommended Posts

I am wondering if anyone knows how to create GSAP code so that I can send Animate CC to a specific frame only at a specific date (Month, Day and Year) and time ?

 

I wanted to do this in Animate CC, and use GSAP so that I can send the timeline to a specific frame when we reach a certain date and time only... otherwise it would just play the regular timeline.

Share this post


Link to post
Share on other sites

In case anyone is interested I accomplished it pretty easily. See this codePen, and change the date to see it work... 

 

I am wondering if anyone has experience with this running anything like this in a banner ad ?

I am hoping there is not a reason that this wouldn't fire appropriately (inside of a banner ad)... or if there was a fail-safe to make certain that the script runs ?

 

 

 

 

 

  • Like 3

Share this post


Link to post
Share on other sites

I do them often, never had any issues. Typically a tune in time for shows or movies (i.e. "Starts tonight", "Starts tomorrow", starts on this date, etc. The only issue I really see with yours is getMonth starts at zero, not 1. So d.getMonth()+1 == 11, would be December, not November.

Your fallback could be a something similar to what you have now but perhaps use a switch statement with a default case.

  • Like 1

Share this post


Link to post
Share on other sites

Thanks Davi ! It's strange though because the getMonth with +1 seems to work for the 11th month (November), which is this month. If you switch the day, you'll see it working-- Am I missing something ? I want to make sure, because this will run during the 12th month actually :) even though my test is in the 11th month (November)

Share this post


Link to post
Share on other sites

You're totally right! That was throwing me off for a sec. Happy hour at the desk not makin me think straight. Happy Friday!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.