# Assign MovieClip instance name to variable

**URL:** <https://forum.kirupa.com/t/assign-movieclip-instance-name-to-variable/324187>\
**Category:** flash\
**Created:** [August 7, 2011, 1:55pm UTC](https://forum.kirupa.com/t/assign-movieclip-instance-name-to-variable/324187 "2011-08-07T13:55:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![torotune](https://avatars.discourse-cdn.com/v4/letter/t/e9a140/32.png) [@torotune](https://forum.kirupa.com/u/torotune)\
**Post date:** [August 7, 2011, 1:55pm UTC](https://forum.kirupa.com/t/assign-movieclip-instance-name-to-variable/324187/1 "2011-08-07T13:55:57Z")

</div>

Hi,

Does anyone know how I can assign a movieclip instance name to a variable, so that I can use reference it?

For example:

var mcName:String = “box2\_mc”  
mcName.play();

It wont work and I get the error:

1061: Call to a possibly undefined method play through a reference with static type String.

Should I define it as another datatype?

Best regards.
