2D Cellular Automata

Inspired by Conway’s game of life, I decided to program a 2 dimensional Cellular Automaton in Actionscript 3.

I had been reading up on complexity theory for a recent project and the Cellular Automata just kept on rearing its head. Of course it displays the fundamental qualities of complexity; starting with an object following a set of simple rules and then creating multiple instances to form complex and unpredictable patterns. Read : 2D Cellular Automata »

Posted on 06 May 2008
31 Comments
6 Trackbacks

Alphabet Particle Emitter

Ok, so there’s not much to say here!

I’m no mathematician, but I’ve been working on putting together a simple particle engine which harnesses the awesome power of Actionscript 3. Read : Alphabet Particles AS3 »

Posted on 28 Apr 2008
12 Comments
8 Trackbacks

AS3 Group94 Style Menu

Welcome to the latest instalment of the Group 94 style scrolling menu tutorial! (With downloadable source files of course) Read : AS3 Group94 Menu »

Posted on 24 Oct 2007
51 Comments
1 Trackbacks

Group94 Circular Menu
Download: AS2 Group94 Circular Menu

I built this circular version of the group94 style scrolling menu for a flash website awards showcase I was asked to work on. The original design was based around circles, but we ended up redesigning as parts of the interface (not this menu!) were too processor intensive.

Ok, so part two of my tribute to Group 94’s menu system! This is again inspired by the Group 94 (at least they are most famous for it) shuffle menu in Flash, which pushes items off the top and bottom as the menu shuffles into place. Read : G94 Circular Menu »

Posted on 07 Aug 2007
Posted in
54 Comments
2 Trackbacks

array_count_values in Actionscript

In PHP there is a very useful function called array_count_values. It sorts an array by returning a 2 dimensional array consisting of non duplicate elements as keys, and values determined by how many times these elements appeared in the original array.

update 09.10.10

This can be achieved (in AS2 and AS3) in a much simpler manner, using the following function or prototype:

Array.prototype.countValues = function() : Array
{
	var i, j = -1, c, o = {}, r = [], v, n = a.length;
	for(i = 0;i < n;++i) (c = o[v = a[i]]) ? ++c[1] : r[int(++j)] = o[v] = [v,1];
	return r;
}

So, for example, an array [“red”,”green”,”blue”,”red”] would be converted into [“red” => 2, “green” =>1, “blue” => 1]. Duplicate elements are removed and the new array indicates how many times each, now unique value occurred in the array.

Unfortunately, Actionscript has no such function built in, so I made one. It is a modification of Senocular’s array.unique() prototype (which you can find in his Actionscript library), however rather than simply returning a unique array, it returns the 2 dimensional array mentioned above. Read : AS2 Array count values »

Posted on 20 Jun 2007
Posted in
Tagged
5 Comments
0 Trackbacks

About me

Soulwire is a weblog by Justin Windle; a Senior Interactive Developer at Fi (Fantasy Interactive), Stockholm – I often Tweet, Flik, Link and Vim.

Warning: file_get_contents(http://search.twitter.com/search.atom?q=from:soulwire&rpp=1) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 410 Gone in /home/soulwire/webapps/soulwire_blog/wp-content/themes/soulwire/functions.php on line 203