# AS3 child/parent variables

**URL:** <https://forum.kirupa.com/t/as3-child-parent-variables/318970>\
**Category:** flash\
**Created:** [February 4, 2011, 7:23pm UTC](https://forum.kirupa.com/t/as3-child-parent-variables/318970 "2011-02-04T19:23:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![magapatalogikaa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/magapatalogikaa/32/3185_2.png) [@magapatalogikaa](https://forum.kirupa.com/u/magapatalogikaa)\
**Post date:** [February 4, 2011, 7:23pm UTC](https://forum.kirupa.com/t/as3-child-parent-variables/318970/1 "2011-02-04T19:23:09Z")

</div>

So I am new to AS3 and I am stuck with something.  
I have a menu and for each button I want to define a varible (clip) to declare the name of that button. All buttons have this clip variable defined inside them to make it a unique clip variable for each button.

Then I have on the main timeline a RollOver function to tell all buttons what to do on mouse RollOver. All I want is to tell in that RollOver funtion is:  
clip.gotoAndStop(2);  
And do the same on RollOut:  
clip.gotoAndStop(1);

And it would assume the clip variable of each of the buttons so it knows which one was rollOver and RollOut and change accordingly.

But I can’t seems to access the child variable.

How can I do that? Can anyone help me?
