Thank you Handoko !
I think the first order of business was for TS to get some moving balls on his form. Now TS is able to spot the inaccuracies and think on how to address those.
@TS:
Code can still be improved a little (without directly addressing remaining issues), but you probably have (other) restrictions that prevent form doing so.
One thing you can address though is making use of globals (yes, now it is allowed
) to define the number of balls for easy customization or as another example the max radius.
Also when i read this:
mx[i] := Random(Image1.Width);
my[i] := Random(Image1.Height);
Then ask yourself if that is correct. A picture tells more than a thousand words, so you will see soon enough what is wrong with that
edit: addressing the right person.