The Original Concept: A Moving Artery
The Original Concept: A Moving Artery
While browsing through my collection of FLA files, I stumbled on an experiment called vein-1 that was created by a fellow Flash developer, Mike Johnson. I was inspired to recreate it in ActionScript 2 and spice up the implementation. The result was a perpetually moving artery with branches of veins and capillaries branching from it at random points (see Figure 1).
Briefly, the VeinManager
class instantiates a single instance of a Vein
class, which becomes the artery. In each frame, the Vein
class randomly alters its angle of movement, and draws a line segment with a random length along that angle. It also randomly instantiates new Vein
classes with a lower thickness, and the same initial angle and location as the artery. These child veins then carry out the same functions (drawing line segments and creating children of their own) for a random number of frames.
This experiment obviously generated a lot of line segments, and would quickly overwhelm the ability of Flash Player to composite the vectors. To reduce the impact of vector compositing, the Vein
instances in the original experiment fade and remove themselves from the Stage after a few seconds. In Flash Player 8, I was able to make the veins persistent by using a custom bitmap caching routine.
Comments