利用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)}); } }
what are good essay writing services
essay writing websites
buy an essay cheap
write my essay
i need help on writing an essay
write my essay for money
tadalafil capsules 20mg online pharmacy tadalafil 20mg
order motrin 600mg generic order remeron 30mg pills buy generic rocaltrol
Nevertheless, it’s all carried out with tongues rooted solidly in cheeks, and everybody has got nothing but absolutely love for their friendly neighborhood scapegoat. In reality, he is not merely a pushover. He is simply that extraordinary breed of person solid enough to take all that good natured ribbing for what it really is.
essays on the help
college essay ideas help
service to others essay
custom english essays
essays on service
essay help chat
On this site u can buy all known KILLA FLASH 4mg for very good price!
I like to spend my free time by scanning various internet resources. Today I came across your website and I found it has some of the most practical and helpful information I’ve seen.
Sometimes, the sheer magnitude of the information seems overwhelming.
Im impressed. I dont think Ive met anyone who knows as much about this subject as you do. Youre truly well informed and very intelligent. You wrote something that people could understand and made the subject intriguing for everyone. Really, great blog youve got here.
write my essay discount code
help writing a argumentative essay
help write an essay online
essay service
what is the best online essay writing service
us essay writing service
ditropan 2.5mg canada buy alendronate 35mg sale furadantin 100mg sale
i need help writing a descriptive essay
custom essays services
custom essay writing services reviews
hire someone to write my essay
will someone write my essay for me
best custom essay
help to write essay
best essay cheap
essays help
order ramipril generic buy buspar 5mg without prescription buy carvedilol 6.25mg online
how to cure ed buy ed pills
help with writing college essays
online essay writing help
essay writing service online
treatment of ed best ed pills non prescription
women viagra pills in india
buy essays online reviews
help with writing essays at university
top custom essays
This is definitely a wonderful webpage, thanks a lot..
what is the best college essay editing service
custom essay org
buy cheap essays
order colchicine 0.5mg online buy clopidogrel 150mg without prescription order clopidogrel 150mg for sale
help with writing essays
help for essay writing
custom essays writing
how to be a better essay writer
good essay writing service
college essay writers
online pharmacy discount code canada online pharmacy no prescription
how much is amoxicillin prescription cheap zithromax pills