# Traversing the object hierarchy

**URL:** <https://forum.kirupa.com/t/traversing-the-object-hierarchy/248414>\
**Category:** flash\
**Created:** [January 8, 2008, 1:26am UTC](https://forum.kirupa.com/t/traversing-the-object-hierarchy/248414 "2008-01-08T01:26:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![superpwnage](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@superpwnage](https://forum.kirupa.com/u/superpwnage)\
**Post date:** [January 8, 2008, 1:26am UTC](https://forum.kirupa.com/t/traversing-the-object-hierarchy/248414/1 "2008-01-08T01:26:06Z")

</div>

—[RESOLVED]—

I’ve been struggling with this problem for the past few hours, for some reason I can’t wrap my head around it. I’m confused about how an object references it’s parent, like

**Document Class**

```auto

addChild(objParent);
objParent.addChild(objChild);

```

**objChild Class**

```auto
// Should reference objParent, but is null instead.
MovieClip(this.parent).function_or_variable();

```

From what I’ve read, it seems like this should work. What am I doing wrong?

-\*super

\*–EDIT–  
I now realize that this method works with constant variables, like x or alpha. However, it _does not_ with custom variables or functions, even ones declared as public static.
