Jump to content
Search Community

CDN: TimelineLite - uncaught reference error

Thomas James Thorstensson 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

Hello, the below works, loading TweenMax from CDN

<script src="https://s0.2mdn.net/ads/studio/cached_libs/tweenmax_1.19.0_643d6911392a3398cb1607993edabfa7_min.js"></script><script src="https://s0.2mdn.net/ads/studio/cached_libs/cssplugin_1.18.5_6bbddbd910e8bfac4e19220fe52e1af6_min.js"></script>


function initAnim() {
    var TL = new TimelineLite();
    TL.from("#banner", 1.2, { autoAlpha: 0 });
    TL.to("#car", 2, { x: 200, y: 200 })
}
But the following does not work, it tells me that TimelineLite is not defined, loading TweenLite from CDN
 
<script src="https://s0.2mdn.net/ads/studio/cached_libs/tweenlite_1.19.0_422f021fad4c20f20cf3640a06ac39e9_min.js"></script>
<script src="https://s0.2mdn.net/ads/studio/cached_libs/cssplugin_1.18.5_6bbddbd910e8bfac4e19220fe52e1af6_min.js"></script>


function initAnim() {
    var TL = new TimelineLite();
    TL.from("#banner", 1.2, { autoAlpha: 0 });


    TL.to("#car", 2, { x: 200, y: 200 })
}
I am perplexed. I am sure this worked before. Since I am only creating an instance of TimelineLite, i should not need to load TweenMax. Hmm. What on earth.
 
 
Thankful for insights,
 
".S" 

 

Link to comment
Share on other sites

You loaded TweenLite and CSSPlugin only in that second example. You forgot to load TimelineLite. 

 

Remember, TweenMax has a bunch of common tools INSIDE of it, like TweenLite, CSSPlugin, TimelineLite, TimelineMax, BezierPlugin, RoundPropsPlugin, etc. That's why the first one worked - you were loading TweenMax. 

 

Does that clear things up? 

  • Like 1
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...