HI. I've just been solving a related problem, which is how to set up a system for loading, resetting, and replacing levels.
It looks like if you contain your level / scene objects inside a MovieClip, you can just remove it from the stage and then add a new instance of the same clip.
To make this clearer, this is the structure you might use:
Code:
wck.WCK clip (either as your Document class or some inner Clip, placed on the stage.)
wck.World clip (This can contain objects like the ground, which you want to stay there all the time.)
level1 clip - a clip containing all the wck objects you want to be able to remove and / or reset.
if you 'Export for Actionscript' resettableObjects, eg with the class name "Level1", then you can remove it from your world, and re-add a reset version of it with code something like this:
Code:
worldInstance.removeChild( level1 );
level1 = new Level1();
worldInstance.addChild( level1 )
I've only just started using wck, but from what I can tell, removing objects from the stage removes them from the b2World as well, and takes care of destroying the Box2D objects. I'll be profiling this for memory leaks, so if I turn out to be wrong, I'll get back to you.
BTW, wck.World contains a reference to the Box2D b2World instance. It's b2world ( with a lowercase 'w' ). You can use this to get at the Box2d Objects directly. For example, this code will list all the objects in the world:
Code:
var w:wck.World = wckMain.world; //this would be your root level 'Document' class, if you have followed the tutorial, or are using the default template.
var b2w:b2World = wckMain.world.b2world;
var node:b2Body = b2w.GetBodyList();
while (node)
{
var b:b2Body = node;
node = node.GetNext();
trace(node);
}