I am not familiar with the syntax in your code.
var i2:uint=i1+1;// Does it mean i2=i1+1;??? I wrote some action code in flash before, but it was almost the same as java-script.

But the problem only occurred for some occasional case, so most part of the code should be all right.
When the ball was pushed away, is it with a much larger velocity?
If this is the case, you can add some code to print out related information when such case happened, in order to find out what went wrong.