Actionscript 3.0 Layout Framework
Posted: October 26th, 2008 | Categories: AS3-Layout-Framework, Actionscript 3.0, Design Patterns | 1 CommentThe new AS3-Layout-Framework is now available in the addicted2flash library.
The architecture is straight forward and easy to understand (hopefully). It is basically constructed on top of two abstract interfaces named IComponent and IContainer. The main difference between them is the possiblity to add components.
The layout framework itself is encapsulated from the displaylist, but every Component holds a reference to an Sprite.
To make these components more flexible and powerful, IComponent extends ILayoutObservable, an interface that provides functionality for other objects to listen to specific layout events (f.e. changing of the bounds).
If you are interested in writing custom IComponent or IContainer implementations, please take a look at How to write custom LayoutComponents.
The following uml-diagram shows the core architecture of the layout framework:

The layout framework can be found in the addicted2flash library.
References:
[GHJV95] E. Gamma, R. Helm, R. Johnson, and J. Vlissides, Design Patterns: “ Elements of Reusable Object-Oriented Software, Addison-Wesley, 1995

thank you
thank youthank youthank youthank youthank youthank youthank you