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...

34,399 Responses

  1. Rubengax表示:

    nha cai k8 link vao k8 nha cai k8

  2. Stevenkated表示:

    https://k8viet.guru/# k8 th? dam

  3. Rubengax表示:

    link vao k8 k8 bet k8vip

  4. JamesFlive表示:

    кракен вход – кракен магазин, ссылка на кракен

  5. Malissa表示:

    I visit everyday some blogs and blogs to read articles or reviews,
    except this webpage gives quality based content. https://Fairviewumc.church/bbs/board.php?bo_table=free&wr_id=6030877

  6. Curtismence表示:

    https://alo789.auction/# alo789 chinh th?c

  7. MarioNaw表示:

    кракен вход – кракен актуальная ссылка, кракен маркет

  8. MarioNaw表示:

    кракен вход – кракен ссылка, ссылка kraken

  9. сейф表示:

    Тут можно преобрести сейф купить цена купить сейф в москве цена

  10. Josephsip表示:

    keo nha cai 88bet: keo nha cai 88bet – 88bet slot

  11. Eva表示:

    Great blog! Is your theme custom made or did
    you download it from somewhere? A theme like yours with a few simple tweeks would really make my blog jump out.
    Please let me know where you got your design. With thanks http://dongjin21.kr/bbs/board.php?bo_table=free&wr_id=249479

  12. BernardFax表示:

    nha cai k8: k8vip – k8vip

  13. Тут можно преобрести сейф металлический взломостойкий сейф металлический взломостойкий

  14. Тут можно преобрести стоимость сейфа сейфы

  15. duct cleaning表示:

    Salutation, maybe this is not on theme but anyway, I have been reading about your site and it looks truly tidy. impassioned about your activity. I’m building a new blog and hard put to make it appear great, and provide really good content. I have revealed much on your site and I look forward to more updates and will be coming back.

  16. HaroldSoins表示:

    i was reading this
    Is Kreativstorm a good company?

  17. StephenDeery表示:

    Thanks a lot for sharing this with all of us you really recognize what you are talking about! Bookmarked. Kindly additionally consult with my site =). We will have a link exchange agreement between us
    https://iteratemarketing.com/news/?888starz_promo_code_14.html

  18. Josephsip表示:

    nha cai k8: k8 bet – k8

  19. Josephsip表示:

    188bet 88bet: 88bet – 88bet slot

  20. Тут можно преобрести сейфы москва стоимость сейфа

  21. Youre so cool! I dont suppose Ive read anything similar to this prior to. So nice to find somebody with some original ideas on this subject. realy appreciation for starting this up. this fabulous website is one area that is needed on-line, somebody if we do originality. useful project for bringing interesting things to your world wide web!

  22. Nice post. I learn some thing tougher on diverse blogs everyday. It will always be stimulating to learn content using their company writers and exercise a little from their store. I’d prefer to use some while using the content in my weblog whether you don’t mind. Natually I’ll provide you with a link on your own internet blog. Appreciate your sharing.

  23. DichaelDax表示:

    Wow, amazing blog layout! How long have you been blogging for? you make blogging look easy. The overall look of your website is great, let alone the content!
    https://www.wesco.dev/wall/blogs/15654/Code-Promo-d-Inscription-1xBet-Bonus-100-de-130

發佈回覆給「сейф」的留言 取消回覆

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