Arrays, generating target coordinates, moving stuff

Hi,

I’m sure this has been addressed somewhere (and I’m sure many of you get tired of dealing with similar inquiries), but after combing through threads on arrays and random numbers, I’m still not sure how to do the following:

I have 23 dots that I’d like to move to randomly generated coordinates within a container. From what I can tell, a good method to do this is to create target movie clips and then have the dots go to each corresponding target mc. It seems to me that I could avoid the use of a separate movie clip for a target, but visually it makes sense.

For one of these dots, with a static target, I wrote the following code:

_root.Dot1.onEnterFrame = function() {
//_root.running is a variable that runs on button rollOver
if (_root.running && Math.abs(_root.staticTarget._y-this._y)<1 && Math.abs(_root.staticTarget._x-this._x)<1) {
// set position and hang out
this._y = _root.staticTarget._y;
this._x = _root.staticTarget._x;
_root.running = false;
} else if (_root.running) {
this._y -= (this._y-_root.staticTarget._y).2;
this._x -= (this._x-_root.staticTarget._x)
.2;
} else {
// wait for button rollOver
}
};

How can I do this for 23 dots all at once, and for the targets not to be static but randomly generated? And additionally, if I wanted to avoid having dots go to the same x or y coordinates (or both), does this get way tricky? Having seen some solutions to arrays and random numbers, it seems like it is doable.

Thanks in advance.