Another quick sample (I’m cleaning out my Flex projects from the past year). This time we look at controlling a Panel container’s roundness versus squareness by setting the cornerRadius style.

Just drag the slider to control the corner radius of the two panels (one with a ControlBar and one without).

Full code after the jump.

View MXML

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" backgroundColor="white">

    <mx:Script>
        <![CDATA[
            private function dataTipFormatFunc(item:Number):String {
                return "cornerRadius = " + item;
            }
        ]]>
    </mx:Script>

    <mx:HBox id="hBox">
        <mx:Panel title="Panel w/o ControlBar" cornerRadius="{slider.value}" width="160" height="100">
            <mx:Text text="Lorem ipsum..." />
        </mx:Panel>

        <mx:Panel title="Panel w/ ControlBar" cornerRadius="{slider.value}" width="160" height="100">
            <mx:Text text="Lorem ipsum..." />
            <mx:ControlBar>
                <mx:Label text="I'm a ControlBar" />
            </mx:ControlBar>
        </mx:Panel>
    </mx:HBox>

    <mx:Spacer height="10" />

    <mx:HSlider id="slider" width="{hBox.width}" minimum="0" maximum="25" liveDragging="true" snapInterval="1" tickInterval="1" dataTipFormatFunction="dataTipFormatFunc" />

</mx:Application>

 
Tagged with:
 
About The Author

Peter deHaan

Peter deHaan currently works for Adobe on the Flex SDK QA team. While not working on Flex, Flash, and ColdFusion applications, Peter enjoys making up bios and writing in 3rd person. Peter's rarely updated blog can be found at blogs.adobe.com/pdehaan/, actionscriptexamples.com, airexamples.com, and coldfusionexamples.com.

Leave a Reply

Your email address will not be published.

You may 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