Trying to target a movie clip on parent timeline

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

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

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

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

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).

thanks this helped me get it to work

Eddie