Flex runtime spacer

I am using Flex 4 for one of my Flex project. That project needs some dynamic spacing between the components. Here is the example code for the runtime spacer. I am using spark components here.


<?xml version="1.0" encoding="utf-8"?>

<s:Application name="Spark_Spacer_Test"
        xmlns:mx="library://ns.adobe.com/flex/mx" >

        <s:Label text="Space (px):" />
        <s:HSlider id="sl" minimum="0" maximum="600" value="200" />

<s:HGroup top="20" horizontalCenter="0">
                <s:Button id="button1" label="Me" />
        <s:VGroup id="vSpacer" width="{sl.value}" >
                <s:Rect width="{sl.value}" height="0" />
                <s:Button id="button2" label="You" />


Running example:

Show Comments