# This pattern to AS

**URL:** <https://forum.kirupa.com/t/this-pattern-to-as/114738>\
**Category:** Uncategorized\
**Created:** [July 1, 2004, 7:46am UTC](https://forum.kirupa.com/t/this-pattern-to-as/114738 "2004-07-01T07:46:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sense](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@sense](https://forum.kirupa.com/u/sense)\
**Post date:** [July 1, 2004, 7:46am UTC](https://forum.kirupa.com/t/this-pattern-to-as/114738/1 "2004-07-01T07:46:30Z")

</div>

Hello,

[http://theremedy.be/scrap/starsAs.gif](http://theremedy.be/scrap/starsAs.gif)

I’m looking for some clues here to generate this kind of pattern using Actionscript.  
Probably it’s gotta be a “star” attached from the library then generated on stage randomly with colordifference, scaling and skewing.

\*Note how the pattern should follow the specified path.

Is it possible? Is it hard to do?

Appreciate any help.

---

<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:** [July 3, 2004, 11:40pm UTC](https://forum.kirupa.com/t/this-pattern-to-as/114738/2 "2004-07-03T23:40:26Z")

</div>

Well one interesting idea could be a sine wave- you would attach them so the followed the wave, but then randomize it so they are a bit off of it. You could probably do it with any mathematical function that produces a curve.

---

<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:** [July 4, 2004, 12:02am UTC](https://forum.kirupa.com/t/this-pattern-to-as/114738/3 "2004-07-04T00:02:15Z")

</div>

The colors are a bit off, but it does more or less what you want:

```auto
for (var i=0; i<100; i++) {
	var cl = this.attachMovie ("clip", "c" + i, i) ;
	var ang = Math.PI/2*Math.random () ;
	cl._x = 200 * Math.cos (ang) + 50 * (Math.random()-.5) ;
	cl._y = 200 * Math.sin (ang) + 50 * (Math.random()-.5) ;
	cl._xscale = cl._yscale = 100 + random (100) ;
	new Color(cl).setRGB ( random (0xFF) << 16 | 0xaa << 8 | 0xbb) ;
} ;

```

I put the clip (linkage name “clip”) on a circle (radius 200), and then a bit off.
