I stumbled upon some.. well, let’s say “feature” of handling Timeline-Tweens within the Flash IDE. The following “feature” might be somehow confusing and it’s a bit tricky to fix.
I’m talking of a Timeline-Tween which gets broken when changing the clip’s properties while tweening.
I had to face this the last time a designer build up a liquid SWF which had an intro-animation animated on Flash’s timeline and repositioned itself fullscreen. So the intro started and if you’re resizing the browser WHILE this the animation stops. Pretty annoying for my designer but nevertheless we had to fix that. The most frustrating is that the tween doesn’t even start if you’re changing any property on the animation’s first frame which made it basically impossible to say “You’re starting at top left, doing your animation there!” as the change of position will prevent the tween from starting even if it’s written on the first frame.
The reason why that is happening is because of Flash’s way to export a tween – btw. it doesn’t matter whether it’s a Motion Tween or a Classical. The Tween is exported as an instance of Flash’s native Tweening Class. As this Class doesn’t cover overwrite- or extendfeatures (like e.g. TweenLite has) the instance gets ripped off by changing any property from outside. This can be a bug or a feature as it’s on the one hand pretty performance-spending but on the other a bit annoying. Anyway, let’s see how to fix that.
The easiest way would be of course using another Tweening Engine but telling a designer to do so is like feeding an ant with peanuts. Won’t work that fine.
The more handy way for a designer is to nest the MovieClip into another and position this top-MC then. This will make timing of complex animations a bit harder but you can reposition items while they are animated on the timeline – good call. So e.g. animate a MovieClip on your timeline, put that MovieClip into another and let it have the space on timeline he needs for the complete animation. Now you can change any property of that “Mother”-Clip (which of course will affect the children) without crashing the animation.
That’s it.



April 27th, 2010
Marvin Blase
Posted in
Tags:
I was really, really hoping this would help me – but it didn’t!
I’m doing what seems to be the same thing – I have a Motion Tween set up of a figure – the head, arms, body, and legs are all animated on the timeline, of their own movie.
Everything works well… until I run a function that tells each body part to go to a new frame. Then the animation stops – thought tracing “currentframe” shows that the movie clip is still going through the frames.
So there’s a bodyClip with all the parts animated – and each of those parts is told (by this function, when it’s run) to go to a specific frame – so there are 5 heads, five hands, etc. and I need to change them.
I tried your technique – putting the bodyClip into another movie clip, then making the function address that master movie clip first – but it didn’t work. And yes, I’m more of a designer than a programmer, so doing subtle character animations with tons of keyframes is not going to work with a tweening engine – not the way I want it to, anyway.
Any suggestions? I’m really experienced with AS2, very new to AS3 and I’m having all the standard problems – it’s frustrating as heck.
Yea, that´s definetly frustrating. Well, jumping frames causes the whole clip to initialize again so I think this setup won’t work. What would work though is exchanging the bitmaps in the appropriate clip instead of jumping to a different frame. I probably would remove the current headbitmap (WITHIN the headClip) and add (there) a new one.
Give it a try and tell me if it helped :)
Oh, I get what you’re saying… what a huge pain that would be. They’re not bitmaps – it’s all vector information – but still…
I will give it a try, if nothing else works. Oh, AS3… you cause me pain.
Thanks, Martin.
Well, if they’re Vectors just convert them to symbols and export them for Actionscript (I’ve got an article about that “My Daily Work with Assets” – the first paragraph shows how to. Then just add them into the headClip with addChild(new Head01()); The current one can be removed with headClip.removeChildAt(1) e.g. – depends on your DisplayList there. But yea, actually that should do the trick already.
Switching to AS3 from AS2 is a hellish pain in the a.., that´s true. :)
It’s a bit more complex and involved than that, Marvin – I actually had a breakthrough this weekend, and I’ll recommend it to anyone else in this situation:
Problem:
When creating a timeline-based character animation (multiple body parts on multiple layers) in Flash using AS3, addressing the x, y, scale, and other properties (though gotoAndPlay does not have this effect) causes the animation to freeze at runtime.
Solution:
Create an avatar – a puppet animation – and animate it on the timeline. Make sure each body part is labeled. I called mine puppet1 – the head, body, arms, and legs were all animated using subtle animation technique – motion tweens ease in and out, parts rotate slightly, x/y scale changes slightly, and the x/y positions of the parts change. The keyframes are not even all synced. A true nightmare, but…
Create your real character animation movieclip – it can even be the same mc as the puppet, but named mc1.
Using onEnterFrame, constantly update the properties (x/y positions, x/y scale, rotation, etc.) of mc1 based on puppet1:
mc1.head.x = puppet1.head.x;
mc1.head.y = puppet1.head.y;
mc1.head.scaleX = puppet1.head.scaleX;
mc1.head.scaleY = puppet1.head.scaleY;
mc1.head.rotation = puppet1.head.rotation;
And just keep your puppet1 mc out of view – invisible or offscreen.
This way, a character animator can do all the subtle, intuitive things a timeline based animation allows for – and those motions will all be mimicked (just like motion capture) by the real character.
If anyone is able to use this, please let me know. It’s working just fine for me now.
And thanks, Marvin, for having this forum that forced me to keep thinking about my problem!
Hey Steve,
sounds good – thanks a lot for sharing your solution! I’ll update the article above once I’ve tested it. Would that be okay for you? (Of course I’m gonna mention you.)
Oh sure – give it a shot.
I’ll add that my situation is even more complex – the positions and scales of each body part is being pulled in from a database – for multiple characters, each created by a user.
So since I initially move the x and y positions and scales – I can’t just match the x/y positions and scales of the puppet – I also have offset them from the initial settings.
I hope that makes sense – all one more reason why no other solution would have been reasonable for me.