Jump to content
Search Community

TimelineLite Repeating before Completion

CantinaDan test
Moderator Tag

Recommended Posts

Hi! Forgive my rudimentary coding skills and understanding. I'm building out a small banner ad. Very straighforward fades in and out. For some reason this animation keeps resetting to the beginning before its done playing. Can anyone troubleshoot my code and see if I'm missing something? Thanks so much!
 

It seems to be jumping to the beginning a few lines into // phase 2:

function repeatAd(e:Event=null):void
{
whiteBox_mc.scaleX=.1;
whiteBox_mc.scaleY=.1;
copy1_mc.scaleX=.2;
copy1_mc.scaleY=.2;
copy3_mc.scaleX=.2;
copy3_mc.scaleY=.2;
copy4_mc.scaleX=.2;
copy4_mc.scaleY=.2;
copy5_mc.scaleX=.2;
copy5_mc.scaleY=.2;
copy6_mc.scaleX=.2;
copy6_mc.scaleY=.2;
 
var theArray:Array = new Array(bkgd2_mc, copy1_mc, copy2_mc, copy3_mc, copy4_mc, copy5_mc, copy6_mc,
  copy7_mc, DMBlogo_mc, greyBox_mc, learnMore_mc, whiteBox_mc);
 
for (var i:int = 0; i < theArray.length; i++)
{
theArray[i].alpha = 0;
}
 
 
var imageAni1:TimelineLite = new TimelineLite({onComplete:repeatAd});
// phase 1
imageAni1.append(TweenLite.to(whiteBox_mc, 1, {alpha: .8, scaleY: 1, scaleX: 1, ease:Expo.easeOut, delay:1}));
imageAni1.append(TweenLite.to(copy1_mc, 1, {alpha: 1, scaleY: 1, scaleX: 1, ease:Expo.easeOut}), -.5);
imageAni1.append(TweenLite.to(copy1_mc, 1, {alpha: 0, ease:Expo.easeOut}), 1);
imageAni1.append(TweenLite.to(copy2_mc, 2, {alpha: 1, ease:Expo.easeOut}), -.5);
// phase 2
imageAni1.append(TweenLite.to(bkgd2_mc, 2, {alpha: 1, ease:Expo.easeOut}));
imageAni1.append(TweenLite.to(copy3_mc, 2, {alpha: 1, scaleY: 1, scaleX: 1, ease:Expo.easeOut}), -.5);
imageAni1.append(TweenLite.to(greyBox_mc, 2, {alpha: 1, ease:Expo.easeOut}), -2);
imageAni1.append(TweenLite.to(copy3_mc, .5, {alpha: 0, ease:Expo.easeOut}));
imageAni1.append(TweenLite.to(copy4_mc, 2, {alpha: 1, scaleY: 1, scaleX: 1, ease:Expo.easeOut}));
imageAni1.append(TweenLite.to(copy5_mc, 2, {alpha: 1, scaleY: 1, scaleX: 1, ease:Expo.easeOut}));
imageAni1.append(TweenLite.to(copy6_mc, 2, {alpha: 1, scaleY: 1, scaleX: 1, ease:Expo.easeOut}));
}
 
repeatAd();
Link to comment
Share on other sites

Hi

 

It sounds like the main timeline may be playing and repeating. Do you have extra frames in any layers? Try adding a stop action at the bottom of your code

 

repeatAd();

stop();

 

If that doesn't work please zip your fla and post it here. The more you can simplify it (remove tweens) the better.

  • Like 1
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...