/* Slits and Rods - Justin Hall - March 2005 Interactive Animation - with help from Aaron David Meyers (muchas), Doox, EFN, Ben and Larissa Bank */ attachMovie("opening", "open", 2001); open._x = Stage.width/2; open._y = Stage.height/2; function circular () { trace ("circular loaded - opening unloaded"); attachMovie("circle", "circ", 2002); open.removeMovieClip(); circ._x = Stage.width/2; circ._y = Stage.height/2; _root.circ.onRollOver = function () { trace("onroll"); onRoll(); } circ.onRelease = function() { var bevin_drone:Sound = new Sound(); bevin_drone.attachSound("C3B4_Sample11.aif"); // bevin_drone.start(0,0); trace ("circ - onrelease"); bevinInterval = setInterval( bevinBleeps, 1000 ); spawnInterval = setInterval( spawn, 2000 ); spawn2Interval = setInterval( spawn2, 4000 ); spawn3Interval = setInterval( spawn3, 6000 ); spawn4Interval = setInterval( spawn4, 9000 ); spawn5Interval = setInterval( spawn5, 12000 ); spawn6Interval = setInterval( spawn6, 15000 ); spawn7Interval = setInterval( spawn7, 20000 ); spawn8Interval = setInterval( spawn8, 22000 ); spawn9Interval = setInterval( spawn9, 23000 ); stop(); } } function onRoll () { if (circ._xscale >= 16) { //trace ("shrinking"); shrinkInterval = setInterval( shrinkCirc, 50 ); } } function shrinkCirc () { circ._xscale *= .90; circ._yscale *= .90; clearInterval(shrinkInterval); onRoll (); } function bevinBleeps () { var bevin_bleeps:Sound = new Sound(); bevin_bleeps.attachSound("C3B4_Sample05.aif"); bevin_bleeps.start(0,2); clearInterval(bevinInterval); } function spawn () { circ.unloadMovie(); clearInterval(spawnInterval); trace ("spawn1"); bevinInterval = setInterval( bevinBleeps, 100 ); zeroes (); zeroes2 (); lines (); lines2 (); stop(); } function spawn2 () { circ.unloadMovie(); clearInterval(spawn2Interval); trace ("spawn2"); clearInterval(bevinInterval); bevinInterval = setInterval( bevinBleeps, 100 ); nozeroes (); zeroes3 (); nozeroes2 (); zeroes4 (); nolines (); lines3 (); nolines2 (); lines4 (); stop(); } function spawn3 () { circ.unloadMovie(); clearInterval(spawn3Interval); trace ("spawn3"); clearInterval(bevinInterval); bevinInterval = setInterval( bevinBleeps, 100 ); nozeroes3 (); zeroes (); nozeroes4 (); zeroes2 (); nolines3 (); lines (); nolines4 (); lines2 (); stop(); } function spawn4 () { clearInterval(spawn4Interval); trace ("spawn4"); nozeroes (); zeroes3 (); nozeroes2 (); zeroes4 (); nolines (); lines3 (); nolines2 (); lines4 (); stop(); } function spawn5 () { circ.unloadMovie(); clearInterval(spawn5Interval); clearInterval(bevinInterval); bevinInterval = setInterval( bevinBleeps, 1000 ); trace ("spawn5"); nozeroes3 (); zeroes (); nozeroes4 (); zeroes2 (); nolines3 (); lines (); nolines4 (); lines2 (); stop(); } function spawn6 () { clearInterval(spawn6Interval); trace ("spawn6"); clearInterval(bevinInterval); bevinInterval = setInterval( bevinBleeps, 200 ); nozeroes (); zeroes3 (); nozeroes2 (); zeroes4 (); nolines (); lines3 (); nolines2 (); lines4 (); stop(); } function spawn7 () { circ.unloadMovie(); clearInterval(spawn7Interval); trace ("spawn7"); clearInterval(bevinInterval); bevinInterval = setInterval( bevinBleeps, 100 ); nozeroes3 (); zeroes (); nozeroes4 (); zeroes2 (); nolines3 (); lines (); nolines4 (); lines2 (); stop(); } function spawn8 () { clearInterval(spawn8Interval); trace ("spawn8"); clearInterval(bevinInterval); bevinInterval = setInterval( bevinBleeps, 100 ); zeroes3 (); zeroes4 (); lines3 (); lines4 (); stop(); } function spawn9 () { clearInterval(bevinInterval); // _root.circmi6_6.removeMovieClip(); // _root.liner6_6.removeMovieClip(); } function zeroes () { trace ("zeroes"); for(i=0;i<19;++i){ for(j=0;j<24;++j){ this.attachMovie("circle-mini", "circmi"+i+"_"+j, (i-1)*24+j); this ["circmi"+i+"_"+j]._x = i*32 +10; this ["circmi"+i+"_"+j]._y = j*32 +10; this ["circmi"+i+"_"+j].onRelease = function () { var bevin_punch:Sound = new Sound(); bevin_punch.attachSound("C3B4_Sample02.aif"); bevin_punch.start(0,0); this.removeMovieClip(); } } } clearInterval(zInterval); } function nozeroes () { trace ("nozeroes"); for(i=-1;i<19;++i){ for(j=-1;j<24;++j){ _root ["circmi"+i+"_"+j].removeMovieClip(); } } clearInterval(nzInterval); } function zeroes2 () { trace ("zeroes2"); clearInterval(z2Interval); for(i=0;i<18;++i){ for(j=0;j<24;++j){ this.attachMovie("circle-mini", "circmini"+i+"_"+j, (i-1)*24+j+5000); this ["circmini"+i+"_"+j]._x = i*32 +26; this ["circmini"+i+"_"+j]._y = j*32 +26; this ["circmini"+i+"_"+j].onRelease = function () { var bevin_punch:Sound = new Sound(); bevin_punch.attachSound("C3B4_Sample02.aif"); bevin_punch.start(0,0); this.removeMovieClip(); } } } } function nozeroes2 () { trace ("nozeroes2"); for(i=0;i<19;++i){ for(j=0;j<24;++j){ _root ["circmini"+i+"_"+j].removeMovieClip(); } } clearInterval(nz2Interval); } function zeroes3 () { trace ("zeroes3"); for(i=0;i<18;++i){ for(j=0;j<24;++j){ this.attachMovie("circle-mini", "circlemi"+i+"_"+j, (i-1)*24+j+25000); this ["circlemi"+i+"_"+j]._x = i*32 +26; this ["circlemi"+i+"_"+j]._y = j*32 +10; this ["circlemi"+i+"_"+j].onRelease = function () { var bevin_punch:Sound = new Sound(); bevin_punch.attachSound("C3B4_Sample02.aif"); bevin_punch.start(0,0); this.removeMovieClip(); } } } } function nozeroes3 () { trace ("nozeroes3"); for(i=0;i<19;++i){ for(j=0;j<24;++j){ _root ["circlemi"+i+"_"+j].removeMovieClip(); } } clearInterval(nz3Interval); } function zeroes4 () { trace ("zeroes4"); for(i=0;i<19;++i){ for(j=0;j<24;++j){ this.attachMovie("circle-mini", "circlemini"+i+"_"+j, (i-1)*24+j+30000); this ["circlemini"+i+"_"+j]._x = i*32 +10; this ["circlemini"+i+"_"+j]._y = j*32 +26; this ["circlemini"+i+"_"+j].onRelease = function () { var bevin_punch:Sound = new Sound();bevin_punch.attachSound("C3B4_Sample02.aif"); bevin_punch.start(0,0); this.removeMovieClip(); } } } } function nozeroes4 () { trace ("nozeroes4"); for(i=0;i<19;++i){ for(j=0;j<24;++j){ _root ["circlemini"+i+"_"+j].removeMovieClip(); } } clearInterval(nz4Interval); } function lines () { trace ("lines"); for(m=0;m<19;++m){ for(n=0;n<24;++n){ this.attachMovie("line", "line"+m+"_"+n, (m-1)*24+n+10000); this ["line"+m+"_"+n]._x = m*32 +26; this ["line"+m+"_"+n]._y = n*32 +10; this ["line"+m+"_"+n].onRelease = function () { var bevin_punch:Sound = new Sound();bevin_punch.attachSound("C3B4_Sample02.aif"); bevin_punch.start(0,0); this.removeMovieClip(); } } } } function nolines () { trace ("nolines"); for(m=0;m<19;++m){ for(n=0;n<24;++n){ _root ["line"+m+"_"+n].removeMovieClip(); } } clearInterval(nlInterval); } function lines2 () { trace ("lines2"); for(m=0;m<19;++m){ for(n=0;n<24;++n){ this.attachMovie("line", "lines"+m+"_"+n, (m-1)*24+n+20000); this ["lines"+m+"_"+n]._x = m*32 +10; this ["lines"+m+"_"+n]._y = n*32 +26; this ["lines"+m+"_"+n].onRelease = function () { var bevin_punch:Sound = new Sound();bevin_punch.attachSound("C3B4_Sample02.aif"); bevin_punch.start(0,0); this.removeMovieClip(); } } } } function nolines2 () { trace ("nolines2"); for(m=0;m<19;++m){ for(n=0;n<24;++n){ _root ["lines"+m+"_"+n].removeMovieClip(); } } clearInterval(nl2Interval); } function lines3 () { trace ("lines3"); for(m=0;m<19;++m){ for(n=0;n<24;++n){ this.attachMovie("line", "liner"+m+"_"+n, (m-1)*24+n+35000); this ["liner"+m+"_"+n]._x = m*32 +10; this ["liner"+m+"_"+n]._y = n*32 +10; this ["liner"+m+"_"+n].onRelease = function () { var bevin_punch:Sound = new Sound(); bevin_punch.attachSound("C3B4_Sample02.aif"); bevin_punch.start(0,0); this.removeMovieClip(); } } } } function nolines3 () { trace ("nolines3"); for(m=0;m<19;++m){ for(n=0;n<24;++n){ _root ["liner"+m+"_"+n].removeMovieClip(); } } clearInterval(nl3Interval); } function lines4 () { trace ("lines4"); for(m=0;m<19;++m){ for(n=0;n<24;++n){ this.attachMovie("line", "liners"+m+"_"+n, (m-1)*24+n+40000); this ["liners"+m+"_"+n]._x = m*32 +26; this ["liners"+m+"_"+n]._y = n*32 +26; this ["liners"+m+"_"+n].onRelease = function () { var bevin_punch:Sound = new Sound(); bevin_punch.attachSound("C3B4_Sample02.aif"); bevin_punch.start(0,0); this.removeMovieClip(); } } } } function nolines4 () { trace ("nolines4"); for(m=0;m<19;++m){ for(n=0;n<24;++n){ _root ["liners"+m+"_"+n].removeMovieClip(); } } clearInterval(nl4Interval); } /* unimplemented routine for tweening circles and lines as they move from the center to their spots on the grid (thanks Aaron and Robert Penner): function circular () { if (_root.openingend = true) { attachMovie("circle", "circ", 2002); opening.unloadMovie(); circ._x = Stage.width/2; circ._y = Stage.height/2; circle.t; circle.s; circle.c; circle.d; circ.onRollOver = function() { circ.t=0; circ.s=circle._xscale; circ.c=16; circ.d=30; circ.onEnterFrame = circMove; } function circMove() { if(circ.t