# Tricking items into believing they are in a DisplayObjectContainer

**URL:** <https://forum.kirupa.com/t/tricking-items-into-believing-they-are-in-a-displayobjectcontainer/303517>\
**Category:** flash\
**Created:** [January 21, 2010, 2:49pm UTC](https://forum.kirupa.com/t/tricking-items-into-believing-they-are-in-a-displayobjectcontainer/303517 "2010-01-21T14:49:40Z")\
**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:** [January 21, 2010, 2:49pm UTC](https://forum.kirupa.com/t/tricking-items-into-believing-they-are-in-a-displayobjectcontainer/303517/1 "2010-01-21T14:49:40Z")

</div>

This is similar to a thread I posted earlier (I still can’t believe I remembered it), but this time I’m doing the exact opposite:

> **[Hiding the fact that a class is a DisplayObjectContainer](https://www.kirupa.com/forum/showthread.php?t=337766)**
>
> Got a web design/development question or just want to hang out with the most awesome people on the planet? Drop on in!

I’m working on a class that let’s you use “addChild” to add children to it. In all aspects, it’s treated like a regular class, the only difference is that it doesn’t really add them. It only draws the BitmapData of them and displays that, which doesn’t make a huge difference for the user, but might make a difference for performance, at least the way I am planning to make it.

Now, if users add a regular old Sprite or other DisiplayObject to the container, I have overridden the function to draw the BitmapData of the item, and store the item in an array.

The problem is, if the user want to do something like “sprite1.parent”, **since the Sprite _technically_ isn’t on the display list, the parent property will be null.**

What can I do about this? I can’t override the passed in sprite’s properties, right? Is there any way around this?
