ActionScript 2 Random Compositions Tutorial

This 26 page pdf based tutorial explores the various mechanisms for creating random compositions in Flash 8, using ActionScript 2. It serves as a basic primer for creating work in a similar vein to Joshua Davis’s generative Flash work.

Topics covered include;
Random Number generation
Animation Strategies – enterframe, timer, loops
Key based interactivity
AttachMovie and DuplicateMovie
Dynamic ActionScript functions
Random Positioning, Colouring, Depth Shuffling of movieClips
Deleting MovieClips
Classes

Example
Here is a simple example of the kind of thing you create in this tutorial; Random Composition

Source Files
Here are the source files; Randomisation in Flash 8 Source Files

Dependencies
Flash 8 or Flash CS3
PDF Reader

3 Neighs about “ActionScript 2 Random Compositions Tutorial”



sarita Neighed:

it is useful

Mike Neighed:

I’m using the class approach to building the composition, creating an actionscript file for each element in the composition (ie- having a rose.as for the rose_mc). It’s my understanding that (rose_mc) should have its background turned into a nested symbol where it’s instance name is called “bg.” I see that this is reference in the .AS giving the bg a random color from the array. But what if I wanted to change the color of the stroke too? After turning the stroke into a symbol, how would one go about referencing that in the .AS as well?? (ie- rose_mc = rose_bg + rose_stroke).

Also, is there a way to limit the layering order in the main actionscript of the flash file without having to manually click and send movieclips backwards (while holding down the LEFT key)? I have certain compositional elements that are intended to be random variations of the stage color and I wanted them to always be BEHIND the rest of the movieclips that are more saturated in color. This would push the depth and dimensionality of the composition, albeit randomly (which is good!)

Mike Neighed:

Hi-

Say I wanted to do something similar to your example, but with traced bitmaps. Like 100’s of them… This could get disastrously huge, if not impossible (and crash) right?

My question is:

There’s a Main swf file and individual AS files that are “attached” to each clip in the library. Since this is generative and runs randomly, is it possible to make individual SWFs for each library element and only have them load when needed / called, etc. ?

If so, can someone help me?

THANKS!

Leave a neigh?