Skip to main content
Participating Frequently
April 8, 2014
Question

Animate a character with Flash environment + AS3

  • April 8, 2014
  • 1 reply
  • 2401 views

Hi !

This is a trouble I've been facing for YEARS, and no way for me to solve it. Save me my heros.

I'm trying to animate a character with Flash whose face can be changed.

So I have a Character MovieClip in which I have 4 frames. In each frame there is an animation of the little guy : one going down, one going left, right, and up.

In each animation there is the MovieClip Head in which you can attach a hat, sunglasses, hair etc... Am I clear enough ?

http://blanchi-street.com/images/faBup.png

Here is the problem : since the head is going to be changed by the player, the MovieClip Head MUST have the same reference in each frame in each animation. Unfortunatly, Flash thinks the MovieClip Head is a new one on each animation of the little guy running. So for instance, if I attach sunglasses on the clip Head, then they will disappear as soon as the character will change his direction since Flash doesn't know the Head I'm using in the new animation isn't a new one.

What am I doing wrong ?

If I'm not clear enough, please tell me. I REALLY want to understand how to make such a thing on Flash.

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
April 8, 2014

remove the head movieclips from the 4 frames.

use addChild to add your head movieclip to your 4 frame movieclip.  position it appropriately depending on which of the 4 frames is being displayed.

KromahAuthor
Participating Frequently
April 8, 2014

Thanks for your reply! That's what I first wanted to do. The problem is that the movieclip Head has to move during the animation, so I can't just simply attach it with a constant position. How would you solve it?

Amy Blankenship
Legend
April 8, 2014

What you need to do is simply have your body be a Graphic symbol that is set to "play once". Put this inside a Character movie clip that is 4 frames long. Put the head in a separate layer that extends all 4 frames. Now, when your Character MC is in frame 1, you'll see frame 1 of the body, but the head will stay the same. When you go to frame 2, you'll see frame 2 of the body, and again the head will stay the same, etc.

For more on this, see Flash's Underrated "Graphic" Symbol. I'd also highly suggest How to Cheat at Adobe Flash, as it is a great exploration of the animator features of Flash.