`
japankn
  • 浏览: 209722 次
  • 性别: Icon_minigender_1
  • 来自: 广西
社区版块
存档分类
最新评论

state transition整合总结一 单组件改变

    博客分类:
  • flex
阅读更多

    今天看了看state 和 transition状态切换效果的内容,整了一天,终于弄明白了里面关系,今天开始将这些内容记录备案一份,方便自己和其他朋友的学习!!

    为了方便说明,我贴出一段代码,拷贝运行就可以看到效果,然后再说明它们之间的关系!

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="absolute">
 <mx:transitions>
  <mx:Transition>
   <mx:Sequence target="{pan}">
    <mx:WipeLeft target="{but1}"/>
    <mx:RemoveChildAction target="{but1}"/>
   </mx:Sequence>
  </mx:Transition>
 </mx:transitions>
 <mx:states>
  <mx:State name="change">
   <mx:RemoveChild target="{but1}"/>
   <mx:SetProperty target="{but1}"
       name="visible"
       value="false"/>
  </mx:State>
 </mx:states>
 <mx:Panel id="pan" x="282"
     y="142"
     width="250"
     height="200"
     layout="absolute">
  <mx:Button x="82"
       y="70"
       label="but1"
       id="but1"/>
 </mx:Panel>
 <mx:Button x="374.5"
      y="366"
      label="change"
      click="currentState='change'"/>

</mx:Application>

    看着有些乱,但这是最简单的用法了,它们之间的关系由下图来说明

 

  • 大小: 9.3 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics