# Random motion with irregular shape

**URL:** https://forum.kirupa.com/t/random-motion-with-irregular-shape/12392
**Category:** Uncategorized
**Created:** [January 30, 2003, 6:28pm UTC](https://forum.kirupa.com/t/random-motion-with-irregular-shape/12392 "2003-01-30T18:28:13Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![daveg92656](https://avatars.discourse-cdn.com/v4/letter/d/c77e96/32.png) [@daveg92656](https://forum.kirupa.com/u/daveg92656)
#### Post date: [January 30, 2003, 6:28pm UTC](https://forum.kirupa.com/t/random-motion-with-irregular-shape/12392/1 "2003-01-30T18:28:13Z")

</div>

Hello,

I’m using Flash5 and was wondering if anyone knows how to create random motion of an object within an irregular shape?

I have an ob-long rectangle which ‘flares’ on each end and would like to place some graphics in random motion within this irregular shape. Kirupa has a nice tutorial on random motion, which I can follow and re-produce no problem. However, with his tut, he uses

movie\_height = 150;  
movie\_width = 300;

But I want to specify the top, bottom, left and right edges, which are irregular. Should I create a mask and use that? or can I achieve this another way using actionscript? thanks for your help!! dave.

---

<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: [January 30, 2003, 6:41pm UTC](https://forum.kirupa.com/t/random-motion-with-irregular-shape/12392/2 "2003-01-30T18:41:51Z")

</div>

You will need a mask.

The only thing Flash can change is the width/height and \_xscale/\_yscale.

---

<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: [January 30, 2003, 6:47pm UTC](https://forum.kirupa.com/t/random-motion-with-irregular-shape/12392/3 "2003-01-30T18:47:39Z")

</div>

cool, thanks. i thought that might be the case, but not sure.
