How to do Thing-thing-like animation

4 posts

Flag Post

This is actually a work-related question. I have a summer intern student who is working on a small research project with me at the university I work for. He’s creating a tool to test some things in young children, and part of that tool involves letting the kids “create” their own character and then watching it perform various tasks.

The best example of this type of animation that I’ve seen is Thing-Thing, or any of its clones that allow you to select a set of body parts and then does appropriate animation using the selected parts.

I would assume we would create a library of all body part options and let them select from that. My question is – how do you create animation and then set the animated items to be the desired library items (while still maintaining full character animation)? Is there simply some AS command that we can use to change the active movieclip?

I hope I’ve made my question clear – I’d be happy to clarify if it’d help. Thanks in advance.

 
Flag Post

My current (non-working) attempt is:


Character_mc.Head_mc.swapDepths(1);
Character_mc.Head_mc.removeMovieClip();
Character_mc.Head_mc.attachMovie(“Head2”,“Head2_mc”,this.getNextHighestDepth());

This successfully removes the movie that is created in the authoring tool (which is at a negative depth, and must be switched up to 1 to be removed), but the attachMovie doesn’t seem to work. It did work before I had the first two lines (so yes, it is linked properly for AS). In case it matters, I’m using Flash 8, but my student is on CS3 if there’s something in AS3.0 that would help.

Edit: Further experimentation shows that commenting out the removeMovieClip line still results in problems. The depth swap seems to clear out the animation. Grr…

 
Flag Post

Does the character perform the same tasks regardless of what it looks like?

I’m not too experienced with Flash, so this may be bad advice. But couldn’t you create one head movie clip and put all of the different head options in different frames within that movie clip? Then you could just use something like

Character_mc.Head_mc.gotoAndStop(2);

to change heads.

EDIT: Alternatively, have you tried changing the number passed into swapDepths() to something different?

 
Flag Post

It is going to be one pre-scripted animation. (well, a bunch of them, but all scripted). None of the animation is interactive, which will hopefully simplify. That’s an interesting idea with the frame-based switching. I’ll try that – thanks for the idea. Of course, if anyone knows a better way, that’d be cool too, but I think this might work. :-)

Edit: Actually, this seems to be a rather elegant solution the problem – and works quite nicely. Unless anyone knows of a reason why this would be a bad idea, I’m going to use it. Thanks faceless!