UNENDED:BLOG

Parents, Children and Listeners in Flash

The biggest hang-up that I see developers get into is the tight coupling of different objects and classes in their Flash project. For example, one movie clip will contain two other child clips. These child clips will in turn directly call methods on the parent clip, that then call something else, and then call something else…. it just keeps going this way. Doing this ends up leaving you end up with a bunch of crossed wires, and eventually you’re dealing with something that’s very fragile to work with.

Parent and Child Objects

I try to follow one primary rule when it comes to this sort of thing: Parents can directly tell children what to do; children can only tell them that something with them occurred.