# Help - Accessing MovieClip Properties

**URL:** <https://forum.kirupa.com/t/help-accessing-movieclip-properties/309511>\
**Category:** flash\
**Created:** [May 17, 2010, 12:01pm UTC](https://forum.kirupa.com/t/help-accessing-movieclip-properties/309511 "2010-05-17T12:01:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bossa](https://avatars.discourse-cdn.com/v4/letter/b/c67d28/32.png) [@Bossa](https://forum.kirupa.com/u/Bossa)\
**Post date:** [May 17, 2010, 12:01pm UTC](https://forum.kirupa.com/t/help-accessing-movieclip-properties/309511/1 "2010-05-17T12:01:44Z")

</div>

I have 2 separate containers on my main stage, each of these contains numerous child MovieClips. One contains my enemies and the other contains a smaller representation of those enemies. The smaller enemies need to get a reference to the corresponding larger enemy position to set their own position to half of that value. This works by adding the following code to the small enemies class file for x, y and rotation:

```auto
this.x=MovieClip(this.parent.parent.getChildByName("enemyHolder")).getChildAt(myRef).x/2;

```

However I also need to access the larger enemies health variable but if I use the same approach in this manner:

```auto
this.health = MovieClip(this.parent.parent.getChildByName("enemyHolder")).getChildAt(myRef).myHealth;

```

I get the following error?

1119: Access of possibly undefined property myHealth through a reference with static type flash.display:DisplayObject.

I am declaring myHealth in the constructor function of the enemy class file and have tried setting it’s access modifier to public but still can’t access that variable.

Any help would be most appreciated!
