Jump to content
Search Community

Ticker in TweenMax

barredow test
Moderator Tag

Recommended Posts

I have a basic looping stock like ticker that has movieclips that loop and have links. Right now there is a huge gap in between the loops. Also for simplicity there are only 2 movie clips but I'll be adding several more.

 

Two questions: A) Can someone help me reduce the gap and B) is there a better way to do this?

 



import com.greensock.*; 
import com.greensock.easing.*; 
import com.greensock.plugins.*; 

MainAnimation(); 

function MainAnimation():void { 

TweenMax.fromTo(red1, 5, {x:500}, {x:-600, ease:Linear.easeNone});
TweenMax.fromTo(red2, 10, {x:1100}, {x:-1200, ease:Linear.easeNone, onComplete:repeatAnimation});


} 

function repeatAnimation():void { 
MainAnimation(); 
}  

Link to comment
Share on other sites

there are many ways to create an effective loop. although a bit archaic, the easiest way is to have all your ticker items in one parent container.

this allows you to move one object instead of many. when you get to the end of the animation, you just replay it.

in order for the loop to be seamless, you usually have to have copies of one or more items so that when the last item moves off the stage the first item appears to be following it directly.

 

attached is a very simple and basic approach.

 

---

 

if you want to get more complex and not have to worry about duplicating elements, I have a way of shifting elements around so as soon as the first element goes off stage it automatically gets sent to the back of the line:

 

http://www.snorkl.tv/2011/02/easy-infin ... ll-part-1/

 

 

-----

 

if you want to try the newest coolest technique in the world, feel free to investigate the BlitMask Wrap:

http://www.snorkl.tv/2011/10/use-blitma ... d-looping/

 

*note this solution may not be great for you since bitmapMode needs to be set to true, which means responding to mouse events may become challenging.

Link to comment
Share on other sites

  • 3 months later...

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