WCK : How to loop through an object's collisions?

Let's say I have a vehicle. And cannonballs are being hurled at it. How do I determine when the cannonball hits the car (so I can calculate damage and etc)? Is there a way to check all collisions the car has in each frame? And then for each collision check if the object is a cannonball? Something like that?

Is there a better way to do this?
Take a look at the wck.ContactList class:

Code:
cl = new ContactList();
cl.listenTo(wheel1);
cl.listenTo(wheel2);
cl.listenTo(body);


Then later in a step function:

Code:
contactEvents = cl.values;


Or you can listen for the contact events manually.
Ah, thanks. Another question: in using the WCK, when I removeChild() I get a ton of errors in the console about WCK. Is there a proper way to remove objects from the stage? I tried the body.destroy() function but it's not working.
What errors are you getting?
Ahh, nevermind, I wasn't calling the removeChild function properly. There were a few missing references in my code. Completely my fault, nothing wrong with WCK. Thanks anyways!
Back to the original question:

I set up the contact listener:

Code:
var cl:ContactList = new ContactList();
cl.listenTo(car.wheel1);
cl.listenTo(car.wheel2);
car.cl = cl;


Then I try to access the values (this happens in an enterFrame function):

Code:
var CES:Array = car.cl.values;
var listlen:int = CES.length;


But listlen is always 0! Even when I clearly see the car touching the ground, or another car. What's up with this? Is there more I need to do to get the contacts?

I even put a trace inside the ContactList function that is called when a contact event begins. But I never get any trace messages.

Code:
public function handleBeginContact(e:ContactEvent):void {
trace ("handle begin contact");
//their code here
}
You probably aren't setting reportBeginContact and reportEndContact:

Code:
wheel1.reportBeginContact = true;
wheel1.reportEndContact = true;


If not set, no events will be dispatched. Forgot to mention this...
Ah thanks a lot!
Also remember to call:

cl.clean();

After you process your contact list. This will remove contacts from the list that are no longer touching.
Edit: nevermind

Original thread: https://box2d.org/forum/viewtopic.php?t=5305