Libraries/Code

When programming interactives, it’s important to have the right tools.

I’m publishing here as open-source various pieces of code, mainly generic ActionScript 3 (AS3) classes, that I constantly reuse when developing. I hope you find these useful; they may save you considerable time, or at least serve as an example from which you can build your own library. These libraries have been slowly developed over the years and I (generally) take pains to try to ensure they are simple to use, easy to understand, and bug free. Unfortunately though I haven't had time to fully document some of the larger packages.

The ‘Swiss Army Knife’ metaphor, usually used to describe useful but bloated code, is used here somewhat tongue-in-cheek. Most of these classes and packages are dedicated to doing one thing as easily and efficiently as possible.

The whole AS3 utilities package may be browsed here with general ActionScript Documentation (AsDoc) found here.

Thumbnail Example Description Ver. Updated

Asset Loader

AssetLoader.as is an AS3 package that allows you to easily bulk load and unload assets from external files, being able to load .xml, .swf, .aif, .mp3, .wav, .bmp, .png, .jpg, .html, .txt, .bin, and .zip files. It will also load classes or class definitions out of specific .swf files.

AssetLoader is available at Google Code http://code.google.com/p/lowke-assetloader/.

2.8

June '11

Button Controller

ButtonController.as is an AS3 package that takes a MovieClip with labeled "up", "over", "down" and (optional) "disabled" frames and controls it to behave like an animated button, playing backwards and forwards between labels when the user rolls over, rolls out, and clicks on the button. ButtonController also supports functionality for multiple states, click and roll sounds, disabled alpha, simulated clicks, variable frame rate, and keyboard shortcuts.

ButtonController is available at Google Code http://code.google.com/p/lowke-buttoncontroller/.

1.5

June '11

AssetManager

AssetManager.as delegates between the AssetLoader and Cache packages for managing assets.

3.0.3

June '11

Animatem

Animatem.as is a game and general purpose animation package emphasizing ease of use. There are two versions of Animatem, an ActionScript3 version and a smaller JavaScript version for use with HTML5 and the Canvas tag.

Animatem is essentially a multi-purpose Tween package, much like the well known TweenMax by GreenSock, only it's designed specifically for manipulating tweens and velocities that may change interactively at any moment—as frequently needed in games and simulations.

Animatem is available at Google Code http://code.google.com/p/lowke-animator/.

1.7.1

Mar '11

SoundManager

SoundManager.as uses the AssetManager in such a way specifically for dealing with sound.

1.2

Feb '10

PlayFrames

PlayFrames.as is a MovieClip frame controller for playing clips backwards or forwards at varying frame rates.

1.3

Apr '11

ParabolaEasing

ParabolaEasing.as is an easing function for use with tweening that allows greater control than the traditional Adobe Sine.easeOut.

1.0.1

Nov '10

Alert

Alert.as is an AS3 package that lets you quickly and easily overlay an alert message an screen, accompanied by a traditional style ‘info’, ‘question’, ‘warning’, or ‘error’ icon.

1.0

Oct '09

LogAs

LogAs.as is an AS3 package useful in production environmets where errors need to be logged and dealt with rather than causing a crash. In particular, LogAs allows errors to be classed as either ‘severe’, ‘warning’, ‘info’, or ‘debug’.

2.0

Feb '10

Cache As Bitmap

CacheAsBitmap.as is an AS3 class that corrects an issue with the cacheAsBitmap flag of Flash DisplayObject, where setting this flag fails to also set it for all its embedded children.

CacheAsBitmap recursively sets all flags for all embedded children while keeping the instance names of the DisplayObject’s children intact for access by code.

1.6

July '09

Callback

Callback.as is an AS3 class that listens for an event from any EventDispatcher object and, just once, triggers a function with arguments when that event is dispatched. This is an easy way to piggyback additional arguments onto an event listener, essentially turning an event into a function callback with arguments.

1.8

June '11

DoLater

DoLater.as is an AS3 class that allows you to queue a function to be called once the Flash Player has updated to the next frame and symbols on the frame have been created.

This can be very handy for getting you out of a tight spot.

1.6

June '11

Delay

Delay.as is an AS3 class that tells ActionScript to call a function just once after a specified interval.

delay() should be used in preference to the deprecated flash.utils.setTimeout().

2.1

June '11

Matrix

Matrix.h is a useful C++ template for dealing with matrices.

1.0

Jan '05

© Copyright 2016, Lowke Media. All Rights Reserved.
Lowke Media 24 Roy St, Box #202, Seattle, WA 98109-4018
russ[at]lowkemedia.com