# Quick One - hittest, gotoandplay, \_parent

**URL:** <https://forum.kirupa.com/t/quick-one-hittest-gotoandplay--parent/65908>\
**Category:** Uncategorized\
**Created:** [September 30, 2004, 3:02pm UTC](https://forum.kirupa.com/t/quick-one-hittest-gotoandplay--parent/65908 "2004-09-30T15:02:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![basefetish](https://avatars.discourse-cdn.com/v4/letter/b/5e9695/32.png) [@basefetish](https://forum.kirupa.com/u/basefetish)\
**Post date:** [September 30, 2004, 3:02pm UTC](https://forum.kirupa.com/t/quick-one-hittest-gotoandplay--parent/65908/1 "2004-09-30T15:02:40Z")

</div>

After the HitTest, How do I use the gotoAndPlay to direct the the main timeline to goto frame 2, and not frame 2 of \_root.circle MC? with \_parent?

I know this might be a simple question, but my brain hurts from the previous ‘debugging’…

both of these give me the same results.

onClipEvent (enterFrame) {  
if (\_root.circle.hitTest(\_root.box1)) {  
gotoAndPlay(2);  
;  
}  
}

onClipEvent (enterFrame) {  
if (\_root.circle.hitTest(\_root.box1)) {  
gotoAndPlay(“Scene 1” , 2);  
;  
}  
}

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 30, 2004, 3:14pm UTC](https://forum.kirupa.com/t/quick-one-hittest-gotoandplay--parent/65908/2 "2004-09-30T15:14:14Z")

</div>

```auto
_root.gotoAndPlay(2);

```

personaly I prefer relative paths like:

```auto
this._parent.gotoAndPlay(2);

```

but that’s just my choice

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 30, 2004, 3:26pm UTC](https://forum.kirupa.com/t/quick-one-hittest-gotoandplay--parent/65908/3 "2004-09-30T15:26:20Z")

</div>

THANKS!

I knew it was simple, and yes the relative path works with my brain better…

g

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 30, 2004, 3:27pm UTC](https://forum.kirupa.com/t/quick-one-hittest-gotoandplay--parent/65908/4 "2004-09-30T15:27:16Z")

</div>

:}

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 30, 2004, 4:06pm UTC](https://forum.kirupa.com/t/quick-one-hittest-gotoandplay--parent/65908/5 "2004-09-30T16:06:55Z")

</div>

Helpful tip: never say one more thing…

so I have everything working, it goes to the next frame and plays, yet my actions from frame one seem to be still running even though the are not in frame two. the debugger tells me:

Error: A ‘with’ action failed because the specified object did not exist.

which could only be reffering to my function in frame 1, since it ceasts to exist on frame 2.

Is there a way to cease the onenterframe function on the hittest clipevent? or is it automatic and my code is not quite right…(more than likely since I am hacking my way through actionscript)

THANK YOU THANK YOU THANK YOU
