# Problem with goto when calling getChildByName

**URL:** <https://forum.kirupa.com/t/problem-with-goto-when-calling-getchildbyname/231241>\
**Category:** flash\
**Created:** [July 3, 2007, 5:10am UTC](https://forum.kirupa.com/t/problem-with-goto-when-calling-getchildbyname/231241 "2007-07-03T05:10:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Toiletfreak](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/toiletfreak/32/2923_2.png) [@Toiletfreak](https://forum.kirupa.com/u/Toiletfreak)\
**Post date:** [July 3, 2007, 5:10am UTC](https://forum.kirupa.com/t/problem-with-goto-when-calling-getchildbyname/231241/1 "2007-07-03T05:10:34Z")

</div>

hi, I am using new to duplicate a movie clip (blabla). Works fine for .x , .y , etc but when I try gotoAndStop(11), with all the necessary code within that MovieClip, it fails.

Code is as shown below:

import flash.display.\*

var posX:int = 0;  
var testing = new Array();  
for (var i:uint=0;i\<10;i++) {  
var blabla = new Symbol1();  
blabla.x = posX;  
posX += 10;  
blabla.name = “b” + i;  
testing.push(blabla);  
addChild(blabla);  
}

trace(getChildByName(“b5”) is MovieClip)  
//this can work  
getChildByName(“b5”).x = 300

/\*this cannot work, gives error:  
1061: Call to a possibly undefined method gotoAndPlay through a reference with static type flash.display:DisplayObject.  
\*/

getChildByName(“b5”).gotoAndPlay(20);

Please help!! Thanks! 😏😏
