I am terribly out of practice with metatables and whatnot, and I'm not sure if they are applicable here.
I am working with dynamic code and the users may try to add physics bodies for the display objects that they create. However, these objects will be so oddly shaped that they are bound to have conflicts with the physics engine and I want to prevent them from being able to add physics bodies to the objects to begin with.
The simplest solution that I know of would be to create a simple enterFrame listener that checks if the objects have a bodyType, for instance, and if so, then use that information to run removeBody() function on them. However, this seems inelegant and wasteful.
Is anyone aware of more appropriate methods of detecting when a physics body is added for an object as soon as it is added?