Skip to main content
Inspiring
February 15, 2020
Answered

How to correctly select mc on stage for animation

  • February 15, 2020
  • 2 replies
  • 483 views

As a refresher test (it's years since I last used Animate), I am trying to animate an Mc with GSAP (following the video at https://youtu.be/Dq1_MI2gHuM).

 

If I follow the video instructions and go:

 

 

TweenMax.to(this.sym1, 1, {
x: 10,
delay: 0.5
});

 

 
nothing happens.
 
However, if I go 
 

 

var root = this;

 

 
and then 
 
 

 

TweenMax.to(root.sym1, 1, {
x: 10,
delay: 0.5
});

 

 
it animates as it should.
 
Am I missing something obvious?
 
Thanks

 

 

This topic has been closed for replies.
Correct answer julianc31943986

Answered my own question - there was a mistake in my js, a difference between my test file and the GSAP instruction video, that I'd overlooked. I had put the tween inside a function - I took it outside the function and it worked fine.

2 replies

julianc31943986AuthorCorrect answer
Inspiring
February 17, 2020

Answered my own question - there was a mistake in my js, a difference between my test file and the GSAP instruction video, that I'd overlooked. I had put the tween inside a function - I took it outside the function and it worked fine.

Legend
February 15, 2020

Canvas documents already have a perfectly good tween library built in, TweenJS. Why are you bloating your project with an unnecessary third-party tween library?

Inspiring
February 15, 2020

Hi ...just that I am familar with GSAP from using it elsewhere, it doesn't seem to impact the speed of the animation so I didn't see any harm in using it, and I didn't want to go through any extra learning curves if I already knew a tool that worked well. Sure I can look into tweenjs as you suggest but do you mean that the problem I had is related to GSAP and wouldn't occur if I used tweenjs?