Your loop is incrementing at the same time that the display list is shrinking - so if you had 6 items in your display:

1, 2, 3, 4, 5, 6

You go through the loop with p=0 and delete #1,

__ 2, 3, 4, 5, 6

Then increment p and delete index 2:

__ 2, __ 4, 5, 6

Then increment p and delete index 3:

__ 2, __ 4, __ 6

Now p is incremented to 4 and numChildren is 3 so the loop ends. Here's a loop that will remove everything:

PHP Code:
while(mc.numChildren){ removeChildAt(0) };