14
Oct
08

Setting a custom divider alpha on the DividedBox container in Flex

In a previous example, “Setting a custom divider color on the DividedBox container in Flex”, we saw how you could set a custom divider color on a Flex DividedBox container (HDividedBox or VDividedBox) by setting the dividerColor style.

The following example shows how you can set a custom divider alpha on a Flex DividedBox container (HDividedBox or VDividedBox) by setting the dividerAlpha style.

Full code after the jump.

View MXML

<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2008/10/14/setting-a-custom-divider-alpha-on-the-dividedbox-container-in-flex/ -->
<mx:Application name="HDividedBox_dividerAlpha_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white">

    <mx:ApplicationControlBar dock="true">
        <mx:Form styleName="plain">
            <mx:FormItem label="dividerAlpha:"
                    direction="horizontal">
                <mx:HSlider id="slider"
                        minimum="0.0"
                        maximum="1.0"
                        value="0.75"
                        snapInterval="0.05"
                        tickInterval="0.1"
                        liveDragging="true" />
                <mx:Label text="{Math.round(slider.value * 100)}%" />
            </mx:FormItem>
        </mx:Form>
    </mx:ApplicationControlBar>

    <mx:HDividedBox id="dividedBox"
            dividerAlpha="{slider.value}"
            width="100%"
            height="100%">
        <mx:Box id="box1"
                backgroundColor="haloGreen"
                width="100%"
                height="100%"
                minWidth="100" />
        <mx:Box id="box2"
                backgroundColor="haloBlue"
                width="100%"
                height="100%"
                minWidth="100" />
    </mx:HDividedBox>

</mx:Application>

0 Responses to “Setting a custom divider alpha on the DividedBox container in Flex”


  1. No Comments

Leave a Reply

This blog is terrible at eating HTML tags. If you plan on posting code/XML, please escape your "<" characters as "&lt;" and your ">" characters as "&gt;".




Badge Farm

  • Powered by Redoable 1.2
  • Cornify
  • Feeds burnt by Feedburner
  • Feed