# Link a class from another class

**URL:** <https://forum.kirupa.com/t/link-a-class-from-another-class/326577>\
**Category:** flash\
**Created:** [December 26, 2011, 4:55pm UTC](https://forum.kirupa.com/t/link-a-class-from-another-class/326577 "2011-12-26T16:55:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MFRS](https://avatars.discourse-cdn.com/v4/letter/m/aca169/32.png) [@MFRS](https://forum.kirupa.com/u/MFRS)\
**Post date:** [December 26, 2011, 4:55pm UTC](https://forum.kirupa.com/t/link-a-class-from-another-class/326577/1 "2011-12-26T16:55:41Z")

</div>

i have a monster hitting my character, and when i didn’t had a class in my char i had

if (this.hitTestObject(\_root.getChildByName(“personagem”)))

but now it doesn’t work, because i created a class of my character, so i tried

if (this.hitTestObject(\_root.personagem))

but it doesn’t work.

How can i connect to the class of the char from the class of the monster?
