Hey, it’s kind of simple and I think it’s been done before…but I kind of like it anyway. I got inspired after seeing the opal cloud experiments in Joshua Davis’s Flow presentation. I’m not sure how he did it but I think this comes kind of close.
I’m sorry if the code looks kind of familiar. Parts of it are based on Kirupa’s grassy field tutorial (if you want me to take down the source just let me know).
This is literally my first work with actionscript so I think the code is a bit akward. If any of you have any ideas on how I can improve this then that would be great.
Ok the source
This is in frame
i = 0;
[color=#000084]while[/color] (i < 50) {
[color=#000084]_root[/color].movieclipname.[color=#000084]duplicateMovieClip[/color]([color=#0000ff]"movie"[/color] + i, i);
i[color=#000084]++[/color];
}
[color=#000084]if[/color] ([color=#000084]([/color]i = a[color=#000084])[/color]) {
[color=#000084]_root[/color].[color=#000084]stop[/color]();
}
Just a note, if you take out the (i=a) and replace it with the value in the WHILE statement above, the animation will freeze on one frame. Kind of handy for screen shots and what not.
This is attached to an instance of the movie clip
onClipEvent (load) {
[color=#000084]var [/color]c = [color=#000084]new Color[/color] ([color=#000084]this[/color]);
c.[color=#000084]setRGB[/color]([color=#000084]random[/color] (0xFFFFFF));
[color=#000084]this[/color].[color=#000084]_x[/color] = [color=#000084]Math[/color].[color=#000084]round[/color](-10 + ([color=#000084]Math[/color].[color=#000084]random[/color]() * 100));
[color=#000084]this[/color].[color=#000084]_y[/color] = [color=#000084]Math[/color].[color=#000084]round[/color](-10 + ([color=#000084]Math[/color].[color=#000084]random[/color]() * 100));
[color=#000084]this[/color].[color=#000084]_xscale[/color] = 50 + ([color=#000084]Math[/color].[color=#000084]random[/color]() * 100);
[color=#000084]this[/color].[color=#000084]_yscale[/color] = 50 + ([color=#000084]Math[/color].[color=#000084]random[/color]() * 100);
[color=#000084]this[/color].[color=#000084]_rotation[/color] = [color=#000084]Math[/color].[color=#000084]round[/color](-10 + ([color=#000084]Math[/color].[color=#000084]random[/color]() * 100));
[color=#000084]this[/color].[color=#000084]_alpha[/color] = 10 + ([color=#000084]Math[/color].[color=#000084]random[/color]() * 90);
}
I used a circle with a radial gradient (one slider a solid color the other a solid color with the alpha set to zero) for the movie clip.
Anyways. It’s not ground breaking but whatever. Er, also thanks to Abelius for the help.