# As3/cs3 Passing a variable between class children

**URL:** <https://forum.kirupa.com/t/as3-cs3-passing-a-variable-between-class-children/236163>\
**Category:** flash\
**Created:** [August 17, 2007, 5:46pm UTC](https://forum.kirupa.com/t/as3-cs3-passing-a-variable-between-class-children/236163 "2007-08-17T17:46:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dal\_platinum](https://avatars.discourse-cdn.com/v4/letter/d/ed8c4c/32.png) [@dal\_platinum](https://forum.kirupa.com/u/dal_platinum)\
**Post date:** [August 17, 2007, 5:46pm UTC](https://forum.kirupa.com/t/as3-cs3-passing-a-variable-between-class-children/236163/1 "2007-08-17T17:46:44Z")

</div>

I have just started the move from AS1/2 to AS3, and I’ve got to a problem I can’t find a solution for.

I have a class that should create a panel to display live variable info. I use this box to tell me info sent from a shape object.

The class that makes the shape is a child of a MovieClip class I am using to hold it, so it is container.shapemaker, which is all good.

But how do I get from my shape object to the textfield.text variable of the panel?

The textfield object is added as a child during the panel constructor function, but when I check the textfield objects parent, I get null. The same goes for the shape object.

I don’t know what I am adding it to. It ends up on the screen, so I know I’m halfway there. I just don’t seem to be able to find it.

when I use addChild(textfield) inside a class function am I missing something? I won’t be able to add it to the parent, as the class has no parent. Can I add it to the stage/root? if so, how will I then reference it?

Sorry if this isn’t making much sense.
