AS3 Window System (Updated!)

Updated at last and looks much the same. See it here.

The HUD window now accepts a Rectangle, the manager returns the window itself so you can do stuff with it, plus it’s now dead easy to add content. A HUDContent MovieClip just needs a rectangular MC inside it called winArea to define the initial visible area. This can be placed anywhere in the HUDContent and seems to work a treat. Here’s what you do:

1
2
3
4
5
6
7
import tv.palmerama.gui.*;

var rect:Rectangle = new Rectangle(10, 10, 350, 200);
var HUDwindow:HUD = winManager.newWindow(rect, 0.2, "My First HUD Window", true, true);

var winContents:WinContents = new WinContents();
HUDwindow.setContents(winContents);

Just extend HUDContent for content movieclips. Incidentally, this class may not seem to do much at the moment, just allowing control over resizing, but I have a feeling I may add more functionality sometime soon so it makes sense to use it now.

Here’s a zip of the source with the FLA as an example and the Classes. And yes, please use it for anything you like. It’d just be nice to see it though, if you do. Cheers.

Next step’s probably to add functionality to make the windows work as proper AIR windows on the desktop. Could be handy I think.