开发者

Combining dynamic symbols/movieclips on 1 pre-existing skeleton/bone structure

开发者 https://www.devze.com 2023-01-21 01:00 出处:网络
So this question is (somewhat distantly) related to this previous question: Best way to be able to pick multiple colors/designs of symbols dynamically from flash

So this question is (somewhat distantly) related to this previous question: Best way to be able to pick multiple colors/designs of symbols dynamically from flash

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.


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/

0

精彩评论

暂无评论...
验证码 换一张
取 消