R.W.
I would check with the doctor first, just in case, but if it only happens when he's involved in play, it's probably not a medical/physical problem. My daughter had been 100% accident free for a couple of years when she (at around age 4) started to do this. Every time we had a play date, for example, she had an accident. After talking to a few people about this, I decided to try washing her up with cool (not cold) water, instead of warm. She didn't like this, so after only two or three times, she was back to her dry self! -- Actually, I had to remind her again of this a couple of years ago (about 7 y.o.), because she started to do it again when she went to a friend's house to play. It hasn't been a problem since.
Godspeed and blessings!