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

25,741 Responses

  1. JacobLoody表示:

    кухни на заказ цены — Узнайте цены на кухни на заказ и выберите идеальный вариант для вашего бюджета.

  2. OLaneevige表示:

    Today, I went to the beach front with my kids. I found a sea shell and gave it to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.” She put the shell to her ear and screamed. There was a hermit crab inside and it pinched her ear. She never wants to go back! LoL I know this is entirely off topic but I had to tell someone!
    https://slovo-pacana.info/

  3. JasonUnsoG表示:

    https://denemebonusuverensiteler25.com/# deneme bonusu veren yeni siteler

  4. FobertWen表示:

    Hello, I desire to subscribe for this weblog to take most recent updates, so where can i do it please help.
    https://slovo-pacana.info/

  5. BradleyEdino表示:

    guvenilir casino siteleri Casino Siteleri canl? casino siteleri

  6. Good post. I learn something totally new and challenging on sites I stumbleupon every day. It’s always useful to read articles from other writers and practice something from other web sites.

  7. JacobLoody表示:

    кухни под заказ — Профессиональный дизайн и качественные материалы для создания кухни вашей мечты.

  8. Wallacefex表示:

    Canl? Casino Siteleri: guvenilir casino siteleri – canl? casino siteleri

  9. Aw, this was a very good post. Taking the time and actual effort to create a very good article… but what can I say… I procrastinate a lot and don’t seem to get nearly anything done.

  10. You really make it seem really easy with your presentation however I to find this matter to be
    actually something that I believe I’d never understand.
    It sort of feels too complicated and very
    vast for me. I’m taking a look forward in your subsequent submit, I’ll attempt to get the dangle of
    it! https://www.die-Seite.com/index.php?a=stats&u=benitogoll31794

  11. BradleyEdino表示:

    sweet bonanza slot sweet bonanza guncel sweet bonanza demo oyna

  12. JacobLoody表示:

    http://www.pravoslavieug.ru — Все об изготовлении кухонь на заказ на сайте pravoslavieug.

  13. When someone writes an paragraph he/she keeps the idea of a user in his/her
    mind that how a user can know it. Therefore that’s why this article is outstdanding.
    Thanks! https://WWW.Xn–Jj0BN3Viuefqbv6K.com/bbs/board.php?bo_table=free&wr_id=2655401

  14. use this link表示:

    Very good article! We are linking to this great article on our website. Keep up the great writing.

  15. JacobLoody表示:

    https://catspot.ru — Все для вашего удобства: каталог, консультации и профессиональный сервис.

  16. bet88表示:

    I need to to thank you for this very good read!! I certainly enjoyed every little bit of it. I’ve got you book marked to check out new things you post…

  17. BradleyEdino表示:

    casino bahis siteleri en guvenilir casino siteleri canl? casino siteleri

  18. JasonUnsoG表示:

    https://casinositeleri25.com/# Deneme Bonusu Veren Siteler

  19. New88表示:

    I must thank you for the efforts you’ve put in penning this site. I’m hoping to check out the same high-grade content by you in the future as well. In fact, your creative writing abilities has motivated me to get my very own site now 😉

發佈留言

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