# Arrays and movieclips

**URL:** <https://forum.kirupa.com/t/arrays-and-movieclips/274894>\
**Category:** Uncategorized\
**Created:** [November 6, 2008, 10:13am UTC](https://forum.kirupa.com/t/arrays-and-movieclips/274894 "2008-11-06T10:13:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![d4st4rdly](https://avatars.discourse-cdn.com/v4/letter/d/97f17d/32.png) [@d4st4rdly](https://forum.kirupa.com/u/d4st4rdly)\
**Post date:** [November 6, 2008, 10:13am UTC](https://forum.kirupa.com/t/arrays-and-movieclips/274894/1 "2008-11-06T10:13:23Z")

</div>

I have a for loop that creates a set of movieclips(that have other movieclips, textfields etc in them) that are kept in an array. How do I reference the moviclips and textfields that are within the array’s movieclips?

I have no problem referencing the movieclips in the array, by using infoArray\*, it is the other dynamically added content that is embedded within the original movieclip.

Any help would be most welcome

Thanks

here is what I have

var infoArray:Array = new Array;  
var infoNum:Number = 10;

function addContent(){  
var textHolder:MovieClip = new MovieClip;  
container.addChild(textHolder);  
var heading1:TextField = new TextField();  
heading1.text = “HEADING”;  
textHolder.addChild(heading1);  
var heading2:TextFiled = new TextField();  
heading2.text = i;  
heading1.embedFonts = true;  
heading2.embedFonts = true;

var info:MovieClip = new mc\_infoPanel;  
container.addChild(info);

}

for (var i=1; i\<infoNum; i++){  
var space:Number = 2;  
var container:MovieClip = new mc\_container;  
container.x = ((space + container.width) \* i) - (space + container.width);

addContent();  
infoArray\* = container;  
}
