Jump to content
Search Community

Newbie Question about Cycle Property

Presuming Ed 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

Hey

 

I'm getting to grips with using GSAP in Animate cc, and I've come across the  cycle property and am trying to cycle through an array, as follows:

 

var items = [this.item1,this.item2,this.item3]
var tl = new TimelineMax();

tl.staggerFrom(items, 2, {autoAlpha: 1,scaleX: 0,scaleY: 0, ease:Bounce.easeOut, cycle:[-100,100]}, delay:2}, 0.1)

 

but it seems to ignore the cycle request. I've noticed people use list items within HTML, so is this the reason it won't work?

 

(Sorry no codepen)

 

Thanks!

Link to comment
Share on other sites

I'm not sure which property you want to cycle, but you just have a little syntax problem. If you wanted to cycle the x position, you'd write it like this:

 

tl.staggerFrom(items, 2, {autoAlpha: 0,scaleX: 0,scaleY: 0, ease:Bounce.easeOut,  cycle:{x:[-100,100]} }, 0.1);

 

Hopefully that helps. Happy tweening.

:)

 

  • Like 2
Link to comment
Share on other sites

2 hours ago, PointC said:

Staggering left and right sounds like you'd want to cycle the x position. Here's a quick example.

 

See the Pen gveqRM by PointC (@PointC) on CodePen

Hopefully that helps. Happy tweening.

:)

 

 

Got it! Thanks for your help. At first it was doing the same as before and then i realised it was all to do with the x values not being correct! Doh! I always tend to look for more complicated solutions and forget the obvious!!

Thanks again for your time

 

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