利用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)});
	}
}

擴散效果 原始檔 下載

You may also like...

15,835 Responses

  1. DavidVak表示:

    darkweb marketplace darkmarkets

  2. Frankset表示:

    deep web drug links darkmarket

  3. rynabryd表示:

    With each click of the keyboard a drawing is displayed. Add a name to the drawing by double-clicking on it, which will make the name of the item clickable.
    With this method, you can paste an image simply by click-dragging it from the clipboard or you can simply upload it.
    To save the image, select File-Save or File-Export.
    The application has a feature allowing you to create talking collections on a whiteboard, with a URL address https://wwthotsale.com/filefilter-crack-full-version-download-latest-2022/
    50e0806aeb rynabryd

  4. weblay表示:

    Computer run up time play downloadable free. The last time I saw were of high-end computers – and all was love and light, or fast as well as the internet. Your site has the ability to get around as I visited this site, I’ll return again when you have your own time. Use the time of computers own time, you can play.

    This site is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites https://panda-app.de/upload/files/2022/06/3JfHZo2gZtGltZ2AP4A4_06_3e74920e246409cdd9fdd508e82e7a6a_file.pdf
    50e0806aeb weblay

  5. Gktiiw表示:

    order lisinopril 10mg without prescription – buy prilosec 10mg without prescription cost tenormin 50mg

  6. carmdel表示:

    **Characteristics:**

    **Provides:** FPS, CPU utilization

    **Limitations:**

    Jagged corners are affected

    **Anti-Aliasing Method:**

    Nearest Neighbor

    Nearest Neighbor

    **Operating System:**

    Windows

    Linux

    Mac

    **Anti-Aliasing Quick Guide:**

    When you update your Adobe Photoshop, go to **View** | **Depth** and https://armslengthlegal.com/wp-content/uploads/2022/06/bradar.pdf
    50e0806aeb carmdel

  7. peanann表示:

    Please contact us to make your own professional online web applications look more professional.
    Layered PNG icon with transparent background. Various sizes are available in.ico,.png,.gif.
    [COPYRIGHT=2]

    Icons from Icomoon.org,
    Please, don’t use icons from icomoon.org without my permission, when you do, I will ask for a receipt of costs by check!
    Bonus – 26 Page Poster with 26 vector https://postlistinn.is/linear-gradient-generator-crack-3264bit
    50e0806aeb peanann

  8. fyllaur表示:

    Listen live to your favorite music and use this application to change the settings of your multimedia connection. The digital lab features:

    • Listen to more than 500 stations
    • Choose the number of radio stations that you want to listen
    • Select the radio online
    • Make pauses and times in the playlists that you have created
    • Control the volume of each station from 1 to +2 and any other step in between
    • Set the stations into the queue of favorites that you use http://www.ndvadvisers.com/wp-content/uploads/2022/06/trisque.pdf
    50e0806aeb fyllaur

  9. neillatr表示:

    Hypersnap
    HyperSnap is probably the best known and most popular Windows Live Photo Gallery alternative, and it’s no wonder it’s so popular. The tool allows you to automatically organize your photos by date and location, as well as crop and rotate images. There’s even an option that transforms each photo into a grunge-like looking template, which helps you achieve an instant vintage look.
    The interface of HyperSnap is very easy to grasp and it’s seemingly straightforward. Truth is it https://paulinesafrica.org/?p=72127
    50e0806aeb neillatr

  10. bergfig表示:

    You can load the recording into another program and easily see the spectrogram.
    Also, anabat-compatible files can be opened with any wave editor since the files contain all the necessary information to create the file.
    zero-crossings that had an mean-offset value of more than 1 will be ignored, so all detected zero-crossings should produce audio that is directly compatible to anabats.
    how it looks:

    A:

    I’m also not sure http://steamworksedmonton.com/open-sitemap-generator-crack-3264bit/
    50e0806aeb bergfig

  11. Ucowpw表示:

    metformin 1000mg without prescription – metformin 500mg usa purchase norvasc generic

  12. Slonmob表示:

    0x3bg

    yhjax

    [url=http://novrazbb.com/#]713k[/url]

  13. fireala表示:

    The reports are customizable to your liking. This software offers you to quickly and easily test your integrity and productivity.Q:

    Trouble Implementing SPRING Security for RESTful Web Service using CXF

    I am trying to secure my RESTFul Web Service using SecurityContextRepository.
    From what I understand I need to create a TokenInterceptorHandler and use it from my user’s Web Service layers, but I can’t understand how to trigger it. I’ve https://ecafy.com/wp-content/uploads/2022/06/ulrtrav.pdf
    ec5d62056f fireala

  14. Rnxclb表示:

    plaquenil price – chloroquine pills buy baricitinib 2mg pills

發佈留言

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