利用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)}); } }
mexican pharmaceuticals online: best online pharmacies in mexico – buying prescription drugs in mexico
mexican mail order pharmacies: reputable mexican pharmacies online – mexican border pharmacies shipping to usa
transport my vehicle across country https://www.Car-shipping24.com .
Здравствуйте!
Мы можем предложить дипломы любой профессии по приятным тарифам.
diplom51.ru/gde-bezopasno-kupit-diplom-bez-riskov-i-problem-v-2024-godu
Привет!
Мы изготавливаем дипломы психологов, юристов, экономистов и других профессий по приятным тарифам.
phongthuygiaphat.com/купить-заполненный-диплом
Terminated Reading a Blog Post: A Formal Response
to the Comment Section and an Invitation to
Join “KING855”
‘After diligently examining the blog post, I would like to submit the following contribution to the
discussion .
Your perspectives on the theme were quite intellectually stimulating .
I found myself in consensus with several of the points
you brought up .
It is heartening to witness such an engaging debate taking place .
If you are curious in additional delving into this subject
matter , I would sincerely urge you to participate in the “KING855” group .
There , you will have the chance to interact with like-minded participants and dive deeper into these captivating themes .
I am confident your participation would be a valuable
enrichment to the discourse .
I’m grateful for your remarks, and I anticipate the possibility of continuing this
enlightening dialogue .
Review my web site … online casino regulatory compliance
how to transport your car across country how to transport your car across country .
transport auto across country http://Car-shipping24.com .
Привет, друзья!
Как официально купить аттестат 11 класса с упрощенным обучением в Москве
csleague.ca/диплом-о-среднем-образовании-купить-н
Всегда вам поможем!.
car transport across us car transport across us .
cross country car transport service cross country car transport service .
shipping your car cross country shipping your car cross country .
closed carrier car transport Autoshipping24.com .
enclosed transport vehicle http://Autoshipping24.com/ .
transport my car across country transport my car across country .
Здравствуйте!
Приобретение диплома ПТУ с сокращенной программой обучения в Москве
diplomyx-man.ru
covered car transport service covered car transport service .
enclosed shipping vehicle https://Autoshipping24.com .
auto transport enclosed carrier http://Autoshipping24.com .
enclosed trailer auto transport http://www.Autoshipping24.com/ .
enclosed carrier car transport http://www.Autoshipping24.com .
buying prescription drugs in mexico medicine in mexico pharmacies medication from mexico pharmacy
enclosed car transport truck http://www.Autoshipping24.com .
mexico drug stores pharmacies: mexican online pharmacies prescription drugs – mexico pharmacies prescription drugs
п»їbest mexican online pharmacies: mexico drug stores pharmacies – purple pharmacy mexico price list
pharmacies in mexico that ship to usa: mexican border pharmacies shipping to usa – mexican pharmaceuticals online
Привет, друзья!
Как получить диплом техникума официально и без лишних проблем
higherranker.com/купить-диплом-проверенные-способы
Рады помочь!.
Добрый день!
Купить диплом университета.
b96052v5.beget.tech/2024/07/04/ogromnyy-assortiment-dokumentov-v-izvestnom-internet-magazine
purple pharmacy mexico price list buying prescription drugs in mexico online mexican border pharmacies shipping to usa
buy balloons inexpensively with delivery buy balloons cheap Dubai