<p>I'm trying to be responsible with my "DOM" references in this little Flash 8/AS2 project.</p>

<p>What has become increasingly frustrating is obtaining references to other movie clips and objects.  For example, currently my code to access the submit button of a form looks something like this</p>

<pre><code>var b:Button = _level0.instance4.submitBtn;
</code></pre>

<p>I was hoping there was an instance-retrieval method for AS2 similar to AS3's <code>MovieClip.getChildByName()</code> or even Javascript's <code>document.getElementById()</code>.  Because hard-coding the names of these anonymous instances (like <code>instance4</code> in the above) just feel really, really dirty.</p>

<p>But, I can't find anything of the sort at <a href="http://flash-reference.icod.de/" rel="nofollow noreferrer">this AS2 Reference</a>.</p>

If the MovieClip was placed on the stage in the Flash IDE, you can give it a proper instance name in the properties panel.
If it was dynamically added, you can also give it a name, and additionally store a reference:
```
```
var my_MC=createEmptyMovieClip("instanceName", depth);
```
```
In either case, you can then adress them with
```
_parentClip.instanceName
```
or
```
my_MC.
```