# What's wrong with the MovieClip.gotoAndStop()?

**URL:** <https://forum.kirupa.com/t/whats-wrong-with-the-movieclip-gotoandstop/289508>\
**Category:** Uncategorized\
**Created:** [June 1, 2009, 3:17am UTC](https://forum.kirupa.com/t/whats-wrong-with-the-movieclip-gotoandstop/289508 "2009-06-01T03:17:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![awflasher](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/awflasher/32/3562_2.png) [@awflasher](https://forum.kirupa.com/u/awflasher)\
**Post date:** [June 1, 2009, 3:17am UTC](https://forum.kirupa.com/t/whats-wrong-with-the-movieclip-gotoandstop/289508/1 "2009-06-01T03:17:19Z")

</div>

In a project, I need to pass in a DisplayObject to a container in a specified frame of a MovieClip. (for example a “container” instance at Frame 15)

I thought it should be just okay with this code:

```auto
**trace(mc.currentFrame);**
// Output 1 - we are at the first frame of this mc.

**mc.gotoAndStop(15);**
// Go to the frame where a container is made ready
// There is a container which has an instance name
// of "container" in this frame.

**trace(mc.currentFrame);**
// Output: 15 - [COLOR="Red"]That means the mc
                has reached the right frame already[/COLOR].

**trace(mc.getChildByName("container"));**
// **null** - why it's null? - or why it's "container"
   still NOT READY? How do I know when it's ready?
   I can use a Timer or somewhat to hack this logic but
   that's also a very bad logic.

```

Any tips for this situation? Thanks in advance!

Update: More information on this topic:

Just now I set up a Timer to track the “container” existence. The timer is set up as soon as the gotoAndStop is invoked. like this:

```auto
mc.gotoAndStop(15);
var timer:Timer = new Timer(1,1);

```

If the timer delay is set to 1, the container is still not available, but if it’s set to 100, it’s okay. Then I make this delay bigger and bigger, the threshold value is 25. (My FPS is 30)
