利用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 – mexican rx online
mexican rx online: best online pharmacies in mexico – pharmacies in mexico that ship to usa
http://mexicandeliverypharma.com/# mexican online pharmacies prescription drugs
Привет!
Где приобрести диплом специалиста?
http://www.meisterbook.com/read-blog/15665
Привет!
Где заказать диплом по нужной специальности?
http://www.elephantjournal.com/profile/poydicikko/
заказать сайт заказать сайт .
разработка сайта цена разработка сайта цена .
Great site! I recommend to everyone!https://nearstore.com/collections/carolina-herrera
купить разработку сайта http://www.biztest.ru/ .
стоимость создания сайта https://biztest.ru/ .
Привет!
Приобрести диплом университета.
b98385gb.beget.tech/2024/07/04/kak-podobrat-nadezhnyy-onlayn-magazin-s-shirokim-katalogom-diplomov.html
Здравствуйте!
Приобрести диплом о высшем образовании.
moust.lv/read-blog/223
Привет, друзья!
Мы изготавливаем дипломы любой профессии по выгодным ценам.
diplomyx-man.ru
Great site! I recommend to everyone!https://nearstore.com/pages/near-me
Секретные промокоды для покупок онлайн Секретные промокоды для покупок онлайн .
Рабочие промокоды для всех типов покупок. http://www.free-promocode.ru .
The world of cutthroat gaming has undergone
a remarkable evolution in recent years, with the rise
of esports as a global craze . Amidst this rapidly shifting
landscape, one name has emerged as a trendsetter –
Spade Gaming.
Spade Gaming is a influence to be reckoned with, a gaming organization that has carved out a unique niche for itself by blending cutting-edge
invention , strategic vision , and a relentless commitment to perfection .
Established with the goal of reinventing the boundaries of rigorous gaming,
Spade Gaming has quickly become a beacon of ingenuity ,
driving the market forward with its trailblazing
approach and resolute dedication.
At the center of Spade Gaming’s dominance lies its steadfast
concentration on contender development and unit building.
The organization has cultivated an ecosystem that encourages
and reinforces its players , providing them with the equipment , coaching , and aid
they need to accomplish new apexes .
But Spade Gaming’s significance extends far past the limits of the game
intrinsically. The corporation has also consolidated itself
as a pioneer in the discipline of information creation, leveraging its
expansive inventory of masterful specialists to produce
gripping and captivating content that resonates supporters reaching the planet .
Aside from that, Spade Gaming’s devotion to community obligation and societal engagement sets it
unique from its rivals . The establishment has exploited its soapbox to
rally behind vital initiatives , employing
its impact and prominence to produce a significant influence
in the realm of esports and beyond .
As the esports sector presses forward to develop , Spade Gaming emerges as a radiant representation of
what can be realized when strategy , inventiveness , and a
tireless endeavor of preeminence unite .
In the years to come , as the domain of intense gaming persists to captivate devotees and reinvent the approach we
immerse with entertainment , Spade Gaming will without a
doubt persist at the fore, spearheading the crusade and forging a new
epoch in the dynamically shifting landscape of esports.
Also visit my web page; Slot games
Лучшие промокоды в сети http://www.promokodbar.ru .
Используйте промокод и получите скидку на первый заказ. Используйте промокод и получите скидку на первый заказ. .
Вместе с нами вы всегда найдете промокоды Вместе с нами вы всегда найдете промокоды .
Экономьте с промокодами на любимые бренды Экономьте с промокодами на любимые бренды .
Лучшие промокоды для выгодных покупок. free-promocode.ru .
Рабочие промокоды для всех типов покупок. free-promocode.ru .
Скидки до 50% по уникальным промокодам Скидки до 50% по уникальным промокодам .
Новейшие промокоды для вашего любимого магазина. Новейшие промокоды для вашего любимого магазина. .
Получите промокоды на популярные товары Получите промокоды на популярные товары .
Great site! I recommend to everyone!https://nearstore.com/collections/cartier
Начните экономить с нашим промокодом прямо сейчас! http://free-promocode.ru/ .
Слимофор https://slymofor.ru инновационное средство для быстрого похудения.
Получите лучшие промокоды прямо сейчас Получите лучшие промокоды прямо сейчас .