Lorenz

Sprite
Lorenz

Draws a series of colored circles with position and size based on the Lorenz attractor formulas.

Note

The formula is based on the formula given in Flash Math v2, Ch8 Tarbell 2 Lorenz Attractors, but the implementation is a separate extended, colorized recoding in ActionScript 3.

Summary
LorenzDraws a series of colored circles with position and size based on the Lorenz attractor formulas.
Private positional members
x0Position in x.
y0Position in y.
z0Position in z.
Private Lorenz constants
timerTimer used when animating the drawing of the circles.
countCounter used to re-randomize the drawing to vary the look.
LorenzCreates a series of colored circle shapes that are added to the instance sprite.
updateRemoves the first circle and adds a new.
startStart animating the shape.
stopStop animating the shape.
timerHandlerHandles the timer callback and forces a display update.
initializeRandomizes the positional values.
generateCreates a few circles with the next color in the color palette.
calculateCalculates the next x0, y0, z0 values based on their current values.
randomizePseudo-randomizes the random numbers returned from Math.random based on the position of the mouse.

Private positional members

x0

private var x0: Number

Position in x.

y0

private var y0: Number

Position in y.

z0

private var z0: Number

Position in z.

Private Lorenz constants

timer

private var timer: Timer

Timer used when animating the drawing of the circles.

count

private var count: uint

Counter used to re-randomize the drawing to vary the look.

Lorenz

public function Lorenz(children: uint = 64)

Creates a series of colored circle shapes that are added to the instance sprite.

Parameters

childrencount of number of circles

update

public function update():void

Removes the first circle and adds a new.  Calling this method rapidly can create the illusion of movement.

start

public function start(interval: uint = 1000):void

Start animating the shape.

Parameters

intervalmilliseconds between updates (default 1000)

stop

public function stop():void

Stop animating the shape.

timerHandler

private function timerHandler(event: TimerEvent):void

Handles the timer callback and forces a display update.  Re-randomizes the positional values at regular intervals.

Parameters

eventa timer event

initialize

private function initialize():void

Randomizes the positional values.

generate

private function generate():Shape

Creates a few circles with the next color in the color palette.

Returns

A shape object with circles

calculate

private function calculate():void

Calculates the next x0, y0, z0 values based on their current values.

randomize

private function randomize():Number

Pseudo-randomizes the random numbers returned from Math.random based on the position of the mouse.

private var x0: Number
Position in x.
private var y0: Number
Position in y.
private var z0: Number
Position in z.
private var timer: Timer
Timer used when animating the drawing of the circles.
private var count: uint
Counter used to re-randomize the drawing to vary the look.
public function Lorenz(children: uint = 64)
Creates a series of colored circle shapes that are added to the instance sprite.
public function update():void
Removes the first circle and adds a new.
public function start(interval: uint = 1000):void
Start animating the shape.
public function stop():void
Stop animating the shape.
private function timerHandler(event: TimerEvent):void
Handles the timer callback and forces a display update.
private function initialize():void
Randomizes the positional values.
private function generate():Shape
Creates a few circles with the next color in the color palette.
private function calculate():void
Calculates the next x0, y0, z0 values based on their current values.
private function randomize():Number
Pseudo-randomizes the random numbers returned from Math.random based on the position of the mouse.
Close