How do you nest Sprite objects inside parent Sprite objects?
From a previous post that Senocular answered, I found that the way to nest MovieClip objects inside one another is:
var parentClip:MovieClip = new MovieClip();
parentClip.childClip = new MovieClip();
parentClip.addChild(parentClip.childClip);
addChild(parentClip);
This is only possible because the MovieClip class is a DYNAMIC class. Sprite on the other hand is not declared as dynamic and therefore is a “sealed” class meaning that you can’t assign new variables to Sprite objects on the fly as in the above example. Sealed classes are much better for performance reasons as I understand because they “don’t need to maintain an in-memory hash table.” So, if I have, say, a menu that requires a hierarchical structure (nested Sprites), how would I create this?
Andy