# OOP: Set parent variable from object?

**URL:** https://forum.kirupa.com/t/oop-set-parent-variable-from-object/320805
**Category:** flash
**Created:** [April 1, 2011, 9:55pm UTC](https://forum.kirupa.com/t/oop-set-parent-variable-from-object/320805 "2011-04-01T21:55:05Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![0x66FF00](https://avatars.discourse-cdn.com/v4/letter/0/dbc845/32.png) [@0x66FF00](https://forum.kirupa.com/u/0x66FF00)
#### Post date: [April 1, 2011, 9:55pm UTC](https://forum.kirupa.com/t/oop-set-parent-variable-from-object/320805/1 "2011-04-01T21:55:05Z")

</div>

Hi,

I’ve got an external class and make like 20 objects with it. If I e.g. hover my mouse above them, the objects themselves know that, the parent clip however does not. Now I want a global boolean to be set to true, if _one_ of those objects is focused. So in other words I want to set a parent variable from inside of an object that I created with a class. How would I do that?

I could make myself an enter-frame-loop and check all of the objects all of the time, but that doesn’t sound like a good solution.

I could also add 20 change-listeners to the parent clip, but I’m not sure about the performance of that. And I have listeners inside the objects anyway, so those should be somehow able to take care of that, or isn’t that possible?

I tried to pass the global boolean as a parameter when creating the objects or hard code it with Object(this.parent), but both of that somehow doesn’t pass through to the parent’s variable.

What to do… I suppose this is pretty basic OOP-stuff…
