<p>Is it possible to get a list of all instances with a name in a flash movie using actionscript 2. Like an array containing all named text areas, or all movieClip instances etc. I would like to get this so the designer can add or remove text areas etc. and the actionscript can dynamically find these and get the texts from a separate datasource. </p>

<p>I guess what I want is something like a DOM tree or even better something like how getElementByName() works in JavaScript. And allso get the string value of the instance name so I can find it's text value in an xml.</p>

<p>Let's say the designer add a new text area with the name "copyright" and my code should (without having to change the script) find the data with the id "copyright" in an XML file if it is there, and add the value to the text area.</p>

It's been a while since I did any AS2 coding but perhaps you could use a combination of MovieClip.getInstanceAtDepth() and this.getNextHighestDepth() to find the highest depth in your movie then trace back through each lower depth until you find a getInstanceAtDepth() that corresponds to the clip you are looking to populate with new data.
I also noticed this example code in the AS2 documentation.
The following code traces the depth of all movie clip instances on the Stage:
```
```
for (var i in this) {
    if (typeof (this[i]) == "movieclip") {
    trace("movie clip '"+this[i]._name+"' is at depth "+this[i].getDepth());
    }
}
```
```
PS: I know you probably don't want to hear this but in AS3 it's a doddle as you can just iterate through this.children!