点滅

opacity属性を高速に変更することで点滅させています。

この内容を表示するためには Adobe Flash Plugin が必要です。

<?xml version="1.0" encoding="UTF-8"?>
<canvas proxied="false" bgcolor="0xeeeeee"> 
    <view width="50" height="50" bgcolor="0xff0000">
      <animatorgroup repeat="Infinity">
        <animator attribute="opacity" from="1" to="1" duration="490"/>
        <animator attribute="opacity" from="1" to="0" duration="10"/>
        <animator attribute="opacity" from="0" to="0" duration="490"/>
        <animator attribute="opacity" from="0" to="1" duration="10"/>
      </animatorgroup>
    </view>
</canvas>

<animatorgroup>を使うと複数の<animator>を順番あるいは同時に起動することができます。

このサンプルでは、下記のような透明度の変化しない処理を挿入して「間(ま)」をおくことで点滅間隔を調整しています。

<animator attribute="opacity" from="1" to="1" duration="490"/>