# Referencing an object that exists later in the timeline?

**URL:** <https://forum.kirupa.com/t/referencing-an-object-that-exists-later-in-the-timeline/311474>\
**Category:** flash\
**Created:** [July 7, 2010, 6:07pm UTC](https://forum.kirupa.com/t/referencing-an-object-that-exists-later-in-the-timeline/311474 "2010-07-07T18:07:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Boreez](https://avatars.discourse-cdn.com/v4/letter/b/3be4f8/32.png) [@Boreez](https://forum.kirupa.com/u/Boreez)\
**Post date:** [July 7, 2010, 6:07pm UTC](https://forum.kirupa.com/t/referencing-an-object-that-exists-later-in-the-timeline/311474/1 "2010-07-07T18:07:53Z")

</div>

I’m trying to:  
[LIST]  
[_]Jump from frame 1 to a frame later in the main timeline  
[_]Reference an object that exists on the stage in that frame, but not in frame 1  
[/LIST]

Like so:

```auto

function endGame():void {
  gotoAndPlay("gameOver");
  scoreField.visible = false;
}

```

A movieclip with the instance name ‘scorefield’ exists in the “gameOver” frame, yet for some reason, I just get a “Cannot access a property or method of a null object reference.” This code is all within a function. By the time the reference to scoreField is executed, the timeline is at the right frame.

This goes for all objects I try to reference this way. Any ideas?
