Jump to content
Search Community

TigerDX

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by TigerDX

  1. I can understand your reasoning, so perhaps I am missing the control methods that allow pausing and playing of nested TimelineMax/Lite instances. Or perhaps there is a getter or publicly accessible array of instances? The way around the issue in my case was to use the "getter" as an instantiator for Timeline objects and immediately insert the generated array into a paused Timeline. Where this project needs a good separation of concern, the code is probably more macaroni than is typical, and I am therefore wondering about the Flash handling of events with regards to frame progression. My hope is that before the frames of animation for a TweenMax/Lite/Nano instance can begin, all traversal of code is completed, allowing a controller to receive all relevant instances and prevent them from proceeding. I admit I am not intimately familiar with the way Flash handles frame sensitive execution of code, so I cannot speak to whether this would be a problem. Edit: Sure enough, there's a getter - getChildren() I'll probably write a cascading play() method anyway.
  2. I have this same problem. If Timelines are instantiated with the paused option set to true, then nested inside another Timeline instance, calling play() on the outer timeline will not cause all nested Timelines to play. I have this in a project in which I am generating several instances of an object and am using a Timeline to stagger their build. public class QButton extends MovieClip { private var introAnim:TimelineMax; private var outroAnim:TimelineMax; public function QButton():void { introAnim = new TimelineMax(); introAnim.insert(TweenMax.from(this, 0.6, {scaleX:2, scaleY:2, alpha:0, blurFilter:{blurX:16, blurY:16}, ease:Circ.easeOut})); outroAnim = new TimelineMax({paused:true, onComplete:destroy}); outroAnim.insert(new TweenMax(this, 1, {scaleX:0.3, scaleY:0.3, autoAlpha:0, blurFilter:{blurX:16, blurY:16}, ease:Circ.easeIn})); } public function getIntroAnim():TimelineMax { return this.introAnim; } public function getOutroAnim():TimelineMax { return this.outroAnim; } // etc. } Then I have a Class for producing and nicely displaying multiple buttons with staggered intro and outro animations. public class MultiQuestion { private var buttonArray:Array; private var inTimeline:TimelineMax; private var outTimeline:TimelineMax; private var stageRef:MovieClip; public function MultiQuestion(qArray:Array, stage:MovieClip) { var yPos:int = 70; var buildArray:Array = new Array(); var breakdownArray:Array = new Array(); this.buttonArray = new Array(); this.inTimeline = new TimelineMax(); this.outTimeline = new TimelineMax({paused:true}); this.stageRef = stage; for each (var o:Object in qArray) { var newButton:QButton = new QButton(); buildArray.push(newButton.getIntroAnim()); breakdownArray.push(newButton.getOutroAnim()); buttonArray.push(newButton); this.stageRef.addChild(newButton); } this.inTimeline.insertMultiple(buildArray, null, null, 0.1); this.outTimeline.insertMultiple(breakdownArray, null, null, 0.1); } private function cleanUp(event:MouseEvent):void { // Doesn't play this.outTimeline.play(); } } I've removed a lot of button functionality for clarity, but the issue here is that the inTimeline plays fine, because the paused state is not set, while the outTimeline will never play, despite being called in the full code (where cleanUp() is called on click of any one of the buttons). Apologies if it's not clear from this example, but I assume the issue is that a call to play() does not cascade to any child Timeline instances. I suppose a way around it in this case would be to generate outro animations only when needed, though I can only hope that I can separate concern in the same way while allowing the staggering for multiple instances.
×
×
  • Create New...