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

=》状态(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>
阅读更多
个人分类: Flex
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

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

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭