To celebrate my return to the world of Flash, here’s a new component to go into the Minimal Components set:

Quite simple, just two panels and a label, made draggable. I created a simple version for a level editor I’m working on for a game, and decided to make it a permanent fixture.
Here’s the code used to make the above scene:
[as]Component.initStage(stage);
var window1:Window = new Window(this, 100, 100, “Slider Window”);
window1.width = 200;
window1.height = 160;
for(var i:int = 0; i < 10; i++) { var slider:HSlider = new HSlider(window1.content, 10, 10 + i * 12); slider.width = 180; slider.value = Math.random() * 100; } var window2:Window = new Window(this, 150, 150, “Button Window”); window2.width = 120; window2.height = 260; for(i = 0; i < 10; i++) { var btn:PushButton = new PushButton(window2.content, 10, 10 + i * 22, “Button " + i); } var scw:SubclassedWindow = new SubclassedWindow(this, 200, 300, “Subclassed Window”);[/as] See? Simple. But I like how it looks. Fits in well with the other components. As with the Panel, just remember that it’s best to add subcomponents or other items to the content property, rather than the window or panel itself, as the content is masked. I suppose I could override addChild to do that for you, but… whatever. Also, you notice there that I created an instance of SubClassedWindow. That’s just a class I made for this example so you can see how you might want to do that: [as]package { import com.bit101.components.RadioButton; import com.bit101.components.Window; import flash.display.DisplayObjectContainer; public class SubclassedWindow extends Window { public function SubclassedWindow(parent:DisplayObjectContainer=null, xpos:Number=0, ypos:Number=0, title:String=“Window”) { super(parent, xpos, ypos, title); } override protected function init() : void { super.init(); height = 180; for(var i:int = 0; i < 10; i++) { var rb:RadioButton = new RadioButton(content, 10, 10 + i * 15, “Radio " + i); } } } }[/as] Technically, I probably should have added the radio buttons in an overridden addChildren method, but init works too. Anyway, from here, you could add event listeners and other stuff to the content of the window and have it all neatly packaged up in one class. Anyway, get the source or the SWC here: http://code.google.com/p/minimalcomps/
0.97 is the current version.