Jump to content
Search Community

sideDoor

Members
  • Posts

    15
  • Joined

  • Last visited

sideDoor's Achievements

0

Reputation

  1. Ok, I'll put together a demo when I get a chance: I think this might be helpful not only for me... But in an attempt to clarify, what I think is happening is that when the animateIn() sub-timeline completes, the animateOut() is being run by the main-timeline BEFORE the completion of the series of logic that includes the call to main-timeline.pause(), which is housed in the animateIn-onComplete method. I'll try to put together a streamlined version, but I'm swamped at work right now, so when I get the time, I'll do so... Regardless, what I'm trying to do is probably better served by the command-pattern... Thanks for your time!
  2. It's too bad we can't do something like: _mainTimeline.append(view.animateIn(), onAppendComplete:function(){_mainTimeline.pause()}); Or whatever...
  3. Hmm, I can't really send an fla, the project is quite a bit more complex than that... Moreover, I'm using objects here, and I wonder if your test works because you're using a local callback function and TweenLite instead of appending Timelines, etc. So I'm doing this: 1. in an abstract view class, I have two methods that create default animateIn and animateOut methods, these return TimelineMax objects contain the needed sequence of TweenCore objects to animate the view onto and off of the stage. Typically, the method looks like this: // earlier in the View class, we define a constant to denote the event type: public static const ANIMATION_IN_COMPLETE:String = 'animationInComplete'; // later we have our animateIn() method: public function animateIn():TimelineMax { var timeline:TimelineMax = new TimelineMax({onComplete:dispatchEvent, onCompleteParams:[new Event(View.ANIMATION_IN_COMPLETE)]}); timeline.append(TweenMax.to(this, .4, {alpha:1})); return timeline; } 2. when the View is asked to show itself on the stage, FROM WITHIN ANOTHER OBJECT, I'm trying to do this: view.addEventListener(View.ANIMATION_IN_COMPLETE, onAnimateInComplete); _mainTimeline.append(view.animateIn()); _mainTimeline.append(view.animateOut()); _mainTimeline.play(); And we try to catch the View.ANIMATION_IN_COMPLETE event like so: private function onAnimateInComplete(e:Event):void { var view:View = e.target as View; _mainTimeline.pause(); // here I can do some stuff I need to DO, and later call mainTimeline.resume(); to fire the view.animateOut() timeline, which was appended above: BUT NO LUCK - BOTH appends have been fired! } The only way so far around this seemingly issue of timing, is to NOT append all timelines at once, and append them when needed, like in the onAnimateInComplete method, but I don't want to do this, and kind of nullifies the point of using a main timeline...any suggestions? THANKS!
  4. Hello, Club member here, I am trying to use a TimelineMax as a queue for a series of animations/tweens. I want to be able to append a series of TweenCore objects (TweenMax or Lite OR TimelineMax or Lite) to a main timeline at once. On the completion of each child of the main timeline, I need to pause the main timeline, do some stuff, then call resume on the main timeline to continue firing the cued TweenCores. How can I automatically pause or call a method on completion of the main timeline's child? It appears the onComplete functions of a nested Tween or Timeline are called too late, and therefore I cannot pause the main timeline from an event or method of the nested TweenCore...the next child of the main timeline begins to play BEFORE the nested TweenCore's onComplete method is fired. Thanks! sd
  5. Thanks so much, duration - currentTime used in an onUpdate function did it!
  6. Hello, Is there anyway to get the value of the time remaining in a tween every time the onUpdate event fires? If my tween is tweening over 10 seconds, I want to see the time value decreasing, etc. Thanks!
  7. Well, actually, my attempt above doesn't work that well, randomly the characters don't arrive at the original x/y... I'm sad... back to the drawing board...
  8. Ahh, this works: for (var i:int = 0; i < stf.textFields.length; i++) { origX.push(stf.textFields[i].x); origY.push(stf.textFields[i].y); stf.textFields[i].x = Math.random() * 650 - 100; stf.textFields[i].y = Math.random() * 350 - 100; } for (i = stf.textFields.length - 1; i > -1; i--) { TweenMax.to(stf.textFields[i], .6, {x:origX[i], y:origY[i], ease:Quad.easeIn}); } It'll do for what I'm trying to do, but is there an array of original props, er something? Thanks!
  9. Hello, We bought into the club, yah! So, using the SplitTextField, I'm trying to tween text into place from random x/y coords - I can see from your example how easy it is to tween TO a random location: // from the documentation: for (var i:int = stf.textFields.length - 1; i > -1; i--) { TweenMax.to(stf.textFields, 1, {blurFilter:{blurX:10, blurY:10}, x:Math.random() * 650 - 100, y:Math.random() * 350 - 100, scaleX:Math.random() * 4 - 2, scaleY:Math.random() * 4 - 2, rotation:Math.random() * 360 - 180, autoAlpha:0, delay:Math.random() * 0.5, ease:Quad.easeIn, repeat:1, yoyo:true, repeatDelay:1.2}); } ...But to tween text INTO place from a preset random location escapes me - I've taken a quick look through the SplitTextField to see if the original x/y props of each split-created textfield are stored somewhere so I can use them to tween to...but can't seem to see if these values are saved somewhere... Any advice? Thanks, sd
  10. Hello, I'm trying to tween a movie clip forwards and backwards within a range of say 30 frames. Complicating the issue is that I want to tween half that range in reverse from from the first frame, jump to the last frame, then tween backwards half the the range - in otherwords, if my movieclip is 120 frames long, the actual range I want to use to tween is from 1 to 15 AND from 120 to 105, so that means tween forward from frame 1 to 15, but tween in reverse from 120 to 105. Problem is I can't figure out how to get TweenMax to jump to frame 120 without wanting to tween forward from 1 to 120. Any ideas on how to accomplish this? Thanks! sd
  11. Ok, thanks so much. Working in a team here, thought the plugin was plugged-in. I figured that if, when using TweenLite, you attempted to use a plugin not loaded, an error would be thrown, etc. Thanks! sd
  12. Greetings, I'm trying to tween a movieclip to a given frame and stop the tween once it reaches that frame. I tried this: TweenLite.to(mc, .7, {frame:goToFrame}); ...but once it reaches the frame, the movieclip just keeps playing, cycling. I tried putting stop(); commands in an actions layer in the movieclip to see if that would do it, but no dice. What's the dealio? Thanks! sd
  13. Hello, I'm tweening the width and height of a Sprite. I want to send the mid-tween width and height values of that Sprite to another function, where those values will be referenced to proportion another display object. I thought I could use the onUpdate function, figuring that every time it is called during the tween, that the values of mySprite.width and mySprite.height would equate to the Sprite's mid-tween width/height. But I simply get the original width and height over and over again until the tween ends. I was trying this: public function tweenSprite(e:MouseEvent):void { // say that the Sprite's original w/h is 60x60px TweenLite.to(mySprite, 1, {width:400, height:400, onUpdate:myUpdateFunction, onUpdateParams:[mySprite.width, mySprite.height]}); } // update function public function myUpdateFunction(width:Number, height:number):void { trace(width); } So, say the Sprite is originally 60x60px, and I am tweening it to 400x400px, I thought the myUpdateFunction method would receive increasing width/height values every time onUpdate is called, but instead I get the Sprite's original proportions, 60px, over and over again until the Sprite is finished being tweened. Any ideas on how to get the mid-tween proportions? Thanks, sd
×
×
  • Create New...