# Random motion with irregular shape

**URL:** <https://forum.kirupa.com/t/random-motion-with-irregular-shape/12393>\
**Category:** Uncategorized\
**Created:** [January 30, 2003, 6:46pm UTC](https://forum.kirupa.com/t/random-motion-with-irregular-shape/12393 "2003-01-30T18:46:10Z")\
**Posts on this page:** 1\
**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:46pm UTC](https://forum.kirupa.com/t/random-motion-with-irregular-shape/12393/1 "2003-01-30T18:46:10Z")

</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.
