# Using variable value to refer to a movieclip on stage

**URL:** https://forum.kirupa.com/t/using-variable-value-to-refer-to-a-movieclip-on-stage/196432
**Category:** flash
**Created:** [August 8, 2006, 11:42am UTC](https://forum.kirupa.com/t/using-variable-value-to-refer-to-a-movieclip-on-stage/196432 "2006-08-08T11:42:20Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![craigjr](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@craigjr](https://forum.kirupa.com/u/craigjr)
#### Post date: [August 8, 2006, 11:42am UTC](https://forum.kirupa.com/t/using-variable-value-to-refer-to-a-movieclip-on-stage/196432/1 "2006-08-08T11:42:20Z")

</div>

Basically I have a variable in which I store various numbers depending on other aspects of the flash movie and I have a bunch of movieclips that are on the stage all named by number.  
I want to use the variable value to access and run methods etc of these movieclips.

e.g.

var myVar = “10”;

myVar.myFunction();

where the item on stage called ‘10’ will react. I realise this is a confusion between a string and an object/movieclip reference but i’m almost certain ive done this before and ive got a feeling it had something to do with [] brackets on the end of something…

sooo frustrating when you can’t remember stuff
