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,572 Responses

  1. JustinTam表示:

    how to get generic clomid online: can you get clomid price – can you get generic clomid

  2. Roberttic表示:

    http://zithropharm.com/# zithromax 250 mg pill

  3. JustinTam表示:

    can you buy zithromax over the counter in mexico: how much is zithromax 250 mg – zithromax 500mg price

  4. Alisia表示:

    It’s really a nice and useful piece of info. I am glad that you
    just shared this useful info with us. Please stay us informed like this.

    Thank you for sharing. http://mehmetalapala.com/__media__/js/netsoltrademark.php?d=Blfcorporation.com%2Fbbs%2Fboard.php%3Fbo_table%3Dfree%26wr_id%3D460072

  5. BrandonJag表示:

    200 mg doxycycline: doxycycline 150 mg capsules – doxycycline over the counter singapore

  6. JustinTam表示:

    where can i buy clomid prices: where can i buy generic clomid – where to buy cheap clomid without rx

  7. Roberttic表示:

    https://amohealthpharm.shop/# order amoxicillin uk

  8. Briantrozy表示:

    buy amoxicillin online mexico: Amo Health Pharm – amoxil pharmacy

  9. Roberttic表示:

    https://doxhealthpharm.shop/# doxycycline without rx

  10. BrandonJag表示:

    buy amoxicillin over the counter uk: AmoHealthPharm – cost of amoxicillin 875 mg

  11. Howdy! I could have sworn I’ve been to this site before but after going through some of the posts I realized it’s new to me.
    Nonetheless, I’m certainly delighted I stumbled upon it and I’ll be bookmarking it and checking back often! http://Sp11.intipia.Co.kr/bbs/board.php?bo_table=free&wr_id=143369

  12. Shelli表示:

    Excellent goods from you, man. I’ve understand your stuff previous to and you’re just too excellent.
    I actually like what you have acquired here, really like what you’re stating and the way in which
    you say it. You make it entertaining and you still take care of to
    keep it smart. I can’t wait to read much more
    from you. This is really a terrific web site. http://Tourscruzer.com/__media__/js/netsoltrademark.php?d=Tangguifang.Dreamhosters.com%2Fcomment%2Fhtml%2F%3F1160120.html

  13. Briantrozy表示:

    zithromax purchase online: how much is zithromax 250 mg – zithromax tablets

  14. She stated, for the superannuation business, it was very vital to concentrate on the foremost coverage errors and cease it from becoming the explanation of disagreement.

  15. JacobLoody表示:

    https://www.happyholi.ru/ – Официальный сайт с каталогом кухонь.

  16. Currently it sounds like Drupal is the best blogging platform available right now.
    (from what I’ve read) Is that what you’re using on your blog? http://Www.esdoors.co.kr/bbs/board.php?bo_table=free&wr_id=816462

  17. BrandonJag表示:

    zithromax capsules: ZithroPharm – zithromax 500 mg for sale

  18. JustinTam表示:

    doxycycline 20 mg coupon: doxycycline 100mg tablet brand name – buy cheap doxycycline online

  19. Briantrozy表示:

    п»їdoxycycline 100mg tablets for sale: purchase doxycycline online uk – doxycycline 50 mg price australia

  20. VirgilBlawl表示:

    doxycycline canadian pharmacy DoxHealthPharm doxycycline capsules purchase

  21. JacobLoody表示:

    http://krasnodarchip.ru/ – Кухни от производителя в Санкт-Петербурге.

  22. BrandonJag表示:

    zithromax generic price: Zithro Pharm – order zithromax over the counter

  23. AngelCroft表示:

    кухня на заказ в спб — Практичные и стильные кухни, спроектированные специально для вас.

  24. VirgilBlawl表示:

    can i purchase cheap clomid prices ClmHealthPharm how to buy clomid without dr prescription

  25. JustinTam表示:

    amoxicillin 500 mg cost: Amo Health Pharm – generic amoxil 500 mg

  26. JustinTam表示:

    zithromax 500 mg lowest price pharmacy online: Zithro Pharm – zithromax capsules australia

  27. VirgilBlawl表示:

    buy zithromax online cheap buy zithromax without prescription online zithromax 250 mg australia

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

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