How do i create new labels dynamically with actionscript in a for loop

Hello!

I am trying to write code to read from an xml file which i have done succesfully and create new labels each time the code loops that would have as text the data in the xml file.

i want the first label to have as text Kelly Maker, the 2nd as Mike Grundvig and so on.I also want all the labels to move across the stage just as the first one does.

What i have now is a single text that shows the last name which is Freed Maker. i tried using the duplicateMovieClip but all it did was to create 2 static labels (that dont move as i want it) that have as text undefined.

Please help me out here.

Helena

XML

<MyFriends>
<Name Gender=“female”>Kelly Makar</Name>
<Name Gender=“male”>Mike Grundvig</Name>
<Name Gender=“male”>Free Makar</Name>
<Name Gender=“male”>Freed Makar</Name>

&lt;/MyFriends&gt;

Action Script

var i:Number = 0;
for (var aNode:XMLNode = xmlFile.firstChild.firstChild.nextSibling; aNode != null; aNode=aNode.nextSibling)
{

     if (aNode.nodeType == 1) {
    

            duplicateMovieClip ("my_label",my_label, i);
            
                
            my_label.text = aNode.firstChild.nodeValue;
            trace(my_label.text);
            my_label.visible = true;

var xPost:Tween = new Tween(my_label, “_x”, Regular.easeOut, 450, -100,20, true);

}

i++;
}