Jump to content
Search Community

Timer with GSAP

celli test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

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.

Link to comment
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 ?

 

See the Pen jaBrpP by celli (@celli) on CodePen

 

 

 

 

  • Like 3
Link to comment
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
Link to comment
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)

Link to comment
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.
×
×
  • Create New...