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 v2
Version 3 is now available here
I’ve made a few changes to my polar clock to make it clearer to read, and now there’s also a PC installer
Polar Clock Screensaver
UPDATE:
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.
A better implementation of FlashVars
[slug]DataTypedFlashVars[/slug]Patrick Mineault has an interesting approach to using flashVars and getting data typed objects passed into Flash.
SWFObject add-on: MouseWheel on Mac OS
I’ve had the mouse wheel working in flash on OS X for a while, and after seeing the SWFAddress add-on for deconcept’s SWFObject embedding system, I thought I’d add mousewheel functionality to SWFObject, rather than using my own “frankenstein” embedding system.
It’s straight forward to implement. Download SWFMacMouseWheel here.
