使用行为

 1、创建一个行为;

2、从不同的组件调用一种效果;

3、创建一个组合效果;

Demo:按钮在点击后变成绿色,然后渐淡最后为浅绿色,表示按钮被点击过;当按钮点击一下,数字就会从模糊逐渐明显,同时向下下降20象素。

<? xml version = " 1.0 "  encoding = " utf-8 " ?>
< mx:Application xmlns:mx = " http://www.adobe.com/2006/mxml "  layout = " absolute " >
    
< mx:Glow id = " buttonGlow "  color = " 0x99FF66 "  alphaFrom = " 1.0 "  alphaTo = " 0.3 "  duration = " 1500 " />
    
< mx:Parallel id = " BlurAndMove "  target = " {myLabel} " >
        
< mx:Blur id = " numbersBlur "
            blurYFrom
= " 10.0 "  blurYTo = " 0.0 "
            blurXFrom
= " 10.0 "  blurXTo = " 0.0 "
            duration
= " 2000 " />     
        
< mx:Move id = " numbersMove "  yBy = " 20 "  duration = " 2000 " />     
    
</ mx:Parallel >

    
< mx:Panel width = " 459 "  height = " 451 "  x = " 10 "  y = " 10 "  layout = " absolute " >
        
< mx:Button id = " myButton "  label = " View "  x = " 40 "  y = " 60 "  width = " 100 "  height = " 100 "  
            mouseUpEffect
= " {buttonGlow} "
            click
= " BlurAndMove.play();myLabel.visible=true; " />
        
< mx:Label x = " 151 "  y = " 10 "  id = " myLabel "  
            visible
= " false "
            text
= " 1234567890 0987654321 "  fontSize = " 20 " />
    
</ mx:Panel >
</ mx:Application >
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值