Search the Community
Showing results for tags 'timelinemax zero duration'.
-
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?