Getchildbyname to reference

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 :smiley: