# Hiding the fact that a class is a DisplayObjectContainer

**URL:** <https://forum.kirupa.com/t/hiding-the-fact-that-a-class-is-a-displayobjectcontainer/298994>\
**Category:** flash\
**Created:** [October 28, 2009, 10:43am UTC](https://forum.kirupa.com/t/hiding-the-fact-that-a-class-is-a-displayobjectcontainer/298994 "2009-10-28T10:43:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![IQAndreas](https://avatars.discourse-cdn.com/v4/letter/i/f08c70/32.png) [@IQAndreas](https://forum.kirupa.com/u/IQAndreas)\
**Post date:** [October 28, 2009, 10:43am UTC](https://forum.kirupa.com/t/hiding-the-fact-that-a-class-is-a-displayobjectcontainer/298994/1 "2009-10-28T10:43:49Z")

</div>

I have a class which will contain exactly one child, no more, no less, and other classes are not allowed to change that fact.

I could throw error messages every time a child is added or removed by overriding the default properties, but I don’t want the object to be treated as if it were a DisplayObjectContainer.

I want it to look like only a DisplayObject, yet I still want to add a child to it in private.

Is this possible?
