As I have said several time, there is an assumption for the code I presented (to process the collision).
It require : the time step is smaller enough so that the movement of each ball should be smaller than radius of both balls.
i.e. v*dt<< r

[code]
ballObject.tempX = ballObject.tempX + ballObject.horizontalVelocity;
[/code]
Your time step is always 1.
You should change the time step to a small value when velocity is too large.

Or you should make another loop to make the ball move with smaller steps.
i.e. ballObject.tempX = ballObject.tempX + ballObject.horizontalVelocity*dt;
with proper dt value.


Another issue is you are processing collision before all the particles are moving to the next time step.
You have loop i to move particle , inside loop i
you have loop j and loop f to process collision,

I would suggest you move loop j and loop f outside loop i.
Process collision after all particles have move one time step.

And for loop j and loop f: you are still have both loop from 0-numTotalBalls.
It seems that you did not listen to my suggestion. The code was processing collision twice.
for example: if you have three particles  j loop from 0-2, f:loop from 0-2
  your code is doing the following (j,f) pairs
  (0,0): self collision --- not real 
  (0,1):collision between particle 0 and particle 1
  (0,2):collision between particle 0 and particle 2
  (1,0):collision between particle 1 and particle 0--- this should have been take care in (0,1)
  (1,1):self collision --- not real 
  (1,2):collision between particle 2 and particle 0--- this should have been take care in (0,2)
  (2,0):collision between particle 2 and particle 1--- this should have been take care in (1,2)
  (2,1):collision between particle 2 and particle 2
  (2,2); self collision --- not real   

You should spend some time try to draw a conceptual flow to understand what you were really doing.