AS2 Array count values
AS2 Array count values
Actionscript port of array_count_values
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.
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 More
Dynamic stacking
Dynamic stacking
Array based menu shuffling
In this experiment, you can drag the boxes; when you release them the stack will shuffle to accommodate the dropped box.
I have recently been working on building an application in which I wanted to use Photoshop style ‘layers’ which the user could create, drag onto different depths and delete.
The basic idea was for the user to click and drag ‘layers’, and drop them in between others. This would cause the other layers to reposition to accommodate the new layer and to fill the gap which it had left in it’s old position. Get it? // Read More
Dynamic positioning continued
Dynamic positioning continued
Creating fullscreen flash sites

Following another post regarding using stage listeners to dynamically resize and position MovieClips in Flash, I was asked to upload and FLA as an example. The previous code can just be pasted into the actions panel and will run without any MovieClips needed, and was designed to show the StageListener function rather than showcase a particular dynamic layout. // Read More
Group94 style Menu
Group94 style Menu
Group94 inspired scrolling menu list
I have always liked the neat and compact menu system Group94 often use in their projects. It is really useful for lists or menus and is also of course very elegant.
I don’t know how Group94 do it, but here is my attempt. I have created two prototypes to make it easy to use multiple times within a project. // Read More
Splitting Strings
Splitting Strings
Split strings to an array of phrases
I was working on a project recently where I recieved a data feed and needed to split it into sections that would fit into a text box (ie. 200 characters at a time). The user would then click ‘more‘ and progress through the text in segments until they had read all of it.
I wrote this simple prototype, which splits a string into sections of a defined size (and optionally adds a postfix, ie. “…” to the end), and returns an array containing the segmented text. // Read More
Dynamic Positioning
Dynamic Positioning
Creating fullscreen flash sites
Since fullscreen flash websites have become so popular; this little trick (a necessity really) has been used to make sure that no matter what screen resolution a user has, they can experience the site in the way in which the designer intended.
I realise that listeners are common knowledge, but I have had a lot of emails asking about dynamic positioning so I have written this brief tutorial on how to get all the elements in your Flash movie to position themselves automatically when the user’s browser window resizes, or if they are using a different screen resolution to you and you hate the idea of letting the movie scale! // Read More
Array search and replace
Array search and replace
Search and replace array items
Another find and replace prototype that might be useful for someone. Flash has some useful inbuilt functions like pop() which make life easier, but this prototype will search an array for a particular value and remove it, returning the new array. // Read More
String search and replace
String search and replace
Replace a string with another string
A useful prototype for running a ’search and replace’ on a string in Flash. Great, for example, when a database is spewing out rubbish string pre/post fixes, or HTML code that Flash doesn’t support. Im sure there is similar stuff out there but I hope it will be useful for someone none-the-less. // Read More
Fuse Kit for Flash
Fuse Kit for Flash
Tweening management and shortcuts
Fuse kit is pretty much the most useful Flash extension that a designer could posses at the moment. I have been using the Zigo tweening engine for a long time, and started beta testing Fuse for Moses Gunesch at www.mosessupposes.com a few months back. Fuse now seems to be on public release and trust me, it’s a gem. // Read More



