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:
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?