STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
228098
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2561 · P5121

swfchan turned sixteen years old yesterday! (5may2024)

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/95812084?noj=FRM95812084-6DC" width="1" height="1"></div>

GameOfLife2.swf

This is the info page for
Flash #17717

(Click the ID number above for more basic data on this flash file.)


Text
RUN

Actions

STEP

CLEAR

STOP

ActionScript [AS1/AS2]

Frame 1
function createGrid() { grid = new Array(); y = 0; while (y < 15) { var _local1 = new Array(); x = 0; while (x < 25) { mc = attachMovie("gridbox", (("gridbox " + x) + " ") + y, (y * 25) + x); mc._x = (x * 20) + 30; mc._y = (y * 20) + 30; mc.x = x; mc.y = y; _local1.push(false); x++; } grid.push(_local1); y++; } } function cycle() { var _local2 = this; var _local1 = duplicateGrid(); y = 0; while (y < 15) { x = 0; while (x < 25) { thisBox = _local1[y][x]; mc = _local2[(("gridbox " + x) + " ") + y]; n = 0; n = n + _local1[y - 1][x - 1]; n = n + _local1[y - 1][x]; n = n + _local1[y - 1][x + 1]; n = n + _local1[y][x - 1]; n = n + _local1[y][x + 1]; n = n + _local1[y + 1][x - 1]; n = n + _local1[y + 1][x]; n = n + _local1[y + 1][x + 1]; if (thisBox) { if ((n == 2) or (n == 3)) { newValue = true; } else { newValue = false; } } else if (n == 3) { newValue = true; } else { newValue = false; } grid[y][x] = newValue; if (newValue) { mc.gotoAndStop(2); } else { mc.gotoAndStop(1); } x++; } y++; } } function duplicateGrid() { var _local2 = new Array(); y = 0; while (y < 15) { var _local1 = new Array(); x = 0; while (x < 25) { _local1.push(grid[y][x]); x++; } _local2.push(_local1); y++; } return(_local2); } function runCycle() { if (running) { cycle(); } } function startCycle() { running = true; } function stepCycle() { cycle(); } function stopCycle() { running = false; } function clear() { var _local1 = this; y = 0; while (y < 15) { x = 0; while (x < 25) { grid[y][x] = 0; _local1[(("gridbox " + x) + " ") + y].gotoAndStop(1); x++; } y++; } running = false; } createGrid(); stop();
Instance of Symbol 11 MovieClip in Frame 1
onClipEvent (enterFrame) { _parent.runCycle(); }
Symbol 3 Button
on (release) { if (_currentframe == 1) { gotoAndStop (2); _parent.grid[y][x] = true; } else { gotoAndStop (1); _parent.grid[y][x] = false; } }
Symbol 5 MovieClip [gridbox] Frame 1
stop();
Symbol 9 Button
on (release) { startCycle(); }
Symbol 13 Button
on (release) { stepCycle(); }
Symbol 15 Button
on (release) { clear(); }
Symbol 17 Button
on (release) { stopCycle(); }

Library Items

Symbol 1 GraphicUsed by:5
Symbol 2 GraphicUsed by:3
Symbol 3 ButtonUses:2Used by:5
Symbol 4 GraphicUsed by:5
Symbol 5 MovieClip [gridbox]Uses:1 3 4
Symbol 6 GraphicUsed by:9 13 15 17
Symbol 7 FontUsed by:8 10 12 14 16
Symbol 8 EditableTextUses:7Used by:9
Symbol 9 ButtonUses:6 8Used by:Timeline
Symbol 10 EditableTextUses:7Used by:11
Symbol 11 MovieClipUses:10Used by:Timeline
Symbol 12 EditableTextUses:7Used by:13
Symbol 13 ButtonUses:6 12Used by:Timeline
Symbol 14 EditableTextUses:7Used by:15
Symbol 15 ButtonUses:6 14Used by:Timeline
Symbol 16 EditableTextUses:7Used by:17
Symbol 17 ButtonUses:6 16Used by:Timeline

Special Tags

ExportAssets (56)Timeline Frame 1Symbol 5 as "gridbox"




http://swfchan.com/4/17717/info.shtml
Created: 31/5 -2019 16:24:03 Last modified: 31/5 -2019 16:24:03 Server time: 06/05 -2024 23:08:43