Thứ Hai, 20 tháng 6, 2011

Tạo chữ nhấp nháy trên một control RichText Spark trong Flex 4


<?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>

Không có nhận xét nào:

Đăng nhận xét