切换效果

Posted on 2013-08-07 11:03  诸葛小北  阅读(203)  评论(0编辑  收藏  举报
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx"
               minWidth="955" minHeight="600"
               creationComplete="init()"
               >
   <s:layout>
       <s:VerticalLayout/>
   </s:layout>
    <s:states>
      <s:State name="orange"/>
        <s:State name="black"/>
    </s:states>
    <s:transitions>
        <s:Transition fromState="*" toState="*">
            <s:Resize target="{box}"/>
        </s:Transition>
    </s:transitions>
    <s:HGroup>
        <s:Button label.orange="Black" label.black="Orange">
            <s:click>
                <![CDATA[
                    currentState = (currentState == 'orange'?'black':'orange');
                ]]>
            </s:click>
        </s:Button>
    </s:HGroup>
    
    <s:Rect id="box" width="200" height="200" width.black="150" height.black="150">
        <s:fill>
            <s:SolidColor color.black="#000000" color.orange="#de7800"/>
        </s:fill>
    </s:Rect>
</s:Application> 
View Code

 

Copyright © 2024 诸葛小北
Powered by .NET 8.0 on Kubernetes