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

  1. JustinTam表示:

    where can i get zithromax: zithromax azithromycin – zithromax over the counter

  2. Everything is very open with a very clear explanation of
    the issues. It was definitely informative. Your website is extremely helpful.

    Thank you for sharing! http://www.Artframersdenver.com/about-the-shop/

  3. JacobLoody表示:

    http://ded-moros.ru/ – Закажите кухню на официальном сайте.

  4. bookmarked!!, I love your web site!

  5. VirgilBlawl表示:

    doxycycline 50 mg buy uk Dox Health Pharm doxycycline 25mg

  6. It’s enormous that you are getting ideas from this post as well as from our argument made at this time. http://Suwonprint.com/bbs/board.php?bo_table=free&wr_id=160379

  7. Roberttic表示:

    https://clmhealthpharm.shop/# buy cheap clomid without prescription

  8. JustinTam表示:

    amoxicillin buy no prescription: can you buy amoxicillin over the counter in canada – amoxicillin generic brand

  9. JustinTam表示:

    cheap clomid for sale: ClmHealthPharm – how to buy generic clomid without prescription

  10. BrandonJag表示:

    zithromax for sale usa: Zithro Pharm – zithromax 500mg over the counter

  11. VirgilBlawl表示:

    can you buy cheap clomid now ClmHealthPharm where to get generic clomid pills

  12. Briantrozy表示:

    buy clomid without prescription: can i get clomid pill – buy generic clomid without insurance

  13. AngelCroft表示:

    предметная съемка косметики – Эффектные кадры, подчеркивающие уникальность вашей продукции. Оптимально для брендов красоты.

  14. bookmarked!!, I like your website.

  15. Amazing 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 shine. Please let me know where you got your theme.
    Thank you http://Hwassermanlaw.com/__media__/js/netsoltrademark.php?d=Infiroute.com%2Fbbs%2Fboard.php%3Fbo_table%3Dfree%26wr_id%3D1006672

  16. JustinTam表示:

    how much is amoxicillin prescription: Amo Health Pharm – cost of amoxicillin 875 mg

  17. JacobLoody表示:

    https://www.bodyrslm.ru/ – Закажите кухню на заказ с доставкой и установкой.

  18. VirgilBlawl表示:

    doxycycline over the counter south africa cheap doxycycline tablets doxycycline without a prescription

  19. VirgilBlawl表示:

    zithromax drug zithromax without prescription how to get zithromax over the counter

  20. BrandonJag表示:

    zithromax 250 mg: ZithroPharm – can you buy zithromax over the counter in canada

  21. Briantrozy表示:

    buy zithromax without presc: ZithroPharm – purchase zithromax online

  22. Roberttic表示:

    http://amohealthpharm.com/# amoxicillin buy no prescription

  23. I’ve been exploring for a little for any high quality articles or weblog posts on this sort of house .
    Exploring in Yahoo I finally stumbled upon this website.
    Studying this info So i’m happy to express that I have an incredibly
    good uncanny feeling I came upon just what I needed.
    I so much definitely will make certain to don?t disregard
    this web site and give it a glance regularly. http://Itoxi.Co.kr/bbs/board.php?bo_table=free&wr_id=881013

  24. Briantrozy表示:

    doxycycline 20 mg: DoxHealthPharm – doxycycline 300 mg tablet

  25. Very good info. Lucky me I came across your blog by chance (stumbleupon). I have saved as a favorite for later!

  26. BrandonJag表示:

    zithromax buy online: where can i buy zithromax uk – buy zithromax no prescription

  27. Roberttic表示:

    http://zithropharm.com/# zithromax prescription online

  28. Great blog! Do you have any recommendations for aspiring writers?

    I’m planning to start my own site soon but I’m a little lost
    on everything. Would you propose starting with a free platform
    like WordPress or go for a paid option? There are so many choices out there that I’m completely overwhelmed ..
    Any tips? Thank you! http://sw.inje.Ac.kr/bbs/board.php?bo_table=free&wr_id=1267009

  29. JacobLoody表示:

    http://ok-sochi.ru – Официальный сайт производителя кухонь.

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

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