# Nesting Sprite Objects

**URL:** https://forum.kirupa.com/t/nesting-sprite-objects/227747
**Category:** flash
**Created:** [June 1, 2007, 6:23pm UTC](https://forum.kirupa.com/t/nesting-sprite-objects/227747 "2007-06-01T18:23:51Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![douglaae](https://avatars.discourse-cdn.com/v4/letter/d/c89c15/32.png) [@douglaae](https://forum.kirupa.com/u/douglaae)
#### Post date: [June 1, 2007, 6:23pm UTC](https://forum.kirupa.com/t/nesting-sprite-objects/227747/1 "2007-06-01T18:23:51Z")

</div>

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
