This is driving me crazy.
I have defined an arraylist as follows:
public ArrayList drawnballs;
This is instantiated through
drawnballs = new ArrayList();
I add balls to this just fine with:
drawnballs.Add(myball);
I can access every element (every ball) through a foreach statement, that
works great.
What I can't do is get just the first ball (or any individual ball).
anotherball = drawnballs[0] doesn't work. There is no method like
anotherball = drawnballs.Item[1]; which is what I would expect. I can't get
the drawnballs.getarray method to work.
Please, please, how do I reference a single ball in drawnballs (ie in an
arraylist)?