So you are desperate looking for that all snippet for centering things? I’ve been looking during hours until I found the solution
In Flex 3 you may use this to center elements on a container:
width=”100%” height=”100%“ horizontalAlign=”center” verticalAlign=”middle“ >
But with Spark things has changed and now you need to write a little more code
width=”100%” height=”100%“>
columnAlign=”justifyUsingWidth” rowAlign=”justifyUsingHeight” horizontalAlign=”center” verticalAlign=”middle” requestedColumnCount=”1” requestedRowCount=”1” />
/>
I don’t know if this is the best way to do that, but is the only one I found so far…
I hope this snippet help you!!!!
No related posts.

I’m not sure I understood you right but if you want to center an object in a container …
in Flex 3 you would do …
In Flex 4 you would do ….
Group by default follows BasicLayout which is the same as the layout of Canvas in Flex 3
HorizontalLayout implements a layout similar to HBox in Flex 3
Sorry, you should be able to see it now, I having some problems with the editor…
Ok, Wordpress ate the … one more try …
I’m not sure I understood you right but if you want to center an object in a container …
in Flex 3 you would do …
<mx:Canvas width=”100%” height=”100%”>
<mx:Button horizontalCenter=”0″ verticalCenter=”0″/>
</mx:Canvas>
In Flex 4 you would do ….
<s:Group width=”100%” height=”100%”>
<s:Button horizontalCenter=”0″ verticalCenter=”0″/>
</s:Group>
Group by default follows BasicLayout which is the same as the layout of Canvas in Flex 3
HorizontalLayout implements a layout similar to HBox in Flex 3
It’s true, HorizontalLayout implements a similar HBox container but you can’t use horizontalAlign. The same occurs with VerticalLayout with verticalAlign.