加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

flex状态之间的切换

发布时间:2020-12-15 01:00:04 所属栏目:百科 来源:网络整理
导读:?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" ? ???

<?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" xmlns:local="*" xmlns:myPacket="myPacket.*">
?
??????? <s:states>
?
??????????????? <s:State name="nomalA"/>
?
??????????????? <s:State name ="nomalB"/>
?
??????????????? <s:State name="nomalC"/>
?
??????????????? <s:State name="nomalD"/>
?
??????? </s:states>
?
???????
??????? <s:transitions>
?
??????????????? <s:Transition toState="nomalA">
?
??????????????????????????????? <s:Sequence??????? target="{group1}">
?
??????????????????????????????? <s:Fade alphaFrom="0" alphaTo="1" duration="4000"/>
?
??????????????????????????????? </s:Sequence>
?
??????????????? </s:Transition>
?
??????????????? <s:Transition toState="nomalB">
?
??????????????????????????????? <s:Sequence??????? target="{group2}">
?
??????????????????????????????????????? <s:Fade alphaFrom="0" alphaTo="1" duration="4000"/>
?
??????????????????????????????? </s:Sequence>
?
??????????????? </s:Transition>
?
??????? </s:transitions>
?
??????? <fx:Script>
?
??????????????? <![CDATA[
?
??????????????????????? private var ADD:String = "add";
?
??????????????????????? private var NORMALA:String = "nomalA";
?
??????????????????????? private var NORMALB:String = "nomalB";
?
??????????????????????? private var NORMALC:String = "nomalC";
?
??????????????????????? private var NORMALD:String = "nomalD";

??????????????????????? protected function button1_clickHandler(event:MouseEvent):void
?
??????????????????????? {
?
??????????????????????????????? if(currentState == NORMALA)currentState = NORMALB;
?
??????????????????????????????? else if(currentState == NORMALB)currentState = NORMALC;
?
??????????????????????????????? else if(currentState == NORMALC)currentState = NORMALD;
?
??????????????????????????????? else if(currentState == NORMALD)currentState = NORMALA;
?
??????????????????????????????? else return;
?
??????????????????????? }

??????????????? ]]>
?
??????? </fx:Script>
?
??????? <fx:Declarations>
?

??????? </fx:Declarations>
?
???????
??????? <s:Group id="group1" includeIn="nomalA">
?
??????????????? <s:Button id="nostudent1" x="114" y="80" label="nostudent 1"/>
?
??????? </s:Group>
?
??????? <s:Group id="group2" includeIn="nomalB">
?
??????????????? <s:Button id="nostudent2" x="114" y="80" label="nostudent 2"/>
?
??????? </s:Group>
?
??????? <s:Group id="group3" includeIn="nomalC">
?
??????????????? <s:Button id="nostudent3" x="114" y="80" label="nostudent 3"/>
?
??????? </s:Group>
?
??????? <s:Group id="group4" includeIn="nomalD">
?
??????????????? <s:Button id="nostudent4" x="114" y="80" label="nostudent 4"/>
?
??????? </s:Group>
?
???????
??????? <s:Button x="309" y="312" label="click" click="button1_clickHandler(event)"/>
?

</s:Application>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读