# A selection of blocks random on stage

**URL:** <https://forum.kirupa.com/t/a-selection-of-blocks-random-on-stage/221730>\
**Category:** Uncategorized\
**Created:** [April 6, 2007, 7:36pm UTC](https://forum.kirupa.com/t/a-selection-of-blocks-random-on-stage/221730 "2007-04-06T19:36:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stewart](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@stewart](https://forum.kirupa.com/u/stewart)\
**Post date:** [April 6, 2007, 7:36pm UTC](https://forum.kirupa.com/t/a-selection-of-blocks-random-on-stage/221730/1 "2007-04-06T19:36:12Z")

</div>

maybe someone can help me a little with a function for this:

i have a number of movieclips. let’s say 20.  
every movieclip contains one black block - and they’re all different in size.

i want to put them one by one in random order on the stage until the space on the stage is filled like this:  
[http://www.kulsdom.com/newstoday/blocks.gif](http://www.kulsdom.com/newstoday/blocks.gif)

in other words: when only 4 movieclips fits on the stage it shows 4 movieclips, when 8 movieclips fits… etc etc

and i don’t want them to overlap each other…  
how could this be done?
