<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright 2010 Chet Haase
    
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
    
    http://www.apache.org/licenses/LICENSE-2.0
    
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark">
    <fx:Metadata>
        [HostComponent("spark.components.Button")]
    </fx:Metadata>
    <s:states>
        <s:State name="up"/>
        <s:State name="over"/>
        <s:State name="down"/>
        <s:State name="disabled"/>
    </s:states>
    <s:transitions>
        <s:Transition>
            <s:Parallel duration="120">
                <s:Animate target="{shadow}">
                    <s:SimpleMotionPath property="distance"/>
                </s:Animate>
                <s:Animate targets="{[rect,labelDisplay]}">
                    <s:SimpleMotionPath property="z"/>
                </s:Animate>
                <s:AnimateColor targets="{[ge1, ge2, ge3]}"/>
            </s:Parallel>
        </s:Transition>
        <s:Transition toState="down">
            <s:Parallel duration="50">
                <s:Animate target="{shadow}">
                    <s:SimpleMotionPath property="distance"/>
                </s:Animate>
                <s:Animate targets="{[rect,labelDisplay]}">
                    <s:SimpleMotionPath property="z"/>
                </s:Animate>
                <s:AnimateColor targets="{[ge1, ge2, ge3]}"/>
            </s:Parallel>
        </s:Transition>
        <s:Transition fromState="down">
            <s:Parallel duration="50">
                <s:Animate target="{shadow}">
                    <s:SimpleMotionPath property="distance"/>
                </s:Animate>
                <s:Animate targets="{[rect,labelDisplay]}">
                    <s:SimpleMotionPath property="z"/>
                </s:Animate>
                <s:AnimateColor targets="{[ge1, ge2, ge3]}"/>
            </s:Parallel>
        </s:Transition>
    </s:transitions>
    <fx:Declarations>
        <s:DropShadowFilter id="shadow" strength=".3" blurX="8" blurY="8"
            distance.over="10" distance.down="15"/>
    </fx:Declarations>
    <s:Rect id="rect" top="0" left="0" right="0" bottom="0" filters="{[shadow]}"
        radiusX="6" radiusY="6" z.over="-20" z.down="-40">
        <s:fill>
            <s:LinearGradient rotation="90">
                <s:GradientEntry id="ge1" color="0xd0d0d0" color.over="0xc0c0c0" color.down="0xa0a0a0"/>
                <s:GradientEntry id="ge2" color="0xf0f0f0" color.over="0xf0f0f0" color.down="0x808080"
                    ratio=".1" ratio.down=".2"/>
                <s:GradientEntry id="ge3" color="0xaaaaaa" color.over="0x808080" color.down="0xc0c0c0"/>
            </s:LinearGradient>
        </s:fill>
        <s:stroke>
            <s:SolidColorStroke color="black" weight="3"/>
        </s:stroke>
    </s:Rect>
    <s:Label id="labelDisplay" fontSize="20" fontWeight="bold"
        left="20" right="20" top="15" bottom="15" color="white"
        horizontalCenter="0" verticalCenter="1"
        z.over="-20" z.down="-40"/>
</s:Skin>