# Placing elements into a dynamically created movieClip

**URL:** <https://forum.kirupa.com/t/placing-elements-into-a-dynamically-created-movieclip/310989>\
**Category:** flash\
**Created:** [June 24, 2010, 5:22pm UTC](https://forum.kirupa.com/t/placing-elements-into-a-dynamically-created-movieclip/310989 "2010-06-24T17:22:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaioxung](https://avatars.discourse-cdn.com/v4/letter/j/dc4da7/32.png) [@jaioxung](https://forum.kirupa.com/u/jaioxung)\
**Post date:** [June 24, 2010, 5:22pm UTC](https://forum.kirupa.com/t/placing-elements-into-a-dynamically-created-movieclip/310989/1 "2010-06-24T17:22:46Z")

</div>

I am trying to create a navigation element. The items in the navigation are created dynamically from data in an XML file. What I would like to do is create a new movie clip then place all of the navigation elements into that movie clip so I can move it around as one piece.

Here is a simplified example of my code:

```auto

var navContainer:MovieClip = new MovieClip(); //clip to add elements to
addChild(navContainer);

//Create nav elements that I want inside navContainer//
	var reels:Array = [];

	function createReels():void {
		var reelPosX:Number = 336;
		for each (var titleElement:XML in titleList) {
			var reel:navReel = new navReel();
			addChild(reel);
			reel.width = 119;
			reel.height = 119;
			reel.x = reelPosX;
			reel.y = 10;
			reels.push(reel);
			
			reelPosX+=155;
		}
	}

```

I hope this makes sense. Thanks.
