Jump to content
GreenSock

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

Timelinemax, in and out functions out of sync

Recommended Posts

Hi

 

I have made a banner with in and out functions connected to a timelinemax in AS2

Everything works smooth, the problems is that i want it to loop seamlessly, there is a glitch between the last animation and the first.

 

Any hints on how to solve this?

 

See attached file.

 

Thanks

banner_loop.zip

Link to comment
Share on other sites

Hi. Good job on the banner. Using the animateIn() and animateOut() methods is a great approach.

 

I looked at your files, I don't know exactly what the glitch is as it appeared to loop fine, but I'm assuming that perhaps you want the last object animating out to overlap with the first object animating in. If that is the case, try replacing your timeline and onComplete callback with this:

 

 

var tlAA:TimelineMax = new TimelineMax({onComplete:myFunkis});
tlAA.addLabel("spin", 0);
tlAA.append(animateIn(pen_01));
//add a label when pen_01 out starts and pen_02 in starts
tlAA.addLabel("loopStart", 1);
tlAA.append(animateOut(pen_01),1);
tlAA.append(animateIn(pen_02),-1);
tlAA.append(animateOut(pen_02),1);
tlAA.append(animateIn(pen_03),-1);
tlAA.append(animateOut(pen_03),1);
tlAA.append(animateIn(pen_04),-1);
tlAA.append(animateOut(pen_04),1);
//bring in pen_01
tlAA.append(animateIn(pen_01), -1);



function myFunkis()
{
tlAA.gotoAndPlay("loopStart");
//return tlAA;
}

 

The timeline's playhead can't be at the beginning and end at the same time so you will see that I added the pen_01 in animation to happen when pen_04 is animating out and then I loop back to the beginning of the timeline where 1 is about to go out and 2 is about to come in.

 

If you needed something else just let me know.

 

-c

Link to comment
Share on other sites

Hi Carl

 

A huge thank you for the help, that was exactly what I was trying to achieve.

You are right, animateIn and Out methods are great, just discovered that way to animate.

 

Cheers

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