# Rondom dots

**URL:** <https://forum.kirupa.com/t/rondom-dots/216857>\
**Category:** Uncategorized\
**Created:** [February 21, 2007, 4:01am UTC](https://forum.kirupa.com/t/rondom-dots/216857 "2007-02-21T04:01:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![underworldling](https://avatars.discourse-cdn.com/v4/letter/u/f04885/32.png) [@underworldling](https://forum.kirupa.com/u/underworldling)\
**Post date:** [February 21, 2007, 4:01am UTC](https://forum.kirupa.com/t/rondom-dots/216857/1 "2007-02-21T04:01:00Z")

</div>

here is the bit of code that i’m having problems with. what i want is a bunch of dots in random places but they all seem to end up right in the middle of the stage. any help would be greatly appreciated.

```auto
newgame = function (dots:Number) {
 mcs = [];
 for (var i =0; i < dots-1; ++i) {
  var mc = this.duplicateMovieClip(dot, "dot"+i, 1+i);
  mcs* = mc;
  mc._x = ballRadius+random(Stage.width-ballWidth);
  mc._y = ballRadius+random(Stage.height-ballWidth);
  trace ("x = " + mc._x);
  trace ("y = " + mc._y);
  trace ("");
 }
}

```
