Removing and adding the puck when a player scores

Hi!

I've been learning Box2d, WCK and AS3 for 2 weeks now and I'm building an Air Hockey Game for a school assignment that is to bo finished in 2 days.

I now need your help with the part where a player scores a goal.

When the puck(circle object) touches the goal(a rectangular movie clip) I want to reset the position of the puck and have it go back to the middle of the field.

What is the easiest way to do this? Using a hitTestObject and if then how?

Please give me an N00b-example 😉
What you need to do is have a shape that defines the goal. Set reportBeginContact = true on the goal and listen for ContactEvent.BEGIN_CONTACT events. In your listener function, remove the puck from the stage, set it's x/y back to the starting position, then add it back to the stage.

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