AS 3.0 layout manager
I’ve created a custom layout manager in AS 3.0 which provides some of the automatic scaling and positioning that Flex provides.
You can register objects and specify a size to maintain relative to the stage size, alignment, padding and set a function that is called when the screen is resized.
This is a first version and it may (and most likely will) change in the future.
Download: LayoutManager.as and LayoutTarget.as
Categories: programming
NIce work raph, I would be interested in seeing a little example AS3 app applying your logic
sorry I meant ‘ralph’, I hate typos on names
I created this class in the context of http://www.hilfigerdenim.com, which I built. When you resize the window, you will notice that everything either scales along (like background images and the main menu) or keeps its relative position (like the bottom taskbar).
In the code you can see which methods are available, but if you would like comments explaining them let me know and I will add them as soon as I find the time
Looks like a nice work but we need an example …we’re beginners !
I’ve put a really simple example online that shows a square that’s kept at half the width and half the height of the stage, and is always center aligned.
Download the example code at http://www.rockabit.com/downloads/layoutmanager_example.zip