关闭

flex_视图状态的认识、理解示例;

323人阅读 评论(0) 收藏 举报

=》状态(A):

Orange状态(默认)


Black状态


<?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="1024" minHeight="768" pageTitle="TheStudioOfCenyebao">
    
    <!-- Demo_视图状态 A-->
    
    <!--为Application定义两个状态:orange(默认状态,因为在首位)、black-->
    <s:states>
        <s:State name="orange" />
        <s:State name="black" />
    </s:states>
  
    <!--view-->
    <s:VGroup verticalCenter="0" horizontalCenter="0">
        <s:HGroup>
            <s:Button label="Orange" click="currentState='orange'" />
            <s:Button label="Black" click="currentState='black'" />
        </s:HGroup>
        <s:Rect width="350" height="250">
            <s:fill>
                <s:SolidColor color.black="#000000" color.orange="#de7800"/>
            </s:fill>
        </s:Rect>
    </s:VGroup>   
</s:Application>

=》状态(B):

Orange状态(默认)


Black状态


<?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="1024" minHeight="768" pageTitle="TheStudioOfCenyebao">
    
    <!-- Demo_视图状态B -->
    
    <!--为Application定义两个状态:orange(默认状态,因为在首位)、black-->
    <s:states>
        <s:State name="orange" />
        <s:State name="black" />
    </s:states>
    
    <!--view-->
    <s:VGroup verticalCenter="0" horizontalCenter="0">
        <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 width.orange="200" height.orange="80" width.black="100" height.black="80">
            <s:fill>
                <s:SolidColor color.black="#000000" color.orange="#de7800"/>
            </s:fill>
        </s:Rect>
    </s:VGroup>
</s:Application>
0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:248159次
    • 积分:3732
    • 等级:
    • 排名:第8945名
    • 原创:127篇
    • 转载:13篇
    • 译文:0篇
    • 评论:52条
    最新评论