How to correctly select mc on stage for animation

Community Beginner ,
Feb 15, 2020 Feb 15, 2020

Copy link to clipboard

Copied

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

 

 

See how easy it is to implement the GreenSock Animation Platform with Animate CC. You'll see how to load TweenMax as a global script and write some basic GSA...
TOPICS
Code

Views

102

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct Answer

Community Beginner , Feb 17, 2020 Feb 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.

Likes

Translate

Translate
Adobe Community Professional ,
Feb 15, 2020 Feb 15, 2020

Copy link to clipboard

Copied

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?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 15, 2020 Feb 15, 2020

Copy link to clipboard

Copied

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?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 17, 2020 Feb 17, 2020

Copy link to clipboard

Copied

LATEST

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines