Problem with xml and actionscript

Hi everybody!

I’m new on this forum and was wandering if someone could help me with a problem.

I’ve need to attach several movieClips with textfield on the stage. Those movieClips then need to load information from a xml file into those textfiels. The only thing is that every
movieClip needs to draw different information out of the XML file.

I know how to create and attach the movieClips to the stage. And how I can draw information out of the XML file. Every attached movieClip is getting it’s own instance name of c1 to c25. And of course when i want to insert the information from the xml file i use:

nRoot.contentMain.c1.name.text = xmlObject.attributes.name;

The only thing is that the next movieClip will be called nRoot.contentMain.c2.name
So I want the script to automatically change the number into the next number.

I’ve tried this using a for statement. But this doesn’t seem to work. I tried this:

var i = 0;
for(i=0;i<totalProducts;++i){
nRoot.contentMain.c+i.name.text = xmlObject.attributes.name;
}

Where totalProducts is a number that the script uses to see how many products the xml file has.

I hope someone can help me.

Thanks in advance.
Greets GlitchFF