Share Posted March 29, 2012 Hi everyone, I'm trying to do a simple thing: -Create a timelinemax instance which will play later a the end of the code -Insert some tweens (just one for the exemple here), these tweens can be zero duration ones! -Do some operations relative to my project -Then playstart the timelinemax instance and listen to the COMPLETE event import com.greensock.TweenMax; import com.greensock.events.TweenEvent; import com.greensock.TimelineMax; import flash.display.Sprite; var round:Sprite=new Sprite(); round.graphics.lineStyle(0.1); round.graphics.drawCircle(0,0,25); addChild(round); var timeLine:TimelineMax = new TimelineMax({paused:true}); timeLine.insert(new TweenMax(round, 2, {x:stage.stageWidth,y:stage.stageHeight})); // //Do some stuffs related to my project... // timeLine.play(); timeLine.addEventListener(TweenEvent.COMPLETE, completeHandler); function completeHandler(evt:TweenEvent) { trace("complete"); } With the code above, no problems, everything works fine But with a zero duration tween... import com.greensock.TweenMax; import com.greensock.events.TweenEvent; import com.greensock.TimelineMax; import flash.display.Sprite; var round:Sprite=new Sprite(); round.graphics.lineStyle(0.1); round.graphics.drawCircle(0,0,25); addChild(round); var timeLine:TimelineMax = new TimelineMax({paused:true}); timeLine.insert(new TweenMax(round, 0, {x:stage.stageWidth,y:stage.stageHeight})); // //Do some stuffs related to my project // timeLine.play(); timeLine.addEventListener(TweenEvent.COMPLETE, completeHandler); function completeHandler(evt:TweenEvent) { trace("complete"); } With this code the round is reaching its destination but no event is catched, I can't enter in the completeHandler function I read around here about the immediateRender property, but when I specify it false on my tween, that one just never starts, even if I use the play() method on the timelinemax instance... How can I do? Link to comment Share on other sites More sharing options...
Share Posted March 29, 2012 Ah yes, zero-duration tweens and timelines can be tricky because they aren't really "tweens" since there's no time that elapses, but thanks for pointing out the issue. It should be resolved in the latest version (posted a few minutes ago). Link to comment Share on other sites More sharing options...
Author Share Posted March 29, 2012 Yeah right on time! That works perfectly fine now Thanks dude 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