# How does one randomize the position of a flash clip?!?!

**URL:** https://forum.kirupa.com/t/how-does-one-randomize-the-position-of-a-flash-clip/62279
**Category:** flash
**Created:** [August 26, 2004, 1:17pm UTC](https://forum.kirupa.com/t/how-does-one-randomize-the-position-of-a-flash-clip/62279 "2004-08-26T13:17:53Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![lloydisverdis](https://avatars.discourse-cdn.com/v4/letter/l/d07c76/32.png) [@lloydisverdis](https://forum.kirupa.com/u/lloydisverdis)
#### Post date: [August 26, 2004, 1:17pm UTC](https://forum.kirupa.com/t/how-does-one-randomize-the-position-of-a-flash-clip/62279/1 "2004-08-26T13:17:53Z")

</div>

The web-site is in html and I’m using a Flash Object layered over and image to create a circular-sonic-boom-effect when the page is loaded. Eg. The image in in a \<td\>\</td\> with an absolute width of 233px and height of 310px. The flash object sits on top of the image and onLoad() invokes the flash ‘clip’. The clip is a circle, expanding and fading simultaneously. It’s initial position is x-100 and y-100. I’d like that the x and y positioning be random i.e on the next onLoad() the position should change to say x-134 and y-50.

Is there a way to do this?!?!  
I respectfully request ANY advice.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 26, 2004, 4:04pm UTC](https://forum.kirupa.com/t/how-does-one-randomize-the-position-of-a-flash-clip/62279/2 "2004-08-26T16:04:21Z")

</div>

you can use javascript to write to the document.  
make it write to the string using the text you need and insert a random number where it puts the absolute positions. 🙂

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 26, 2004, 4:12pm UTC](https://forum.kirupa.com/t/how-does-one-randomize-the-position-of-a-flash-clip/62279/3 "2004-08-26T16:12:14Z")

</div>

well i can’t think off any other way but AS…  
u could try this:  
open a new document and create a movie clip on the stage…  
put this code on the movie clip:

```auto

onClipEvent(load){
    mW = random(50);
    mH = random(50);
    mSpeed = 7
}
onClipEvent(enterFrame){
    this._width+=(mW-this._width)/mSpeed;
    this._height+=(mH-this._height)/mSpeed;
}

```

so that every time it loads the destination scales are random (i even added an easing hehe… tell you’re friends about me lol)
