# Getchildbyname to reference

**URL:** <https://forum.kirupa.com/t/getchildbyname-to-reference/293461>\
**Category:** Uncategorized\
**Created:** [July 29, 2009, 10:45am UTC](https://forum.kirupa.com/t/getchildbyname-to-reference/293461 "2009-07-29T10:45:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dqws](https://avatars.discourse-cdn.com/v4/letter/d/e19b73/32.png) [@dqws](https://forum.kirupa.com/u/dqws)\
**Post date:** [July 29, 2009, 10:45am UTC](https://forum.kirupa.com/t/getchildbyname-to-reference/293461/1 "2009-07-29T10:45:31Z")

</div>

Right now I’m using the approach of storing in an array a bunch of names,  
and I access them by getchildbyname. when I last tried to use the oop style of storing a Sprite reference inside the array, I couldn’t access the properties of the class that was stored inside the array,

I though about doing something like cubeArray[Y][X].gotoAndStop(2);  
where y,x are variables, but it didn’t worked out well,

I tried to use the MovieClip(cubeArray[Y][X]).gotoAndStop(2);  
still didn’t work.

I wanted to use the “cubeArray[Y][X] as cube” where cube is my class name, but I’m not sure of how to use it.

Thankes in advance 😃
