ActionScript 3 Minimal Comps for Quick Prototyping

minimal_duck

Recently, Keith Peters has been putting overtime into his Minimal Comps library. It’s an ActionScript 3 library that offers a large number of typical user interface components. Easily and quickly you can construct basic user interfaces in ActionScript. When Flex is a little too heavy, this is a really neat solution.

This is basically the most minimal minimal component application you’re going to see:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package 
{
	import com.bit101.components.PushButton;
	import flash.display.Sprite;
	import flash.events.Event;
	import org.flashdevelop.utils.FlashConnect
 
	public class Main extends Sprite
	{
		public function Main():void
		{
			if (stage) init();
			else addEventListener(Event.ADDED_TO_STAGE, init);
		}
 
		private function init(e:Event = null):void
		{
			removeEventListener(Event.ADDED_TO_STAGE, init);
 
			new PushButton(this, 100, 100, "Click me", onBtnClick);
		}
 
		private function onBtnClick(e:Event):void
		{
			FlashConnect.trace("clicked");
		}
	}
}

Inspired by this minimal tutorial and written for FlashDevelop (remove the FlashConnect statements if you’re working in another editor).

BTW I wanted to give a demonstration where I integrated the YouTube data API, but it appears that none of the libraries are really up-to-date and/or well enough documented to get started in under 15 minutes. This one comes closest, but if you have a good suggestion, please let me know.

(image credit)

Be Sociable, Share!
This entry was posted in Flash and ActionScript and tagged , . Bookmark the permalink. Both comments and trackbacks are currently closed.
  • Feedback or questions?

    Due to excessive (and I do mean excessive!) spam, comments and the feedback forms have been disabled. I'm very sorry for the inconvenience, but you can still contact me through Facebook and Twitter.