# \_parent. or \_root.?

**URL:** <https://forum.kirupa.com/t/-parent-or--root/42234>\
**Category:** Uncategorized\
**Created:** [February 6, 2004, 7:13pm UTC](https://forum.kirupa.com/t/-parent-or--root/42234 "2004-02-06T19:13:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mhunki](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@mhunki](https://forum.kirupa.com/u/mhunki)\
**Post date:** [February 6, 2004, 7:13pm UTC](https://forum.kirupa.com/t/-parent-or--root/42234/1 "2004-02-06T19:13:42Z")

</div>

I have created a dropzone on the main stage where, when a dragged item is placed it deletes, basically a trash can.

All works fine with this code when both the item and the trash can are on the same level.

onClipEvent (mouseDown) {  
if (this.hitTest(\_root.\_xmouse, \_root.\_ymouse)) {  
this.startDrag();  
}  
}  
onClipEvent (mouseUp) {  
if (this.hitTest(\_root.\_xmouse, \_root.\_ymouse)) {  
this.stopDrag();

```
if (_root.dropzone.hitTest(this._x,this._y,true)) {
	unloadMovie(this);
}

```

}  
}

However the item a movieclip, is placed within a palette, another movie clip. I’ve tried variations of \_root. and \_parent. but can’t get it to function, anyone any ideas?

---

<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:** [February 6, 2004, 9:43pm UTC](https://forum.kirupa.com/t/-parent-or--root/42234/2 "2004-02-06T21:43:03Z")

</div>

What is the current code you are trying, with the mc inside another mc?

---

<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:** [February 6, 2004, 9:45pm UTC](https://forum.kirupa.com/t/-parent-or--root/42234/3 "2004-02-06T21:45:57Z")

</div>

for reference… these are my explinations for those terms

\_root the base timeline that contains all other timelines. If using different levels, it refers to \_level0.

\_parent the timeline which contains the timeline on which this code rests. In the case of code attached to a movie clip, treat such code as if it were on the timeline of that movie clip for addressing purposes.

---

<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:** [February 9, 2004, 8:54am UTC](https://forum.kirupa.com/t/-parent-or--root/42234/4 "2004-02-09T08:54:36Z")

</div>

The above code is attached to a movie clip, which is then placed inside a movie clip, that is then placed on the main stage. I understand the \_root, \_parent relationship (or thought I did) which is why this is even more frustrating. As I said, the clip works when on the main timeline, but when placed inside another clip it doesn’t. I’ve tried, \_root and \_parent, even \_parent.parent but still nothing.

---

<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:** [February 9, 2004, 9:26am UTC](https://forum.kirupa.com/t/-parent-or--root/42234/5 "2004-02-09T09:26:45Z")

</div>

[http://www.jumpto.co.uk/kirupa/test.fla](http://www.jumpto.co.uk/kirupa/test.fla)

this is the actual .fla, hope this explains things.

Cheers

---

<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:** [February 9, 2004, 10:48am UTC](https://forum.kirupa.com/t/-parent-or--root/42234/6 "2004-02-09T10:48:23Z")

</div>

I think it has to do with localToGlobal/globalToLocal.  
At the moment I can’t that working, but you can do a search for that;)  
Meanwhile, this is working  
[AS]onClipEvent (mouseDown) {  
if (this.hitTest(\_root.\_xmouse, \_root.\_ymouse)) {  
this.startDrag();  
}  
}  
onClipEvent (mouseUp) {  
this.stopDrag();  
if (\_root.dropzone.hitTest(\_root.\_xmouse, \_root.\_ymouse)) {  
unloadMovie(this);  
}  
}  
[/AS]

scotty(-:

---

<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:** [February 9, 2004, 10:59am UTC](https://forum.kirupa.com/t/-parent-or--root/42234/7 "2004-02-09T10:59:12Z")

</div>

Ah, god bless, allah be praised.

Thanks V much.

---

<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:** [February 9, 2004, 4:34pm UTC](https://forum.kirupa.com/t/-parent-or--root/42234/8 "2004-02-09T16:34:38Z")

</div>

lol, welcome:)
