|
-
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) };
Please use [php] or [code] tags, and mark your threads resolved 8)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|