Jump to content
Search Community

cardinal4

Members
  • Posts

    3
  • Joined

  • Last visited

Contact Methods

cardinal4's Achievements

0

Reputation

  1. Why I wanted to peg my EnterFrame listeners onto a looping delayedCall, is kinda because of lazy. Because I needed a convenient way to pause/resume an animation of a Popup, which culminated in a TextField that pulsed in the background. That pulsing used to rely on enterFrame, and the rest of the animation on TimelineMax. So I thought, might as well lay everything on TimelineMax, and pause everything with a simple TimelineMax.pause(). Yup, I think the previous issues are resolved, thank you. The below still doesn't work, but it's because the playhead is exactly over the repeat as you mentioned, am I getting it right? var timeline1:TimelineMax = new TimelineMax({ repeat: -1, useFrames: true }); timeline1.append(TweenLite.delayedCall(1, trace, ["-> 1"])); timeline1.play(); I've another question, is that whether the below code will always execute in the same order everytime (eg. there isn't a race condition where the order in which it is called gets jumbled up at the whim of the Flash AVM). var timeline4:TimelineMax = new TimelineMax({useFrames: true}); timeline4.append(TweenLite.delayedCall(2, trace, ["First"])); timeline4.append(TweenLite.delayedCall(0, trace, ["Second"])); timeline4.append(TweenLite.delayedCall(0, trace, ["Third"])); timeline4.append(TweenLite.delayedCall(0, trace, ["Fourth"])); timeline4.play();
  2. I've found TweenLite's delayedCall methods to be extremely useful in scripting delays, much more useful than setInterval or enterFrame with getTimeElapsed(). I thought of bringing it one step further by substituting TweenLite on my enterFrame, but it seems TweenLite/TimelineMax has some issues. As illustrated in the following code: 1. With infinite repeat, a delay call of 1 frame fails. - It succeeds if the repeat is removed. - Or if the delay is bigger than 1 frame. 2. But if a second delay is pegged on, it works! package { import flash.display.Sprite; import com.greensock.*; public class Main extends Sprite { public function Main():void { // Calling with Frame <= 1 fails. var timeline1:TimelineMax = new TimelineMax({ repeat: -1, useFrames: true }); timeline1.append(TweenLite.delayedCall(1, trace, ["-> 1"])); timeline1.play(); // Pegging timeline1 with further calls on Frame > 1 succeeds var timeline3:TimelineMax = new TimelineMax({ useFrames: true }); timeline3.append(TweenLite.delayedCall(1, trace, ["---> 3"])); timeline3.append(TweenLite.delayedCall(2, null)); timeline3.play(); } } } In a side note, I was wondering if there was a way to activate 2 Tweens at the same moment in time. For example, I want to have the Second Call come in after the First Call. In the order at which they were appended. Is it possible? var timeline4:TimelineMax = new TimelineMax({useFrames: true}); timeline4.append(TweenLite.delayedCall(2, trace, ["First"])); timeline4.append(TweenLite.delayedCall(0, trace, ["Second"])); timeline4.play();
  3. I think that documentation for TweenNano might be off, since it appears that TweenNano does not overwrite Tweens by default. Example code: package com.src { import flash.display.Sprite; import flash.events.Event; import flash.text.TextField; import com.greensock.TweenNano; import com.greensock.TweenLite; public class Main extends Sprite { var nano:TextField; var lite:TextField; public function Main():void { if (stage) init(); else addEventListener(Event.ADDED_TO_STAGE, init); } private function init(e:Event = null):void { removeEventListener(Event.ADDED_TO_STAGE, init); nano = new TextField(); nano.text = "TweenNano"; nano.y = 10; addChild(nano); lite = new TextField(); lite.text = "TweenLite"; lite.y = 50; addChild(lite); TweenNano.from(nano, 1, { x: 50 } ); TweenNano.to(nano, 1, { x: 50, delay: 1 } ); TweenLite.from(lite, 1, { x: 50 } ); TweenLite.to(lite, 1, { x: 50, delay: 1 } ); } } } But documentation says: I only realised this when I had to switch from TweenNano to TweenLite, and realised some of my Tweens weren't playing out. I'd been taking overwrite=false for granted all along. This is using the latest Tween library dated 2010-04-28. Btw I had a hard trouble signing up haha... Kept failing the confirmation code, not sure why, until the twentieth time a 4-digit sequence came out, with no alphabets, that I finally passed.
×
×
  • Create New...