lbweb Posted March 10, 2015 Share Posted March 10, 2015 I'm trying to build a web banner using TweenNano but one of the requirements is that the ad has to stop animating after 30secs. I've been trying to implement the code, but I keep getting errors and I'm not a seasoned enough flash developer to know what the deal is: import com.greensock.*; import com.greensock.easing.*; import flash.events.MouseEvent; import flash.net.URLRequest; var animateTxt = function begin():void { TweenNano.to(seeOthers, 1.5, {alpha:1, delay: 0, ease:Quad.easeInOut}); TweenNano.to(seeOthers, 1.5, {alpha:0, delay:3, ease:Quad.easeInOut}); TweenNano.to(shouldBe, 1.5, {alpha:1, delay:4.5, ease:Quad.easeInOut}); TweenNano.to(shouldBe, 1.5, {alpha:0, delay:7.5, ease:Quad.easeInOut, onComplete:begin}); } animateTxt(); var timer:Timer = new Timer(30000, 1); timer.addEventListener( TimerEvent.TIMER, function(evt:TimerEvent):void { trace('timer launched'); animateTxt.pause(); } ); startBtn.addEventListener(MouseEvent.CLICK, onStart); function onStart(e:MouseEvent):void { animateTxt.play(); } timer.start(); stop(); Any help would be GREATLY appreciated Link to comment Share on other sites More sharing options...
Carl Posted March 11, 2015 Share Posted March 11, 2015 please try TweenNano.killTweensOf() function(evt:TimerEvent):void { trace('timer launched'); TweeNano.killTweensOf(seeOthers) TweeNano.killTweensOf(shouldBe) } Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now