# How can I convert String to Array(Instance Name)?

**URL:** https://forum.kirupa.com/t/how-can-i-convert-string-to-array-instance-name/308339
**Category:** flash
**Created:** [April 21, 2010, 8:33am UTC](https://forum.kirupa.com/t/how-can-i-convert-string-to-array-instance-name/308339 "2010-04-21T08:33:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![vikramkute](https://avatars.discourse-cdn.com/v4/letter/v/90ced4/32.png) [@vikramkute](https://forum.kirupa.com/u/vikramkute)
#### Post date: [April 21, 2010, 8:33am UTC](https://forum.kirupa.com/t/how-can-i-convert-string-to-array-instance-name/308339/1 "2010-04-21T08:33:00Z")

</div>

how can I convert String to Array(Instance Name)?

The code below works fine.

```auto
var gridArray:Array = new Array(sq1_btn,sq2_btn);
gridArray[0].visible=false;
gridArray[1].visible=false;

```

but how can I pass a String to multiple buttons to this Array? (The String is too big and comes from outside of Flash)

```auto
//myData String comes from outside Flash
var myData:String = "sq1_btn,sq2_btn";
// Have to store myData String in gridArray
var gridArray:Array = new Array(myData);
gridArray[0].visible=false;
gridArray[1].visible=false;

```

can anybody help me to correct code above?

Thanks in Advance 🙂
