how change the image of a physic body object on collision

Hi everyone… can anyone guide me…about how can i change the image of a physic body object when their collision event occur… [import]uid: 42177 topic_id: 8848 reply_id: 308848[/import]

any body pls help… thanks … [import]uid: 42177 topic_id: 8848 reply_id: 32929[/import]

inside your collision listener you do something like:
[lua]Runtime:removeEventListener(“enterFrame”, moveRascal )
rascal:removeEventListener(“collsion”, rascal)
local function rascalHasApple()
bgGroup:remove(rascal); rascal:destroy(); rascal = nil
rascalCreate({“rascalHasApple.png” })
rascal.x = RascalX; rascal.y=RascalY – save coordinates of old rascal to create this one in the same spot.
Runtime:addEventListener(“enterFrame”, moveRascal )
rascal.collision = onRascalCollision
rascal:addEventListener( “collision”, rascal )
end – rascalHasApple
timerRascal = performAfterDelay(0.01, rascalHasApple ,1,true)
– can’t happen in the same frame [/lua] [import]uid: 12635 topic_id: 8848 reply_id: 32941[/import]

many many thanks Edwardk… :slight_smile: [import]uid: 42177 topic_id: 8848 reply_id: 33034[/import]