C o L i n C h e e
2 5 3 4 2 7 4
c o l i n c h e e . n e t
S w i n b u r n e
U n i v e r s i t y

Al g o r i t h m S c r i p t

position_shift = 400;
spiro_01_mc = this.createEmptyMovieClip('spiro'+i, this.getNextHighestDepth());
spiroGraph(spiro_01_mc);
spiro_02_mc = this.createEmptyMovieClip('spiro'+i, this.getNextHighestDepth());
spiroGraph(spiro_02_mc);
spiro_02_mc._xscale = -100;
spiro_02_mc._x = position_shift;
spiro_03_mc = this.createEmptyMovieClip('spiro'+i, this.getNextHighestDepth());
spiroGraph(spiro_03_mc);
spiro_03_mc._yscale = -100;
spiro_03_mc._y = position_shift;
spiro_04_mc = this.createEmptyMovieClip('spiro'+i, this.getNextHighestDepth());
spiroGraph(spiro_04_mc);
spiro_04_mc._xscale = -100;
spiro_04_mc._yscale = -100;
spiro_04_mc._x = position_shift;
spiro_04_mc._y = position_shift;
function spiroGraph(target_mc) {

var spiroCount = 50;
var xOffset = 0, yOffset = 0;
var xSize = 400, ySize = 400;
var lineAlpha = 40, fillAlpha = 20;
var lineColor = '0x000000', fillColor = '0x000066';

for (var i = 1; i<=spiroCount; i++) {
var tempName = target_mc.createEmptyMovieClip('spiroClip'+i, target_mc.getNextHighestDepth());

tempName.lineStyle(1, lineColor, lineAlpha);
// tempName.beginFill(fillColor, fillAlpha);

tempName.moveTo(xOffset, yOffset);
to determine how far along to go
tempName.lineTo(xOffset+xSize-((xSize/(spiroCount+1))*i), yOffset);
tempName.lineTo(xOffset, yOffset+((ySize/(spiroCount+1))*i));
tempName.lineTo(xOffset, yOffset);
}