I think the problem is here:
for(var i:int=0;i<particleContainer.numChildren;i++){
var theParticle:DisplayObject = particleContainer.getChildAt(i);
[...]
if (theParticle.y >= 400){
particleContainer.removeChild(theParticle);
}
}
You are removing children from the particleContainer
while iterating through it. This is usually a bad idea because once you remove an item from the beginning, you are changing the index of all following items.
One solution is to loop backwards, so when you remove something the only items changed are the ones that you already checked.
for(var i:int=particleContainer.numChildren - 1; i>=0; i--){
And the rest keeps the same.