# Position thrue AS

**URL:** <https://forum.kirupa.com/t/position-thrue-as/183380>\
**Category:** Uncategorized\
**Created:** [March 26, 2006, 3:00pm UTC](https://forum.kirupa.com/t/position-thrue-as/183380 "2006-03-26T15:00:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vintage](https://avatars.discourse-cdn.com/v4/letter/v/e68b1a/32.png) [@vintage](https://forum.kirupa.com/u/vintage)\
**Post date:** [March 26, 2006, 3:00pm UTC](https://forum.kirupa.com/t/position-thrue-as/183380/1 "2006-03-26T15:00:19Z")

</div>

Hello reader, I have a small problem with repositioning dynamicly attached mc’s

In my flash I attachMovie 50 times and place them randomly…this works perfect, but now I want to move their position with the click of a button

```auto
for (i=0; i<aantal; i++) {
                //nieuwe random positie maken voor de edelstenen
                x2 = Math.floor(Math.random()*(500-50+1))+50;
                y2 = Math.floor(Math.random()*(500-50+1))+50;
                with ("edelsteen"+i) {
                    this._x = x2;
                    this._y = y2;
                }
            }

```

this somehow works…but with only one mc…I want them ALL to repositioning.

Anyone know where Im wrong ?

---

<div class="post-metadata">

**Author:** ![vintage](https://avatars.discourse-cdn.com/v4/letter/v/e68b1a/32.png) [@vintage](https://forum.kirupa.com/u/vintage)\
**Post date:** [March 26, 2006, 5:26pm UTC](https://forum.kirupa.com/t/position-thrue-as/183380/2 "2006-03-26T17:26:48Z")

</div>

```auto
for (v=0; v<aantal; v++) {
				//nieuwe random positie maken voor de edelstenen
				x2 = Math.floor(Math.random()*(500-50+1))+50;
				y2 = Math.floor(Math.random()*(500-50+1))+50;
				_root["edelsteen"+v]._x = x2;
				_root["edelsteen"+v]._y = y2;
			}
		}

```

ah I found it 😃

---

<div class="post-metadata">

**Author:** ![Bokke](https://avatars.discourse-cdn.com/v4/letter/b/5f9b8f/32.png) [@Bokke](https://forum.kirupa.com/u/Bokke)\
**Post date:** [March 26, 2006, 5:28pm UTC](https://forum.kirupa.com/t/position-thrue-as/183380/3 "2006-03-26T17:28:41Z")

</div>

```auto
for (i=0; i<aantal; i++) {
    var tempPath = this.attachMovie("edel", "edelsteen"+i, i);
    tempPath._x = Math.floor(Math.random()*(500-50+1))+50;
    tempPath._y = Math.floor(Math.random()*(500-50+1))+50;
}

```

Oh i see youve already ot it… well this will also work, and its cleaner! :thumb:

---

<div class="post-metadata">

**Author:** ![vintage](https://avatars.discourse-cdn.com/v4/letter/v/e68b1a/32.png) [@vintage](https://forum.kirupa.com/u/vintage)\
**Post date:** [March 26, 2006, 6:58pm UTC](https://forum.kirupa.com/t/position-thrue-as/183380/4 "2006-03-26T18:58:58Z")

</div>

nope yourse isnt cleaner, its attaching again movies 😉

I had allready created 50 mc’s with random positioning, but I wanted them to “shuffle” on a mouseklik.

---

<div class="post-metadata">

**Author:** ![Bokke](https://avatars.discourse-cdn.com/v4/letter/b/5f9b8f/32.png) [@Bokke](https://forum.kirupa.com/u/Bokke)\
**Post date:** [March 26, 2006, 7:51pm UTC](https://forum.kirupa.com/t/position-thrue-as/183380/5 "2006-03-26T19:51:38Z")

</div>

> [@vintage](#):
>
> nope yourse isnt cleaner, its attaching again movies 😉
> 
> I had allready created 50 mc’s with random positioning, but I wanted them to “shuffle” on a mouseklik.

oh lol, I thought you had forgotten the attachMovie part 😛
