Flash翻轉式影片播放器

這是一個結合Tweener和影片的範例,主要的目的是利用Flash載入外部視訊來播放,順帶利用ActionScript來做畫面的翻轉,翻轉後可以詳細介紹該影片的資訊,或是版權宣告等,先看看範例頁面檔案下載,要製作這樣的動畫,首先要先準備一段影片檔,我的範例中所準備的是利用數位相機拍攝出來的影片,再利用Adobe Media Encoder轉換成大小為640×360,F4V格式的影片,再利用Flash內建的組件FLVPlayback來播放。

資料夾檔案結構如下:

3D Video Flip 檔案結構

  • Caurina是Tweener Class大家可以到Tweener的官網下載,前述文章有連結。
  • 3dflip.fla、3dflip.html、3dflip.swf是Flash的原始檔、網頁檔以及播放檔。
  • Shengxing為本範例所使用到的影片檔。
  • SkinUnderPlaySeekMute為播放器的面板檔。

而在下圖是在Flash中的結構:

3D Video Flip 動畫結構

  • container是包含播放器、解說文字的影片片段,該元件包含FLVPlayback播放器組件(Video)和解說文字(Text)兩個圖層。
  • FLVPlayback是Flash內建的影片播放器組件。
  • loading影片載入時會出現的文字。
  • spin影片右上角旋轉的按鈕。
  • text包含有介紹文字的影片片段,文字中亦製作有超連結(維基百科)。
  • vid如果有自己的影片想要更換,請進入名為Vid的影片片段中利用屬性面板修改。

本範例所包含的ActionScript都在場景中的第一個影格,程式碼如下:

import caurina.transitions.*;
import fl.video.*;

con.visible = false;

var flv:FLVPlayback = con.vid.flvp;
flv.addEventListener(VideoEvent.PLAYING_STATE_ENTERED, onStart);

function onStart(e:Event):void
{
	con.visible = true;
	loading.visible = false;
}

con.vid.spin.addEventListener(MouseEvent.CLICK, cl);
con.tclip.spin.addEventListener(MouseEvent.CLICK, cl);

var isTurning:Boolean = false;

function cl(e:Event):void
{
	if(!isTurning)
	{
		Tweener.addTween(con, {rotationY:con.rotationY+180,time:1, onComplete:function(){isTurning=false;}});
		isTurning = true;
	}
}

addEventListener(Event.ENTER_FRAME, loop);

function loop(e:Event):void
{
	if(con.rotationY > 90 && con.rotationY < 270)
		con.addChild(con.tclip);
	else
		con.addChild(con.vid);
	if(con.rotationY >= 360) con.rotationY = 0;
}

You may also like...

36,342 Responses

  1. BrandonJag表示:

    get cheap clomid for sale: ClmHealthPharm – can i order clomid without prescription

  2. Briantrozy表示:

    doxycycline without a prescription: DoxHealthPharm – doxycycline for sale online

  3. Roberttic表示:

    https://doxhealthpharm.shop/# doxycycline cheap australia

  4. VirgilBlawl表示:

    amoxicillin 500 mg without prescription Amo Health Pharm cheap amoxicillin 500mg

  5. JustinTam表示:

    can you get clomid without a prescription: can i get generic clomid price – cost generic clomid without dr prescription

  6. JacobLoody表示:

    http://www.veles-ufa.ru – Официальный сайт производителя кухонь в Санкт-Петербурге.

  7. Good day! I could have sworn I’ve been to this site before but after checking through some of the post I realized it’s new to me.
    Anyways, I’m definitely delighted I found it and I’ll be bookmarking and
    checking back frequently! http://junicarlstoft.com/__media__/js/netsoltrademark.php?d=sl860.com%2Fcomment%2Fhtml%2F%3F35686.html

  8. 5 Qualities That People Are Looking For In Every Expert In Psychiatric Assessment
    Psychiatric assessment ireland

  9. BrandonJag表示:

    500 mg doxycycline pill: DoxHealthPharm – doxycycline 50 mg generic

  10. VirgilBlawl表示:

    ampicillin amoxicillin amoxicillin 500mg without prescription where can i get amoxicillin

  11. VirgilBlawl表示:

    where to buy generic clomid no prescription where to buy cheap clomid no prescription get clomid without rx

  12. BrandonJag表示:

    buy zithromax online fast shipping: Zithro Pharm – order zithromax without prescription

  13. JustinTam表示:

    can i buy generic clomid no prescription: how to get generic clomid – can i order cheap clomid without a prescription

  14. JustinTam表示:

    where to get clomid pills: ClmHealthPharm – can i order generic clomid without rx

  15. The 10 Most Scariest Things About Patio Sliding Door Repair Near Me Patio sliding door repair near me

  16. Roberttic表示:

    https://doxhealthpharm.com/# can you buy doxycycline over the counter in india

  17. Thank you for sharing your info. I really appreciate your efforts
    and I will be waiting for your next post thanks once again. http://Cancernation.com/__media__/js/netsoltrademark.php?d=www.xmac.Co.kr%2Fbbs%2Fboard.php%3Fbo_table%3Dfree%26wr_id%3D385586

  18. супрастин инструкция по применению взрослым в таблетках https://allergiano.ru/ .

  19. Roberttic表示:

    https://amohealthpharm.shop/# amoxicillin no prescription

  20. JustinTam表示:

    clomid pill: ClmHealthPharm – where to buy clomid without a prescription

  21. супрастин таблетки инструкция по применению взрослым от чего помогает отзывы противопоказания https://allergiano.ru/ .

  22. BrandonJag表示:

    zithromax 500 tablet: zithromax prescription – zithromax 250mg

  23. Briantrozy表示:

    amoxicillin 500mg capsules: Amo Health Pharm – amoxicillin where to get

  24. Hello there, just became alert to your blog through Google, and found that it is really
    informative. I’m gonna watch out for brussels. I will be grateful if you continue this in future.
    Lots of people will be benefited from your writing.
    Cheers! http://vawatraining.org/__media__/js/netsoltrademark.php?d=blog-KR.Dreamhanks.com%2Fquestion%2Factivites-en-estrie-conseils-pour-profiter-au-maximum-de-votre-sejour-21%2F

  25. BrandonJag表示:

    buy cheap generic zithromax: where can i purchase zithromax online – generic zithromax 500mg

  26. Briantrozy表示:

    can i purchase generic clomid without rx: ClmHealthPharm – can i get clomid no prescription

  27. Roberttic表示:

    http://doxhealthpharm.com/# doxycycline 50

  28. JacobLoody表示:

    кухни под заказ – Изготовление кухонь под заказ с учетом ваших пожеланий.

發佈回覆給「Roberttic」的留言 取消回覆

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