Hello all !
I'm new to the greensock API, and therefore also new to the forum !
Well, first of all, I'd like to congratulate for the great job, the APIs are awesome !
I'm also just getting started in AS3, as I've always been using AS2 so far, but that's another subject...
After a couple days, I think I'm aleady getting things to work nicely, so I'm pretty pleased with the quality of the platform, it makes AS3 look easy !
I got a nice animation playing, with tweens nested in timelines, all nested in one master timeline, I named masterTimeline. In the end, a button allows to restart the animation, so it triggers masterTimeline.restart()
The thing is, some of the tweens don't play. I'm really puzzled by the following :
//sequence 1
var barongteterot1:TimelineLite = new TimelineLite();
barongteterot1.append(new TweenLite(barong, 0.9, {rotation:-30, ease: Linear.easeOut})); //rotate
barongteterot1.append(new TweenLite(barong, 0.9, {rotation:0, ease: Linear.easeOut})); //rotate back
barongTimeline.appendMultiple([
new TweenLite(barong, 1.8, {x:-30, y:145, ease: Quad.easeInOut}),
new TweenLite(barong, 1.8, {scaleX:0.6, scaleY:0.6, ease: Linear.easeOut}),
barongteterot1]);
//sequence 2
var barongteterot2:TimelineLite = new TimelineLite();
barongteterot2.append(new TweenLite(barong, 0.9, {rotation:30, ease: Linear.easeOut}));
barongteterot2.append(new TweenLite(barong, 0.9, {rotation:0, ease: Linear.easeOut}));
barongTimeline.appendMultiple([
new TweenLite(barong, 1.8, {x:470, y:125, ease: Quad.easeInOut, onComplete:swapDepth, onCompleteParams:[0]}),
new TweenLite(barong, 1.8, {scaleX:0.2, scaleY:0.2, ease: Linear.easeOut}),
barongteterot2]);
//sequence 3
var barongteterot3:TimelineLite = new TimelineLite();
barongteterot3.append(new TweenLite(barong, 0.4, {rotation:-30, ease: Linear.easeOut}));
barongteterot3.append(new TweenLite(barong, 0.4, {rotation:0, ease: Linear.easeOut}));
barongTimeline.appendMultiple([
new TweenLite(barong, 0.8, {x:250, y:255, ease: Expo.easeIn}),
new TweenLite(barong, 0.8, {scaleX:0.05, scaleY:0.05, ease: Linear.easeOut}),
barongteterot3]);
masterTimeline.insert(barongTimeline,"startbarong");
it plays perfectly, but when I restart the masterTimeline, the "rotate back" in sequence 1 won't play !!
it's really puzzling as sequence 2 and 3 are constructed in the same way and have no problem what so ever !
I managed a work around, triggering the rotate back in a function called with onComplete, but I'd really like to understand, mostly.
maybe other parts of my code are interfering (although I doubt it), but if anyone has an idea of what's happening here, I'd appreciate an explanation or any lead to a start of an explanation.
Cheers all !