Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
seddass

Cannot add [object Object] into the timeline [SOLVED]

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

[sOLVED]

 

IMPORTANT: When using GS with require.js dont override the GS variables like that:

define(['ScrollToPlugin', 'TweenLite', 'TimelineLite'], 
function(ScrollToPlugin, TweenLite, TimelineLite) {
   // your code here
})

Hello, 

I am doing something weird probably because I cant add Tween to Timeline.

var tw = TweenLite.to(window, 0.7, {scrollTo:{y: 300}, ease:Power3.easeInOut});
console.log(tw);
var tl = new TimelineLite();
tl.add( tw );

and the same when testing this way:

var tl = new TimelineLite();
tl.add( TweenLite.to(window, 0.7, {scrollTo:{y: 300}, ease:Power3.easeInOut}) );

Both ways I see the error:

 

Uncaught Cannot add [object Object] into the timeline; it is not a tween, timeline, function, or string.

 

The output from console.log(tw) begins with:

 

Object {varsObject_totalDuration0.7_duration0.7_delay:0_timeScale1}

  1. _activefalse
  2. _delay0
  3. _duration0.7
  4. _easeObject
  5. _easePower3
  6. _easeType3
  7. _firstPTObject
  8.  

 

It looks like a tween anyway.. What I am doing wrong? 

Same code in jsFiddle is working fine. Pls. help with a hint. 

 

EDIT: I am loading all .js files with require.js (AMD loader). What is the correct way of loading GS plugins with require.js shim?

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.
×