# Movie Clips in for loop

**URL:** <https://forum.kirupa.com/t/movie-clips-in-for-loop/281217>\
**Category:** flash\
**Created:** [February 6, 2009, 2:33am UTC](https://forum.kirupa.com/t/movie-clips-in-for-loop/281217 "2009-02-06T02:33:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alemieux34](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@alemieux34](https://forum.kirupa.com/u/alemieux34)\
**Post date:** [February 6, 2009, 2:33am UTC](https://forum.kirupa.com/t/movie-clips-in-for-loop/281217/1 "2009-02-06T02:33:30Z")

</div>

I’ve got a MovieClip with a linkage name of trackInfo. I’m trying to get XML information in a for loop to create and populate instances of the MovieClip for the length of the XML file.

Here’s what I have so far:

```auto

var myXML:XML;
var myURL:URLRequest = new URLRequest("tracks.xml");
var myURLLoader:URLLoader = new URLLoader(myURL);
myURLLoader.addEventListener(Event.COMPLETE, processXML);

function processXML(e:Event):void {
    myXML = new XML(e.target.data);
    
    // Can't use the function until the entire XML file is loaded
    // stage.addEventListener(Event.ENTER_FRAME, flipPage);
    for (var i:int = 0; i<myXML.track.length(); i++) {
        trace(myXML.track*.attribute("artist"), myXML.track*.attribute("album"), myXML.track*.attribute("song"));
        var newPage:CreatePage = new CreatePage(myXML.track*.attribute("artist"), myXML.track*.attribute("album"), myXML.track*.attribute("song"));
        
        var trackInfoField:trackInfo = new trackInfo();
        trace(trackInfoField);
        this.trackInfo1.addChild(newPage);
    }
}

```

I thought I could do something like this:

```auto

this.trackInfo*.addChild(newPage);

```

But it’s flaggin an error. Any suggestions?
