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

flex 4里闪烁效果

发布时间:2020-12-15 03:34:40 所属栏目:百科 来源:网络整理
导读:第一种: ?xml version="1.0" encoding="utf-8"? !-- http://blog.flexexamples.com/2010/08/13/creating-blinking-text-on-a-spark-richtext-control-in-flex-4/ -- s:Application name="Spark_RichText_blink_test" ????? xmlns:fx="http://ns.adobe.com/m

第一种:

<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2010/08/13/creating-blinking-text-on-a-spark-richtext-control-in-flex-4/ -->
<s:Application name="Spark_RichText_blink_test"
????? xmlns:fx="http://ns.adobe.com/mxml/2009"
????? xmlns:s="library://ns.adobe.com/flex/spark"
????? xmlns:mx="library://ns.adobe.com/flex/mx">
?<s:layout>
??<s:HorizontalLayout horizontalAlign="center" verticalAlign="middle" />
?</s:layout>
?
?<fx:Declarations>
??<s:Animate id="fader"
?????? duration="500"
?????? repeatBehavior="reverse"
?????? repeatCount="0"
?????? target="{lbl}">
???<s:SimpleMotionPath property="alpha"
????????valueFrom="1.0" valueTo="0.0" />
??</s:Animate>
?</fx:Declarations>
?
?<s:Label id="lbl"
??? text="BLINKING TEXT,I HATE YOU!"
??? color="red"
??? fontSize="32"
??? creationComplete="fader.play();" />
?
</s:Application>

?

?

第二种:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" ????layout="absolute" minWidth="955" minHeight="600" ????creationComplete="application1_creationCompleteHandler(event)"> ? ?<mx:Script> ??<![CDATA[ ???import flash.filters.GlowFilter; ??? ???import mx.core.UIComponent; ???import mx.events.FlexEvent; ???private function initApp():void{ ????var sh:UIComponent=new UIComponent(); ????sh.graphics.beginFill(0x00FF00) ; ????sh.graphics.drawRect(100,100,200,200) ; ????sh.graphics.drawCircle(0,100); ????sh.graphics.endFill() ; ????can.addChild(sh) ; ???} ???protected function button1_clickHandler(event:MouseEvent):void ???{ ????var g:GlowFilter=new GlowFilter(0x00FF00); ???? ???? ????//? shan.filters = [g]; ????glow1.target = shan;? ????glow1.target = can;? ????glow1.play(); ???? ???} ??? ???protected function application1_creationCompleteHandler(event:FlexEvent):void ???{ ???? ????initApp(); ???} ??? ??]]> ?</mx:Script> ?<mx:Canvas id="can" x="100" y="100" backgroundColor="#ffffff" width="80" height="50"> ?? ?</mx:Canvas> ?<mx:Glow id="glow1" blurXFrom="0" color="0xFF0000" blurXTo="50" ??? blurYFrom="0" blurYTo="70"? repeatDelay="100"? repeatCount="100000000" ??? alphaTo="1" alphaFrom="0.3"/> ?<mx:Button x="20" y="26" width="26" height="20" click="button1_clickHandler(event)" id="shan"/> </mx:Application>

(编辑:李大同)

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

    推荐文章
      热点阅读