# Trying to target a movie clip on parent timeline

**URL:** <https://forum.kirupa.com/t/trying-to-target-a-movie-clip-on-parent-timeline/419812>\
**Category:** flash\
**Created:** [December 11, 2014, 2:52am UTC](https://forum.kirupa.com/t/trying-to-target-a-movie-clip-on-parent-timeline/419812 "2014-12-11T02:52:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eddie\_E](https://avatars.discourse-cdn.com/v4/letter/e/2acd7d/32.png) [@Eddie\_E](https://forum.kirupa.com/u/Eddie_E)\
**Post date:** [December 11, 2014, 2:52am UTC](https://forum.kirupa.com/t/trying-to-target-a-movie-clip-on-parent-timeline/419812/1 "2014-12-11T02:52:12Z")

</div>

Hi I have the following:

` 
koala1_mc.addEventListener(MouseEvent.CLICK, koala1);
koala1_mc.buttonMode = true;
koala1_mc.useHandCursor = true;
function koala1(e:MouseEvent):void
{	
MovieClip(parent).game1_mc.gotoAndPlay(“koala1”);
}
`

Trying to access a label within the game\_mc movieclip on the timeline but receive #1009 error. What am I don’t wrong here?

Thanks

Eddie

---

<div class="post-metadata">

**Author:** ![krilnon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/krilnon/32/34_2.png) [@krilnon](https://forum.kirupa.com/u/krilnon)\
**Post date:** [December 11, 2014, 6:44am UTC](https://forum.kirupa.com/t/trying-to-target-a-movie-clip-on-parent-timeline/419812/2 "2014-12-11T06:44:15Z")

</div>

Is the parent actually a MovieClip? What line is the error occurring on?

---

<div class="post-metadata">

**Author:** ![Eddie\_E](https://avatars.discourse-cdn.com/v4/letter/e/2acd7d/32.png) [@Eddie\_E](https://forum.kirupa.com/u/Eddie_E)\
**Post date:** [December 11, 2014, 9:59pm UTC](https://forum.kirupa.com/t/trying-to-target-a-movie-clip-on-parent-timeline/419812/3 "2014-12-11T21:59:58Z")

</div>

So the movie clip I am trying to access is on the root timeline (frame 4). The koala1\_mc is in an additional movie clip on frame 3. I just need to come out this movie clip and go into the movie clip (game1\_mc) on frame 4 and play the label (“koala1”)… the full error I receive is:

` TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Xmas2014_fla::Main_cavemain_34/koala1() </code`

Any ideas?

Thanks

Eddie

---

<div class="post-metadata">

**Author:** ![krilnon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/krilnon/32/34_2.png) [@krilnon](https://forum.kirupa.com/u/krilnon)\
**Post date:** [December 12, 2014, 5:21am UTC](https://forum.kirupa.com/t/trying-to-target-a-movie-clip-on-parent-timeline/419812/4 "2014-12-12T05:21:25Z")

</div>

Ah. Objects on future frames aren’t going to be accessible beforehand. Something more like this might work:

```javascript
function koala1(e:MouseEvent):void {
    addFrameScript(3, function(){ 
        root['game1_mc'].gotoAndPlay('koala1') 
    })
}

```

And you still need some code to tell the root playhead to go to frame 4, I’d guess. The code above just sets up a handler that runs on frame 4 (0-indexed to 3).

---

<div class="post-metadata">

**Author:** ![Eddie\_E](https://avatars.discourse-cdn.com/v4/letter/e/2acd7d/32.png) [@Eddie\_E](https://forum.kirupa.com/u/Eddie_E)\
**Post date:** [December 15, 2014, 3:12am UTC](https://forum.kirupa.com/t/trying-to-target-a-movie-clip-on-parent-timeline/419812/5 "2014-12-15T03:12:56Z")

</div>

thanks this helped me get it to work

Eddie
