利用Tweener製作動畫 – 即時時鐘

前面已經介紹了很多利用Tweener所產生的動畫方式,接下來的幾篇文章,馬老師將會分享一些利用Tweener所製作出來的效果給大家參考,相信只要用心,大家都可以做出很酷的效果!

Tweener 即時時鐘 範例

主要利用Tweener和Flash擷取時間的功能,製作了一個時鐘,最主要是秒針移動的效果。

import caurina.transitions.Tweener;

pointerFn();
function pointerFn()
{
	var now:Date = new Date  ;
	var nowH:int = now.hours;
	var nowM:int = now.minutes;
	var nowS:int = now.seconds;
	pointerH.rotation=nowH*30+(nowM*6/12);
	pointerM.rotation = nowM * 6;
	pointerS.rotation = nowS * 6;
}

setInterval(clockFn,1000);
function clockFn()
{
	Tweener.addTween(pointerS, {rotation:pointerS.rotation+6, time:0.5, transition:"easeOutElastic"});
	if (pointerS.rotation == 0)
	{
		pointerFn();
	}
}

即時時鐘 原始檔 下載

You may also like...

6,878 Responses

  1. makdali表示:

    Pros
    You can collect lots of information in documents and split your document work into smaller units.
    You can protect information with a password.
    Some customization features are available.
    Cons
    Free version is limited.
    The smoothness of the program is a bit different from you’re used to.
    License
    Free (for personal use). $39 (commercial use).

    My Info is an easy to use software solution for managing your personal information, with the functionality of a database. https://usidmachor.weebly.com

    6add127376 makdali

  2. Johnnyden表示:

    stromectol for sale stromectol without a doctor prescription stromectol

  3. Johnnyden表示:

    clomid tablets clomid tablets for sale buy clomid

  4. Normannok表示:

    stromectol stromectol for humans for sale prescribing stromectol

  5. Sypwwm表示:

    budesonide sale – order generic antabuse 500mg disulfiram 500mg price

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。