Hey all, I have a question about the best tactic to use in the following situation, maybe somebody can help.
Imagine a playing card that is flipping over from left to right rapidly, it's scaleX going from 1 to 0 and back to 1 again, then repeating. I want to have the card flip rapidly and first, and then slow down its flip until it rests face up and stops. However, I want to show the back of the card on every other flip of course, so this creates some problems. I also need to tween the currentProgress (or maybe the timescale) of the timeline to get the rotation to slow down and speed up as necessary. What is the best strategy for this? I was thinking of using the TweenEvent.REPEAT event to monitor when to show the back or front of the card, which works, but I thought I would ask if anybody does this sort of thing often and has developed a good strategy for this type of thing. In my current code, I am relying on spot judging how many seconds I have to pass to the TweenLite which controls the timeScale in order to get a good result, and the "repeat" value of the timeline is technically never reached and won't fire a complete event. (repeat could be 16 or 17 when the timeScale hits 0, tween is not technically complete). Anyways, sorry if this is a bit garbled, a bit hard for me to put my situation into words at the moment, but maybe the code can help:
_animTimeline = new TimelineMax();
_animTimeline.repeat = 20;
_animTimeline.addEventListener(Event.COMPLETE, onReceiveItemAnimComplete, false, 0, true);
_animTimeline.addEventListener(TweenEvent.REPEAT, onReceiveItemAnimRepeat, false, 0, true);
_animTimeline.insert(new TweenMax(_inventoryClip, .1, {transformAroundCenter:{scaleX:1}, startAt:{transformAroundCenter:{scaleX:0}}}), 0);
_animTimeline.insert(new TweenMax(_inventoryClip, .1, {transformAroundCenter:{scaleX:0}, startAt:{transformAroundCenter:{scaleX:1}}}), .1);
TweenLite.to(_animTimeline, 5, {timeScale:0});
Thanks to all who help,
--CaptShmo