Jump to content
Search Community

TweenMax and images loop

mmaculatell test
Moderator Tag

Recommended Posts

Hi, I have a little problem whit my images loop; I just want to create a loop of sliding images that go form right to left,using tweenMax.this is my code:

 

//section1, section2, section3 are my 3 images

 

 

 

function animateIn(obj:Object) {

var timeline:TimelineMax = new TimelineMax();

obj.x = 1004;

 

timeline.append(TweenMax.fromTo(obj, 2, {x:1004},{x:0, ease:Expo.easeInOut}) );

 

return timeline;

}

 

function animateOut(obj:Object) {

var timeline:TimelineMax = new TimelineMax();

timeline.append(TweenMax.fromTo(obj, 2, {x:0},{x:-1004, ease:Expo.easeInOut}) );

return timeline;

}

 

//

 

var timeline:TimelineMax = new TimelineMax({repeat:-1});

timeline.append( animateIn(section1), -2);

timeline.append( animateOut(section1));

 

timeline.append( animateIn(section2), -2);

timeline.append( animateOut(section2));

 

timeline.append( animateIn(section3), -2);

timeline.append( animateOut(section3) );

 

the problem is when this loop restart, because I have 1 second or more where the stage is empty, while the section1 restart his animation; how can I make this continuous loop ?

 

thanks a lot

Ale

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