利用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,179 Responses

  1. lynpie表示:

    This is a program for editing image sequence without video capture. Special handling was made in order not to stall image sequence. Image bin for editing can be chosen on the fly or you can choose image folder for fast preview.

    File manager for listing and sorting the contents of PC. 1st sort by file size, then date, then folder etc. Also plenty of practical features, such as drag and drop, quick access and sorting features. Import and export built-in. https://wakelet.com/wake/8uPmxFP2OwkeRtNY1NjJa 8cee70152a lynpie

  2. lateld表示:

    1.
    Install Oracle Application Express
    2.
    For more information, read the documentation here.
    The last version available for download are version 2.3.3.0.

    Thursday, March 22, 2010

    If you’re are short on time, installed on a fast working machine and want to create a QuickStart to be used in your new project, you could take a look at the SQLBASIC tutorial Postgresql.
    Go to the installation of http://networks786.ovh/upload/files/2022/05/DxwYdMrnsSN1ShQns2TV_19_db9c8f424862aaf856125f8d738bb1a9_file.pdf 05e1106874 lateld

  3. Vetubk表示:

    cefuroxime ca – cheap cialis 5mg order cialis 20mg for sale

  4. walalatr表示:

    The interface and software, however, have no real room for improvement, and this is also indicated by the lack of user comments on forums. If you own a Maxtor hard drive, but are unsure whether the motor is still in good shape, don’t wait to run a test. You’ll get all the info you need to make a decision right away.

    Maxtor Maxboost helps you speed up your system performance by improving the speeds of various disk drives by http://www.schatzsuchen.de/link.pl?https://zoppglicolor.weebly.com

    6add127376 walalatr

  5. recmer表示:

    Sans GDL

    SANS GDL is the essential software solution for all of your library, desktop publishing, and graphics creation requirements, as well as for managing your office networks, and that benefits any type of organization.
    It comes with an intuitive and simple interface that enables users to get used to it really fast. A set of tools such as a contact list, a document explorer, and a cut & paste function, along with time-saving processes and a full-f https://ledbetocci.weebly.com

    6add127376 recmer

  6. dejwalb表示:

    The next version of the program is on the way, so wait for the final release or look forward to future updates.
    GPL-It – GPL Software License Tool is licensed under the GNU GPL version 2.0.
    Is there a way to set the Project Name and Description programmatically using C#?
    Answer:
    If you want to set project name and description from code, use the below code in your C# console application. To set project name and description, use ProjectName http://hendry.sentradetox.com/librari/share/index.php?url=https://conlijusthar.weebly.com

    6add127376 dejwalb

  7. gilcha表示:

    TinyODBC is tested with VC++ 6.0 and Visual Studio 2003 and later. It needs a compiler that supports C99 to be linked with. Also may need to patch a few other headers when using VS2005 and VC++8.
    The future for TinyODBC is definitely forward because through C++11 we already have many great ideas that TinyODBC can use. For example std::any and std::any_cast etc. It would be nice to have https://ahperjupy.weebly.com

    6add127376 gilcha

  8. sailbla表示:

    As alternative, you could try to create your own setup media manually.

    Running a lightweight system can be a lot easier than it may sound. Whether the environment is the desktop or a server, there are several points you can optimize. One of the most practical applications available in the market is UCCleaner. UCCleaner lets you optimize your system in seconds by thoroughly cleaning anything leftover and unused on your computer.
    We’ll talk about what UCCleaner can do for you https://www.google.com.sa/url?sa=t&source=web&url=https://prominovdjok.weebly.com

    6add127376 sailbla

  9. wildeen表示:

    or higher
    ■ Windows Me/2000/XP/2003
    ■ WinPlatform.net
    ■ XML RegEx editor (optional)
    ■ Notepad or Notepad++ (optional)
    ■ The ankiti source program
    If you want to read more about the latest features, check out:
    drawback of current manure collection and storage techniques is the appearance https://treppimingnap.weebly.com

    6add127376 wildeen

  10. ileitris表示:

    A:

    I haven’t found any other software that does, although that’s not a requirement. I have a friend who’s a teacher and she uses it to send out reminders to each child in her class. She does a weekly review with the whole class and they have multiple assignments for the week so she uses the reminder for each to remind them that they have to get them done.

    Jose Andres restaurants in the Bay Area won’t have to comply with the Fair Wage https://meifealdaari.weebly.com

    6add127376 ileitris

  11. colrand表示:

    with XCode Objective C
    and many other elements.

    The library and import library are fairly complete. For reading the Aztec, you just have to import them. This file is divided into classes, each one represents one type of Aztec. I’ve been worked on these classes for some time, and I can show you some of their features. For example, the reader can be read both the individual mode as well as the QuickLook mode.

    The SDK is written https://erlartima.weebly.com

    6add127376 colrand

  12. bbopvvjp表示:

    buy provigil 100mg online cheap order provigil 100mg online

  13. pestait表示:

    Brief Introduction

    If you are developing an application that required to work with ISO images (which are handy), UFS (which is faster than ISO) or similar disk images, then the loopy library can help you by simplifying the tasks and making your life easier.

    To work with LOOPY you need to implement the following steps:

    Download and install it (via the JAR file)

    Get in touch with the static ‘get’ method of https://www.google.co.mz/url?sa=i&url=https://betodobdest.weebly.com

    6add127376 pestait

  14. anneiant表示:

    If you want to convert Windows Movie Maker.WMV video formats to Mov formats, you can use our tool, which have been specially designed for this task. Mov is a standard audio and video format, which is extremely popular nowadays. It can be used in video editing, animation and even with multimedia streaming.
    Our tool is free to try. No registration is needed to use it. You can convert several video files to Mov for free. The video quality is much better than the ordinary https://zinracenre.weebly.com

    6add127376 anneiant

  15. lyzaber表示:

    2. Adobe Connect
    If you are enrolled in the Digital Publishing Suite prerelease program, Adobe Connect and LiveCycle Meetings are included. To test out meeting activities or Adobe Connect meetings, you’ll first need to set up another (free) Adobe ID.

    If you are enrolled in the Digital Publishing Suite prerelease program, Adobe Dreamweaver CS5 includes the Folio Creator panel that you can use to quickly create digital folios. To create your own folios, https://www.oxfordpublish.org/?URL=https://untuchapi.weebly.com

    6add127376 lyzaber

  16. karirai表示:

    Try it today!

    TimeStamp: 2018-07-05

    Shareware

    Thanks AORTAJESTRATION team for a great demo!!! Now IT is FREE!

    The flexible interface allows you to view and edit your computer s configuration and add, delete, or set up the add-ons you want, without having to use the command line. In addition to this, TimeOut can also help you find and save several copies of existing configuration files https://osjulutap.weebly.com

    6add127376 karirai

  17. zdzianbi表示:

    Learning how to master Shut up! Timer is not a difficult task, and you can get started with this guide, here.\].

    Honda, J. M., et al. 2014,, 793, L32

    Honda, J. M., et al. 2015,, 454, 1235

    Kornmesser, M. 2007,, 473, 735

    Press, N. H https://awinoven.weebly.com

    6add127376 zdzianbi

  18. Johnnyden表示:

    stromectol for humans for sale stromectol price usa stromectol for humans for sale

  19. takasaha表示:

     
    However, the application scored high thanks to its stability and ease of use.
    Unmodified code, no modchips
    The code for this software is open source, meaning that its modifications are readily available for the user. If you want to download the source code and examine it, you can do so here.

    Advantages
    Free software
    No need for Windows Live account
    Free alternative to remote PC management services

    Disadvantages
    Web browsers require a user login https://cse.google.dj/url?sa=i&url=https://tittileco.weebly.com

    6add127376 takasaha

  20. havgjann表示:

    Download Maps OSM

    Title

    Size

    Rating

    Link

    EAC Light

    12.6 Mb

    4.86

    SOE2013

    1.2 Mb

    5

    SOE-Bundland 2004

    2 http://4vn.eu/forum/vcheckvirus.php?url=https://conbuzzrori.weebly.com

    6add127376 havgjann

  21. errsanc表示:

    Providing a dash board to track usage that can be accessed from anywhere is a great bonus.

    Overall Work ability

    7/10

    Summary

    Clutter Cloak excels in shielding your work and monitoring distractions. It can even boost productivity by preventing you from looking at clutter that one might want to tackle later on.

    What are your thoughts on Clutter Cloak?

    Clutter cloak for me at least, is a work-breaker. I usually like to keep https://odosifdraw.weebly.com

    6add127376 errsanc

  22. ellyjah表示:

    Free for all!
    If you wish to purchase add-ons, the entire open source code is available. There is also a forum where you can ask any questions you may have.

    Here is a brief description of the project:

    ***

    Complete Oem Generator XP is an open-source utility for DIY PC restorations which allows you to customize user interface elements and to create your own Windows-powered clone of a real computer.

    Complete Oem Generator XP can https://paiglagacak.weebly.com

    6add127376 ellyjah

  23. aupyrjeu表示:

    order modafinil 200mg without prescription provigil generic purchase modafinil online cheap

  24. fjnzwfwd表示:

    buy modafinil 100mg order provigil 100mg sale

發佈留言

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