Posted under ActionScript 2.0.

Looping within a range

Something I have to do very often is looping a number within a range. This could be for a carousel navigation, a rotating banner or image slideshow, etc. The concept is simple, have a range, say 1 – 20, and simply call next() / previous() on it and return the new number, if it goes above 20, return to 1, if below 1, return to 20.
Read more…

Polar Clock Screensaver


Version 3 is now available here

View Polar Clock

Download Screensaver for Mac OS X only.

I’ve just put this together as a bit of a test of some drawing API extensions I wrote a while ago. All the shapes are drawn with code, corner rounding curves are achieved using the ‘capStyle’ argument when setting the lineStyle, easy as that! The colour of each ring is based on an HSL colourwheel.

Kernel Debugger

I’ve been using this for a long time now, it’s a debugger that runs in another SWF and is passed trace statements via my Debug class, with different levels or detail, info, warning, event, classinfo, error etc. It also has a runtime monitor graph at the bottom, the yellow line showing the current framerate, and the blue line showing the time it takes to execute all threads currently running in the Kernel class. The Kernel is basically a single onEnterFrame on a MovieClip in the _root, which runs through an array of threads, I simply have a getTimer() at either side of the thread execution and time it, this is a great way to view code-weight, especially when developing games or persistent enviornments such as physical engines.

I will make a public release of the Kernel, Thread and ThreadGroup classes soon, which will also include the debugger.

2D Physics API

I’ve recently been doing some games work that required some pretty full on physics, after battling with vectors and collision reflection on wheels and other objects, I ditched what I had done and am now working with FlaDE (Flash Dynamics Engine) an AS 2.0 GPL Licensed API. It’s written by Alec Cove, and is very easy to use. It never went to final release, and he has now moved on to APE (ActionScript Physics Engine) which is written instead in AS 3.0 and is again GPL Licensed.