利用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...

19,477 Responses

  1. this article表示:

    I really love your website.. Great colors & theme. Did you make this site yourself? Please reply back as I’m planning to create my own site and would love to find out where you got this from or exactly what the theme is called. Kudos.

  2. CurtisBam表示:

    Mexican Easy Pharm: mexican border pharmacies shipping to usa – Mexican Easy Pharm

  3. 9 Things Your Parents Taught You About French Style Fridge French Style Fridge

  4. Brandonnot表示:

    Indian pharmacy international shipping: Online medicine – Online medicine

  5. Car Accident Attorneys For Hire The Process Isn’t As Hard As You Think Best Attorney Car Accident

  6. LarryReupt表示:

    Best online Indian pharmacy Indian pharmacy international shipping Indian pharmacy international shipping

發佈留言

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