利用Tweener製作動畫 – 其他參數

因為這陣子馬老師擔任了崇右數位媒體設計系的系主任後業務繁忙,好久沒在部落格上貼文章了,現在總算有些空檔可以繼續貼文,之前寫了有關利用Tweener製作動畫的文章,接著這篇文章來介紹在Tweener中其他可用的參數,請各位參考,不過詳細的部分還是可以參考官網的說明。


delay:可以設定在動畫完成後多久,再接續進行下一動畫(Tweener delay 範例

import caurina.transitions.Tweener

Tweener.addTween(ball, {x:150, time:1});
//用一秒鐘的時間移動ball元件至x為150的位置
Tweener.addTween(ball, {y:100, time:1, delay: 2});
//等待兩秒後用一秒鐘的時間移動ball元件至y為100的位置

getTweenCount:取得目前動畫的補間數量(Tweener getTweenCount 範例

import caurina.transitions.Tweener

Tweener.addTween(ball, {x:150, time:2});
Tweener.addTween(ball, {y:100, time:2,delay:2});
txt.text="元件Ball共有" + Tweener.getTweenCount(ball) + "段補間動畫"

getTweens:取得目前動畫所更改元件的屬性(Tweener getTweens 範例

import caurina.transitions.Tweener

Tweener.addTween(ball, {x:150, y:100, alpha:1, time:2});
txt.text="元件Ball共被製作了" + Tweener.getTweens(ball) + "的屬性變化"
//輸出元件被補間的屬性

getVersion:取得目前使用Tweener的版本(Tweener getVersion 範例

import caurina.transitions.Tweener

Tweener.addTween(ball, {x:150, y:100, time:2});
txt.text="本動畫使用Tweener版本為:" +Tweener.getVersion()
//輸出元件使用Tweener的版本

onStart、onUpdate、onComplete:分別在補間「開始」、「進行中」、「結束」呼叫不同的函數執行(Tweener complex 範例

import caurina.transitions.Tweener
import flash.events.MouseEvent;

Tweener.addTween(ball, {x:150, y:100, time:3,onStart:startFn,onUpdate:updateFn,onComplete:completeFn});
/*用三秒鐘的時間移動ball元件至x為150和y為100的位置
開始時執行startFn函數
過程中執行updateFn函數
完成後執行completeFn函數
*/
function startFn(){
	ball.alpha=0.1
}

function updateFn(){
	ball.alpha+=0.02
	txt.text="球體正在移動"
}

function completeFn(){
	ball.alpha=1
	txt.text="現在可以拖曳球體"
	ball.addEventListener(MouseEvent.MOUSE_DOWN,downFn)
	ball.addEventListener(MouseEvent.MOUSE_UP,upFn)
	function downFn(e:MouseEvent){
		ball.startDrag()
	}
	function upFn(e:MouseEvent){
		ball.stopDrag()
	}
}

addCaller:在指定的時間內呼叫某函數N次(Tweener addCaller 範例

import caurina.transitions.Tweener
var i=0
no.text=i
Tweener.addCaller(no, {onUpdate:go, time:10, count:10 , transition:"linear"});
//在10秒內針對no執行10次go函數
//Tweener.addCaller(no, {onUpdate:go, time:10, count:10 , transition:"easeinquad"});
//在10秒內針對no執行10次go函數且速度越來越慢

function go(){
	i++
	no.text=i
}

controlTweens:控制由Tweener所產生的動畫(Tweener controlTweens 範例

import caurina.transitions.Tweener

Tweener.addTween(ball, {x:280, time:20,transition:"linear"});

pauseBtn.addEventListener(MouseEvent.CLICK,pauseFn)
resumeBtn.addEventListener(MouseEvent.CLICK,resumeFn)

function pauseFn(e:MouseEvent){
	pauseBtn.visible=false
	resumeBtn.visible=true
	Tweener.pauseAllTweens(); 
}

function resumeFn(e:MouseEvent){
	pauseBtn.visible=true
	resumeBtn.visible=false
	Tweener.resumeAllTweens(); 
}

soundVolume:利用Tweener來控制音量(Tweener soundVolume 範例

import caurina.transitions.Tweener;
import caurina.transitions.properties.SoundShortcuts;
SoundShortcuts.init();

var snd:Sound = new heavy  ;
var chn:SoundChannel = new SoundChannel  ;
chn = snd.play(0,1000);

btn.addEventListener(MouseEvent.CLICK,clickFn)

function clickFn(e:MouseEvent){
	Tweener.addTween(chn, {_sound_volume:0, time:10});
}
//點選按鈕後聲音會在十秒內逐漸歸零

FilterShortcut:Tweener也可以控制Flash中的各種濾鏡,利用濾鏡來製作動畫或互動(blurFilter 範例dropShadowFilter 範例

blurFilter –

import flash.filters.*; 
import caurina.transitions.properties.FilterShortcuts;
import caurina.transitions.Tweener
FilterShortcuts.init();

var blur:BlurFilter=new BlurFilter

stage.addEventListener(MouseEvent.CLICK,clickFn)
function clickFn(e:MouseEvent){
	Tweener.addTween(ball, {time:0,_Blur_blurX:20,_Blur_blurY:20});
	Tweener.addTween(ball, {x:mouseX, y:mouseY, time:2,_Blur_blurX:0,_Blur_blurY:0, transition:"easeOutQuart"});
}

dropShadowFilter –

import caurina.transitions.properties.FilterShortcuts;
import caurina.transitions.Tweener
import roMc

FilterShortcuts.init();
stage.addEventListener(Event.ENTER_FRAME,shadowFn)
function shadowFn(e:Event){
	Tweener.addTween(ball, {time:0,_DropShadow_angle:roMc.ro(ball)+180,_DropShadow_distance:6});
}

以上是有關Tweener參數的一些範例,這邊也把Tweener Parameters 壓縮檔給各位,提供有興趣的同學參考。

You may also like...

3,140 Responses

  1. Wncwqg表示:

    buy lisinopril 5mg online cheap – buy lisinopril generic atenolol online

  2. ophydurw表示:


    29e70ea95f ophydurw

  3. Iwjhum表示:

    glucophage 500mg cheap – order atorvastatin 20mg without prescription norvasc drug

  4. vasotty表示:

    Okdo Word To Pdf Converter is a tool that can help you convert DOC to PDF format with various image formats. It supports documents created by Word 97/2000/2003 and offers the best output quality. You don’t need to install any additional software, as Okdo Word to PDF Converter silently operates in the Windows system tray and only requires just a double click.
    After adding a new file, you can open Okdo Word to PDF Converter by double-clicking http://chatroom.thabigscreen.com:82/upload/files/2022/06/4O434ldrCnVswPVB6Aq8_04_8e1d11e0147323fa5a7ebfd04bb562a6_file.pdf
    ec5d62056f vasotty

  5. taddflo表示:

    ]]> of Rotary

    Drive of Rotary () is a 1943 Spanish comedy film directed by Rafael Baledón and starring Miguel Gómez Bedia, Rafael Hernández and Carmen Sevilla. https://beinewellnessbuilding.net/godmother-full-movie-in-hindi-torrent-download-free/
    ec5d62056f taddflo

  6. whavand表示:

    Sante DICOM Editor Portable & Multilingual is the right application for those users that want a practical, portable and versatile application.

    Program features
    An overwhelming file format consists of an image sequence of slices, compressed in DICOM. DICOM stands for Digital Imaging and Communications in Medicine. It is a standard format, widely used in medical imaging. It contains the information needed to display, process, store and exchange this type of information. The DICOM format has a https://www.sartorishotel.it/pdf-worksheet-ucmas-abacus-mental-worksheets-pdf-rar-zip/
    ec5d62056f whavand

  7. qitlau表示:

    exe file in the General tab. The other tab has 4 buttons that will be described in the next chapter.
    If you want to check the information about your PC before. You can follow instructions in this article about Screenshots of PC SysInfo Screensaver.

    100 % Working on Windows 7,8,8.1,10 and LOST.
    We made it but don’t do with it only — Support Windows, Help people.
    Read more info here: How to https://cosasparamimoto.club/?p=6955
    ec5d62056f qitlau

  8. dearin表示:

    Further settings enable you to choose among different ways of expressing maps, colour coding in a variety of formats, and select the most appropriate of the Google Maps features you want to include.
    Introducing the Andy & Gloria Disco Ball – Slides DJ Mixer. This handy program lets you easily create and mix your own radio-style DJ mix CD.
    The tool features a sliding LCD that displays all the information to make it easier to mix the software’s actions directly on the screen.
    Andy & https://eugreggae.com/wearcadfe-21/
    ec5d62056f dearin

  9. antgon表示:

    ■ XML open standard.
    ■ 50,000 words per hour or lower.
    ■ At least.7 MP per page.
    ■ Acrobat 5 export & save feature.
    ■ Mac OSX.
    ■ Should be installed no later than Sep. 1, 2009. Must complete installation by Sep. 19, 2009.
    ■ “apago.boxeditor.net”.
    ■ Each Box Editor contains https://blooming-plains-83292.herokuapp.com/Free_Download_Anwar_Ka_Ajab_Kissa_Full_Movie_Subtitle_Indone.pdf
    ec5d62056f antgon

  10. waridela表示:

    There are less than 50 applications that use this particular format of the icon and all of them can be found through the rest of the Revenge folder.
    Conclusion of this guide was to help you see for yourself how varied can be the applications on Apple’s OS X when it comes to handling the same sort of resources – icons. You can’t currently run any of them on your OS X by default so installing the new Revenge icons will only help you to get a far superior look for your desktop. In http://peoplecc.co/?p=12156
    ec5d62056f waridela

  11. fentmil表示:

    FEATURES:

    Capture the keystrokes typing (including shortcut keys),
    Capture data from the clipboard (it’s text),
    Capture the screen image (Original Desktop),
    Capture screen image (Thumbnail Desktop).
    Store captured data in a database or files folder.
    Rate of capture (for continuous monitoring).
    You can read captured data from database or files.
    Supports handwriting input (if required, you can select option to generate a bitmap based on the handwriting https://trevelia.com/upload/files/2022/06/yLc2LN1O6HHdckZ7BCST_04_e2cd6023e9b905a4fbf5e3f8159e4c1e_file.pdf
    ec5d62056f fentmil

  12. berlat表示:

    .

    12
    Freeware

    Planetarium SQL Map 3.0Planetarium SQL Map is a user friendly MySQL GUI tool written in Java which,providing the customer with a strong feature that not only allows user to dump and manage information, but also intuitively display the information in various formats (ex. HTML,Excel,Treeview,Javascript,Berichtsbezogener,JSP,….,etc.
    It supports database like MySQL, MSSQL http://www.kitesurfingkites.com/wp-content/uploads/bladgab.pdf
    ec5d62056f berlat

  13. abstfre表示:

    Each wallpaper can be separately enabled or disabled using the versatile thumbnails. It also comes with all the major software required to view them. The pack includes maximum opacity and light effects that transform the images to produce hypnotizing effects that can be carried out at the most inopportune moments.
    Features
    10 High definition wallpapers set up for any resolution and type – 1920×1200
    Set up to 10 wallpaper with high opacity and light effects can be toggled on or off
    When turned https://floating-falls-34079.herokuapp.com/carmar.pdf
    ec5d62056f abstfre

  14. lesedion表示:

    SIADIN:

    Easily create hot-key menus for Windows and MacOS

    A hot-key is a combination of keys that creates a defined sequence of events in an application. The combination of keys can often be toggled via an audio signal, which means that the result of the action is queued up and can start immediately after the key stroke.

    Fast to set up

    The interface through which you control the hotkeys is very attractive and https://sokhanedoost.com/black-ops-ii-multiplayer-zombies-all-dlc-s-fourdeltaone-t-lucky-patcher/
    ec5d62056f lesedion

  15. rayomar表示:

    If you have any concerns, you can contact their support team; the help center is accessible through the ‘Help’ menu item.

    Photo to Sketch Pro 10.5.7 Crack is a best sketch software for transform your images into sketching. It supports a set of flexible styles to help you sketch directly with images.
    You can import digital images to this portrait sketch studio and transform them into amazing sketches, it can easily let you draw with your imagination. You can keep your sketch art https://colombiasubsidio.xyz/?p=2222
    ec5d62056f rayomar

  16. malowero表示:

    Amazon S3 upload tool is available for Windows systems.

    How to upload documents, pictures and other files to AWS S3 with the help of Amazon S3 upload tool

    Amazon S3 upload tool

    It works on a file-by-file basis. You need to specify the bucket, the key-prefix and the local file path for each file.

    Basics of Amazon S3 upload tool:

    What is S3 bucket?

    S3 is a https://gooderogtacommea.wixsite.com/postmartena/post/kamasutra-sinhala-edition-pdf-free-34
    ec5d62056f malowero

  17. Fozjte表示:

    purchase plaquenil without prescription – baricitinib 2mg brand baricitinib canada

  18. obadzaka表示:

    – UnresolvedClasses: Names of classes not found in the jar files in the directory being analyzed.
    – TopLevelPackages: The names of the top level packages in the jar file.
    – TopLevelClasses: The names of the top level classes in the jar file.
    – UnresolvedClasses: The names of the classes not found in the jar files in the directory being analyzed.
    – UnresolvedPackages: The names of the packages not https://www.dahlke.at/profile/tertcrisalpulmainy/profile
    66cf4387b8 obadzaka

發佈留言

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