利用Tweener製作動畫 – 數大便是美
套用徐志摩的名言:「數大」便是美,意思是說數量多就是美,不過雖然數大便是美,但如果要針對多個元件製作動畫,那利用程式一定會比手工來的輕鬆,甚至可以更漂亮和壯觀,以下的範例就是利用Tweener針對較多的元件來製作動畫的結果,分享給大家參考!希望各位未來不會「數大」便是累。
Tweener 滿天星斗:利用Tweener針對星形製作Alpha動畫,是一個很簡單的範例。
import caurina.transitions.Tweener import flash.display.MovieClip; setInterval(starFn,50) function starFn(){ var scale:Number=Math.random() var mc:MovieClip=new star mc.x=Math.random()*500 mc.y=Math.random()*500 mc.scaleX=scale mc.scaleY=scale mc.alpha=0 addChild(mc) Tweener.addTween(mc, {alpha:1, time:7, transition:"linear"}); Tweener.addTween(mc, {alpha:0, time:3,delay:8, transition:"linear"}); }
Tweener 擴散效果:利用Tweener針對球體來製作動畫,其中還應用到距離計算的Class,可以試著調整參數(彈出距離變數、彈出數量…等)來觀察改變的情況。
import flash.display.Sprite; import roMc; import flash.geom.Point; import caurina.transitions.Tweener; //變數定義區塊 var centerPoint:Point = new Point ;//圓形中心點 var i:int = 1;//迴圈變數 var radius:int = 50;//彈出距離變數 var no:int = 20;//彈出數量 var circleArray:Array=new Array//球體陣列(針對移除使用) var sec:int=1//動畫秒數 var hold:Number=0.1//延遲秒數 centerPoint.x = stage.stageWidth / 2; centerPoint.y = stage.stageHeight / 2; stage.addEventListener(MouseEvent.CLICK,clickFn); function clickFn(e:MouseEvent) { while (circleArray.length > 0) { removeChild(circleArray.pop()); } Tweener.removeAllTweens(); showFn(); } function showFn() { for (i=1; i<=no; i++) { var mc:Sprite = new ball ; circleArray.push(mc) var angle:Number = 2 * Math.PI / no * i; var targetPoint:Point = new Point(); targetPoint.x = radius * Math.cos(angle) + centerPoint.x; targetPoint.y = radius * Math.sin(angle) + centerPoint.y; addChild(mc); mc.x = centerPoint.x; mc.y = centerPoint.y; mc.alpha = 0; Tweener.addTween(mc, {alpha:1,x:targetPoint.x,y:targetPoint.y, time:sec, transition:"linear",delay:i*hold}); Tweener.addTween(mc, {alpha:0,x:centerPoint.x,y:centerPoint.y, time:sec, transition:"linear",delay:i*hold+(no*hold+1)}); } }
plaquenil best price plaquenil oct
mobile casinos
deposit bonus casino
wild casino online
slots online best ed drugs write research paper for me
https://hydroxychloroquine.icu/# plaquenil 400 mg
casino no deposit welcome bonus
no deposit casinos
no deposit welcome bonus
Lewabo is a multicultural inspirational movies website. Enjoy hundreds of inspiring, uplifting, positive family-friendly movies. Action, Thrillers, Romance, Family drama, Kids, Faith, Comedy and more. An entertainment platform for the whole family. African films, American films, films from different countries, Nigerian nollywood films, South african films, Christian movies, Documentaries. Lewabo is good content entertainment. Hundreds of titles. 70% exclusive content.
sites adult
milf dating franken
best date sites
order viagra 100mg online sildenafil price overnight delivery cialis
cost of tadalafil in canada tadalafil 5mg tablets price
Hi there! I just wanted to ask if you ever have any trouble with hackers? My last blog (wordpress) was hacked and I ended up losing several weeks of hard work due to no back up. Do you have any solutions to protect against hackers?
You ma’am have a way with words. Thank you very much!
bonus casino online
win real money casino
free no deposit bonus
https://antibiotic.icu/# amoxicillin 875 125 mg tab
free chat online singles
free online go
dating sites contact united states
I am glad to talk with you and you give me great help
zanaflex usa tizanidine 2mg oral metoclopramide 10mg over the counter
gay true dating site
gay dating appd
gay black dating apps for fat black gay men
Our mission is to provide our customer’s with integrated security solutions within a rapid response time to exceed your security needs. Our fully trained uniformed guards are available armed and unarmed, 24 hours a day, 7 days a week. All of our security guards are 100% certified. Our security guards are put through rigorous training to handle any security post assigned to them. Our guards are CPR/AED/First Aid certified. At XpressGuards, we provide professional security solutions customized to fit each individual client and business. Call now to get started.
Secured Trust Escrow is one of the few companies licensed by the Department of Financial Protection and Innovation to hande Holding Escrows. Holding Escrows do not involve the transfer of real estate or a business under the California Bulk Sale Laws. Secured Trust Escrow has been the “go-to” escrow company for attorneys and other professionals needing a third-party escrow holder to hold funds pursuant an agreement made outside of escrow. Secured Trust Escrow has handled many holding escrows, both simple and complex, from a wide range of industries such as entertainment, legal, receivership’s, judiciary, source code, private money, and source code.
dating online best websites
free online dating site
best local dating sites
https://hydroxychloroquine.icu/# plaquenil 200mg
60 mg tadalafil canadian online pharmacy tadalafil
I loved your idea there, I tell you blogs are so exciting sometimes like looking into people’s private life’s and work. Every new remark wonderful in its own right.
gay black latino dating
gay dating a macho
macro sonic dating sim gay
https://amoxicillin.pro/# buy amoxicillin online mexico
xenical for sale xenical 120mg pill buy generic lioresal
free women
dating singles for free sites
dating online site