<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2008/06/28/maintaining-an-images-aspect-ratio-on-an-image-control-in-flex/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white" viewSourceURL="srcview/index.html">

    <mx:Script>
        <![CDATA[
            private function reset():void {
                img.invalidateDisplayList();
                validateNow();
            }
        ]]>
    </mx:Script>

    <mx:ApplicationControlBar dock="true">
        <mx:Form styleName="plain">
            <mx:FormItem label="maintainAspectRatio:">
                <mx:CheckBox id="checkBox"
                        selected="false"
                        change="callLater(reset);" />
            </mx:FormItem>
            <mx:FormItem label="percentWidth:"
                    direction="horizontal">
                <mx:HSlider id="pWidth"
                        minimum="10"
                        maximum="100"
                        value="100"
                        snapInterval="1"
                        tickInterval="10"
                        liveDragging="true" />
                <mx:Label text="{img.width} px" />
            </mx:FormItem>
            <mx:FormItem label="percentHeight:"
                    direction="horizontal">
                <mx:HSlider id="pHeight"
                        minimum="10"
                        maximum="100"
                        value="100"
                        snapInterval="1"
                        tickInterval="10"
                        liveDragging="true" />
                <mx:Label text="{img.height} px" />
            </mx:FormItem>
        </mx:Form>
    </mx:ApplicationControlBar>

    <mx:Image id="img"
            source="assets/Fx.png"
            maintainAspectRatio="{checkBox.selected}"
            percentWidth="{pWidth.value}"
            percentHeight="{pHeight.value}" />

</mx:Application>