# Random shape/color cursor

**URL:** <https://forum.kirupa.com/t/random-shape-color-cursor/182424>\
**Category:** open source\
**Created:** [March 18, 2006, 1:21am UTC](https://forum.kirupa.com/t/random-shape-color-cursor/182424 "2006-03-18T01:21:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mofongo9](https://avatars.discourse-cdn.com/v4/letter/m/a9adbd/32.png) [@mofongo9](https://forum.kirupa.com/u/mofongo9)\
**Post date:** [March 18, 2006, 1:21am UTC](https://forum.kirupa.com/t/random-shape-color-cursor/182424/1 "2006-03-18T01:21:45Z")

</div>

this is a thing i made as a result of an AS challenge on NG  
generates entirely random shapes and colors.

> stop();  
> \_root.createEmptyMovieClip(“shape”, 1);  
> i = 0;  
> with (shape) {  
> onEnterFrame = function () {  
> duplicateMovieClip(\_root.shape, “shape”+\_root.i, \_root.i);  
> \_root.i++;  
> ls = random(10);  
> rgb1 = random(100);  
> rgb2 = random(100);  
> rgb3 = random(100);  
> my\_color = “0x”+rgb1+rgb2+rgb3;  
> lineStyle(ls, my\_color, 100);  
> moveTo(\_root.\_xmouse, \_root.\_ymouse);  
> amount = random(5)+1;  
> while (amount\>0) {  
> lineTo(random(10)+\_xmouse, random(10)+\_ymouse);  
> amount–;  
> }  
> };  
> }  
> onMouseDown = function () {  
> shape.clear();  
> };

heres the .swf  
[http://denvish.net/ulf/1142638597\_Cool%20AS%20challenge.swf](http://denvish.net/ulf/1142638597_Cool%20AS%20challenge.swf)

theoretically, any shape with between 5 and 1 points is possible given an infinite amount of time. just move around the mouse and click to clear if it gets slow

---

<div class="post-metadata">

**Author:** ![anon1712571](https://avatars.discourse-cdn.com/v4/letter/a/9dc877/32.png) [@anon1712571](https://forum.kirupa.com/u/anon1712571)\
**Post date:** [March 20, 2006, 4:19am UTC](https://forum.kirupa.com/t/random-shape-color-cursor/182424/2 "2006-03-20T04:19:46Z")

</div>

thats cool- try mixing it up even more- maybe a few colours in each shape? 😃
