# Dynamically adressing an existing MovieClip on Stage

**URL:** <https://forum.kirupa.com/t/dynamically-adressing-an-existing-movieclip-on-stage/312599>\
**Category:** flash\
**Created:** [August 8, 2010, 4:30pm UTC](https://forum.kirupa.com/t/dynamically-adressing-an-existing-movieclip-on-stage/312599 "2010-08-08T16:30:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![2c1](https://avatars.discourse-cdn.com/v4/letter/2/ea666f/32.png) [@2c1](https://forum.kirupa.com/u/2c1)\
**Post date:** [August 8, 2010, 4:30pm UTC](https://forum.kirupa.com/t/dynamically-adressing-an-existing-movieclip-on-stage/312599/1 "2010-08-08T16:30:47Z")

</div>

Hi there

I am pretty new to AS3 and try to solve the following problem.  
I am loading an external XML file. According to the information loaded from the file I would like to highlight a symbol (MovieClip) when I press a corresponding button. The Button and the MovieClip change every time I load a new XML, so it has to be dynamic.

I tried the following, but that doesn’t work, does anyone know why?

I have an Array defined (a\_HighlightArray) that I fill within a loop to hold the object (as a string! :ne:) that is supposed to be highlighted when I press the corresponding button:

```
a_HighlightArray* = "o_Map.o_Privatwelt.o_Layer4";

```

Later, when I want to address the Symbol I am using the following (where Quest corresponds to the No of the button I pressed):

```
[a_HighlightArray[Quest]]gotoAndStop(2);

```

There is no error that comes up but it just doesn’t do what expected. Strangely enough, if I address the Symbol directly it works perfectly fine:

o\_Map.o\_Privatwelt.o\_Layer4.gotoAndStop(2);

Any ideas? I appreciate your help!

2c
