<?xml version="1.0" encoding="utf-8"?>
<mx:Application 
    xmlns:mx                    ="http://www.adobe.com/2006/mxml" 
    backgroundGradientColors    ="[#FFFFFF, #999999]"
    backgroundAlpha                ="1"
    layout                        ="absolute"
    themeColor                    ="#B6FF43"
    width                        ="280"
    height                        ="180" viewSourceURL="srcview/index.html">
    
    <mx:Script>
        <![CDATA[
            private function showCanvas():void
            {
                switch(btnShowCanvas.selected)
                {
                    case true:
                        cvsImage.styleName = "inset";
                        break;
                    case false:
                        cvsImage.styleName = "none";
                        break;
                }
                
            }
        ]]>
    </mx:Script>
    
    <mx:Style>
        .inset {
            borderStyle: inset;
        }
        
        .none {
            borderStyle: none;
        }
    </mx:Style>
    
    <mx:HBox x="10" y="10">
        <mx:Label
            text    ="Rotation"/>
        <mx:HSlider
            id        ="hslRotation"
            liveDragging="true"
            minimum    ="0"
            maximum    ="360"
            value    ="0"/>
    </mx:HBox>
        
    <mx:Button
        id            ="btnShowCanvas"
        x            ="10"
        y            ="100"
        label        ="Show Canvas"
        click        ="showCanvas()"
        toggle        ="true"/>
        
    <mx:Button
        id            ="btnShowImage"
        x            ="10"
        y            ="60"
        selected    ="true"
        label        ="Show Image"
        click        ="showCanvas()"
        toggle        ="true"/>
    
    <mx:Canvas
        id            ="cvsImage"
        clipContent    ="false" 
        rotation    ="{hslRotation.value}"
        borderColor    ="#FFFFFF"
        x            ="200"
        y            ="100">
        
        <mx:Image
            id                ="imgSpiral"
            x                ="-50"
            y                ="-50"
            visible            ="{btnShowImage.selected}"
            source            ="@Embed(source='assets/Spiral.swf')"/>
            
    </mx:Canvas>
    
</mx:Application>