# Accessing property of child of a display object

**URL:** https://forum.kirupa.com/t/accessing-property-of-child-of-a-display-object/323910
**Category:** Uncategorized
**Created:** [July 23, 2011, 9:57pm UTC](https://forum.kirupa.com/t/accessing-property-of-child-of-a-display-object/323910 "2011-07-23T21:57:22Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![oluc](https://avatars.discourse-cdn.com/v4/letter/o/cc9497/32.png) [@oluc](https://forum.kirupa.com/u/oluc)
#### Post date: [July 23, 2011, 9:57pm UTC](https://forum.kirupa.com/t/accessing-property-of-child-of-a-display-object/323910/1 "2011-07-23T21:57:22Z")

</div>

i need some help to understand how to access a property of a child of a DisplayObject.

within a class i have an object with the variable name: btnLMain  
i have assigned it a name property: btnLMain.name = “btnLMain”;  
btnLMain also has a property: btnLMain.clickNum = 0; // thats the one i need to access  
when i instantiate the class (btnL) containing this code in the parent class i need to access the property “clickNum” so i did this:

var dispObj:DisplayObject = btnL.getChildByName(btnLMain);  
displayObj.clickNum++;

but then i get the error: 1119: Access of possibly undefined property clickNum through a reference with static type flash.display:DisplayObject.

so then i reviewed documentation and from what i understand i am not able to access the property of the child of the DisplayObject as it is a static property… please correct me if i’m wrong.

so now i am trying to figure out how to access that property in the child Class.

do you have any advice for me?

thanks!
