views:

15

answers:

1

So this question is (somewhat distantly) related to this previous question: http://stackoverflow.com/questions/2435039/best-way-to-be-able-to-pick-multiple-colors-designs-of-symbols-dynamically-from-f/2435101#2435101

I have a "person" so to speak, in flash, with a few different parts; head, pants, shirt and hat. There can be, for example, 10 different colors of shirts for the person. I've done a lot of the AS3 code behind it, but I'm awful in flash, and I've had a ton of trouble with this.

What I'm really trying got figure out (in vain) is how I can have basically a blank skeleton structure (i.e. I'm trying to have "blank" or "placeholder" symbols connected by Inverse Kinematics as bones) consisting of the pants, shirt, & head, and when I find out that shirt #6 needs to be on the person... put it in that placeholder. Does that make sense? That's the big problem. The other thing is that I've had nothing but trouble figuring out how to have, for example, one or two outlines of shirts, and when it sees shirt #6, it fills in that shirt with blue dynamically. But that might be for another question.

How I have it now: In AS3, each of the parts, the shirt, the pants, the head & hat, have their own custom classes behind movieclips, and for example, I've got it set up that the body contains the pants, shirt and head classes, and the head contains the hat class, etc.

A: 

You should look into the Decorator Design Pattern. Here's an article about it:
http://www.daveoncode.com/2009/03/30/learning-design-patterns-with-actionscript-3-episode-2-decorator-pattern/

PatrickS