Jump to content
GreenSock

yolassi

Members
  • Posts

    4
  • Joined

  • Last visited

Reputation

0 Newbie
  1. Thanks you so much! This works perfectly. Glad to see that you have a forum specifically for banner ads too. Oh my what a quick changes this has been but greensock really helps!
  2. Hi there. I've been searching on this site and haven't been able to find anything to solve my problem but I should mention I'm no expert. I've been working on banner ads (was used to working with Flash but now using HTML5) and I want to be able to make the banners repeat but ONLY TO A CERTAIN POINT. I've attached some very simplified code to give an idea of what I'm talking about. I'm using 'restart' to repeat the banner but I want the animation to only repeat once and to stop at a certain point in the case below I want it to stop where the cta fades in, i.e., the third to last line of the timline lite. Here's the code: var tl = new TimelineLite({onComplete:bannerRestart}); tl.to(copy1, .5, {alpha:1, ease:Linear.easeNone},"+=.7") .to(copy1, .3, {alpha:0, ease:Linear.easeNone},"+=2.5") .to(copy2, .5, {alpha:1, ease:Linear.easeNone},"+=.3") .to(cta, .5, {alpha:1, ease:Linear.easeNone},"+=1") .to(copy2, .3, {alpha:0, ease:Linear.easeNone},"+=2.5") .to(cta, .5, {alpha:0, ease:Linear.easeNone},"-=.3") function bannerRestart() { tl.restart(); } If anyone could help I'd be very thankful!!
  3. I've read up on this form why onreverseComplete doesn't work within a TweenLite inside a TimeLineMax and have been trying 'addCallBack' instead. I can't get it to work properly in the code below (same as in the attached simplified FLA). It works fine going forward but on when reversed my 'previous' button has to be clicked twice to continue the reversing. Hope that makes sense! Here's the code: import com.greensock.*; import com.greensock.easing.*; import flash.events.MouseEvent; next_mc.addEventListener(MouseEvent.CLICK, nextHandler); next_mc.buttonMode = true; previous_mc.addEventListener(MouseEvent.CLICK, previousHandler); previous_mc.buttonMode = true; var tl:TimelineMax = new TimelineMax(); tl.pause(); tl.appendMultiple([TweenLite.to(one_mc, 1, {x:550, ease:Sine.easeInOut}), TweenLite.from(two_mc, 1, {x:-550, ease:Sine.easeInOut})], 0, TweenAlign.START, 0); tl.addCallback(pauseTimeline, tl.duration); tl.appendMultiple([TweenLite.to(two_mc, 1, {x:550, ease:Sine.easeInOut, onComplete:tl.pause}), TweenLite.from(three_mc, 1, {x:-550, ease:Sine.easeInOut})], 0, TweenAlign.START, 0); function nextHandler(event:MouseEvent):void{ tl.play(); } function previousHandler(event:MouseEvent):void{ tl.reverse(); } function pauseTimeline():void{ tl.pause(); } Any help would be greatly appreciated! timeLineReverse.zip
×