# Using a variable name to address a movie clip

**URL:** <https://forum.kirupa.com/t/using-a-variable-name-to-address-a-movie-clip/172786>\
**Category:** Uncategorized\
**Created:** [December 17, 2005, 11:37pm UTC](https://forum.kirupa.com/t/using-a-variable-name-to-address-a-movie-clip/172786 "2005-12-17T23:37:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RASMedia](https://avatars.discourse-cdn.com/v4/letter/r/ecae2f/32.png) [@RASMedia](https://forum.kirupa.com/u/RASMedia)\
**Post date:** [December 17, 2005, 11:37pm UTC](https://forum.kirupa.com/t/using-a-variable-name-to-address-a-movie-clip/172786/1 "2005-12-17T23:37:02Z")

</div>

I’m stuck on how to refer to a movieclip’s name through a variable.

If I set root variable “currentMovie = bigRed\_mc;”, how can I use that variable name to instruct the movie to address the movie clip name stored in said variable?

for instance “\_root.currentMovie.gotoAndPlay(“destroy”);” wouldn’t work because it would simply look for that movie clip name and come up empty.

I thought "\_root[currentMovie]gotoAndPlay(“destroy”); would work, with or without parenthesis, but it comes up with syntax errors either way. Can you use a variable to store and refer to a movie clip name and it’s properties? If so, what is the proper syntax?

Thanks in advance for any help!

:m2:
