AS3 liquid layout class

I’m sure everyone has needed one of these at one time or another. I just decided to finally get one together for myself.

To use, you first call StageAlignTool.init() and pass in the stage, and optionally a minimum width and a minimum height (defaults to 1024×768).
Next, you call StageAlignTool.registerLocation() and pass in the displayObject you wish to register, which position you wish it to lock to (StageAlignTool .TL means Top Left, StageAlignTool.MC means Middle Center), and optionally if you want it to stay relative to where it is now (true) or snap to the edge of the stage (false).
The class automatically sets your stage scale mode to NO_SCALE and the stage align to TOP_LEFT. It also expects the display objects you pass it to have their registration points in the top left corner.

Download

Usage:


//StageAlignTool.init(Stage reference[, min width = 1024, min height = 768]);
StageAlignTool.init(stage, 1024, 768);

//StageAlignTool.registerLocation(a DisplayObject, position to lock to[, stay relative to current = false]);
//possible locations are [StageAlignTool.]TL, TC, TR, ML, MC, MR, BL, BC, BR

StageAlignTool.registerLocation(bg, StageAlignTool.MC);

Give it a try and tell me what you think.

AS3 bitmap mosaic class

This class will allow you to create a pixellated copy of any display object.

It allows for varying pixel sizes and caching of rendered pixels so you don’t have to redraw them every time.

mosaic

Usage is as follows:

var myMoz:Mosaic = new Mosaic(yourDisplayObj:DisplayObject, pixelSize:uint, useCache:Boolean);
addChild(myMoz);

or

var myMoz:Mosaic = new Mosaic(yourDisplayObj);
myMoz.pixelSize = 10;
myMoz.render();

Give it a try and let me know what you think.

Latest project: save-my-relationship.com

See my latest at:

http://save-my-relationship.com/

It is a landing page for a banner campaign for Energizer’s Energi To Go iPod charger. The concept was mocking ‘relationship aide’ products such as Viagra or even dating sites. One huge bug though is that something with the Tween class in ActionScript 3 makes some tweens just decide to up and stop when running in Firefox, which means that if you’re visiting with FF you’ll only see the HTML page 🙁 If you would like to give me your feedback on the Flash version it’s directly linked here