Setting a custom divider alpha on the DividedBox container in Flex

by Peter deHaan on October 14, 2008

in HDividedBox, VDividedBox

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>

Leave a Comment

Sorry, this blog is terrible at eating HTML comments.
If you're pasting any HTML/XML/MXML code, you need to convert your < characters to &lt; and your > characters to &gt; .

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Anti-Spam Protection by WP-SpamFree

Previous post:

Next post: