Here's the problem: I'm animating a stick-figure riding a skate board. The head, each leg, each arm, the body, the board, and the ground are all on separate layers. It's animated so that the board stays more or less in the same place, while the ground moves past the vantage point.
The problem I'm having is that if I tween any two parts of the body at different rates (using the Ease function), I can't get any third body part to stay linked to both of the first two at the same time.
Is there a way to anchor points of different objects (I'm not using symbols for the body parts because I need to be able to make the arms bend, etc) to points on other objects, on other layers, so that they stay together during tweening, regardless of pacing discrepancies?
I'm not explaining this very well, I know, but if anyone has a clue what I'm getting at and how to help, I'd be much obliged.
Posts
That is... tricky.
You're basically talking about tweening a single symbol on two seperate axis. The short answer is no.
Especially not with the Tween class.
You might want to investigate rotation, I can't remember if Movie Clips have some sort of built-in rotation property. But even with Rotation it will take a lot of micromanagement to get it right, if at all. And it's not going to give you multi-point stuff like bending...
You'd have to separate the body parts even further into joints and then try to attempt a _rotation adjustment. For example, upper arm and lower are would be two different symbols with separate rotation.
Double checking, _rotation is a property of the Movie Clip class, go go go.
P.S. you are using symbols for the body parts whether you like it or not, any Tween has to belong to at least a Graphics symbol, Flash will dynamically create them if you don't.
One technique that might make it easier, but not perfect, is to change the transformation points on your objects. If you select an object with your Free Transform tool (the one selected in this picture), you'll notice a small white circle in the middle of the object. This circle is the reference point for any transformation you apply to the object, be it translation, rotation, or scale. So, if you put the transformation point on the end of one of the "limbs" and attach it at a "joint", you can take a lot of the guesswork out of keeping stuff connected. Try to define a heirarchy; have the head connect to the body at the neck, the arms to the body at the shoulders, and the legs at the end of the body. When you do a tween, make sure that everything's in the same position relative to everything else that it was when you started. (For instance, make sure that the arms are still connected to the shoulder at the same spot.)
You're still going to have to do a lot of painful custom positioning, though, since everything's on a different layer. It's one of the inherent limitations of Flash, unless they've added something since the version I have came out (I'm using MX Professional 2004).
I'm actually not using action script at all unless right-click+"create motion tween" qualifies as that. (Not saying that to be sarcastic -- I honestly don't know).
I've been trying to make sure I do that, and it works extremely well as long as no two objects in the tween are paced differently (eased differently) over the course of the same number of frames.
But, for instance, I've got one portion where the head and legs are each tweened for six frames, and over the course of that tween, I did the body frame-by-frame. Now when I try to tween the arms, the shoulders won't stay connected to the body over the course of these six frames, because it's not all one tween on the body layer.
If you are going to get accurate joint/limb movement, off the top of my head, this is probably how I would look at doing it:
Create a new symbol, draw your upper arm. Place the shoulder joint at the center of the MovieClip.
Create another symbol, draw your lower arm, place the elbow joint at the center of the MovieClip.
Then, you MIGHT be able to place some sort of mini-symbol, like a 1px by 1px invisible dot inside of the Upper Arm MC and use that to reference the location of it so you can place your Lower Arm elbow joint.
I'm not sure if you can track the x and y stage location of a nested symbol, but if you could, that's how I would do it.
By doing that you will have two separate symbols which you can rotate independently and they will automatically stick together at the appropriate place. Giving you a reasonable looking arm.
This is just theoretical, I haven't actually tried to do it.
Make a movie called 'Skateboarder'
Inside that movie, make other movies called "leftArm', 'rightArm', 'leftLeg', 'RightLeg', 'torso', 'head' etc. from a drawing of each body part.
Now position each movie clip inside 'skateboarder' where they should be.
Next, go inside each body part's movie clip and animate the body part on the timeline from in there in a static position. So have the arms flopping about, head lolling, legs bending and straightening etc. but don't have anything moving horizontally or vertically.
Now climb back out to the root timeline and animate the 'skateboarder' movie clip along that timeline to have it jump, roll sideways, whatever.
That way, it'll be a lot easier to control the link points for the limbs on the body as your keeping your shape tweens and motion tweens completely separate. I think that should work.