# \[CS3/AS2.0\]MovieClip instance name to string ! how?

**URL:** https://forum.kirupa.com/t/cs3-as2-0-movieclip-instance-name-to-string-how/266904
**Category:** flash
**Created:** [July 25, 2008, 11:23am UTC](https://forum.kirupa.com/t/cs3-as2-0-movieclip-instance-name-to-string-how/266904 "2008-07-25T11:23:55Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![NoobGeek](https://avatars.discourse-cdn.com/v4/letter/n/58956e/32.png) [@NoobGeek](https://forum.kirupa.com/u/NoobGeek)
#### Post date: [July 25, 2008, 11:23am UTC](https://forum.kirupa.com/t/cs3-as2-0-movieclip-instance-name-to-string-how/266904/1 "2008-07-25T11:23:55Z")

</div>

Hello there , nice joinin the forum…I have a question for you dear folks!

I would like to pass the name of a movieclip to a string so my attachmovie method can work. what I m doin is :

[FONT=Courier New]function createBlocks( **slot** :MovieClip)  
{  
…  
…  
for (var i = 4; i \< 10; i++)//lines  
{  
grid[j] = new Array();  
for (var j = 0; j \< 9; j++)//columns  
{  
var bName = “block\_” + i + “\_” + j;  
holderClip.attachMovie( **slot** , bName, depth);  
…  
…  
}[/FONT]

when I call the above function on a keyframe I call it like :

[FONT=Courier New]this.createBlocks(block4);[/FONT]

block4 is the id name of a movieclip in the library.

the problem is that the attachMovie method needs a string as a parameter!

how can I convert that to a string? so afterwards, [FONT=Courier New] **slot** [/FONT] , has inside the name “block4” (with the quotation marks)
