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

32,571 Responses

  1. GregoryJough表示:

    kamagra kopen nederland: Kamagra – Kamagra Kopen Online

  2. Kennethslity表示:

    https://generic100mgeasy.com/# Generic100mgEasy

  3. Hi, its pleasant paragraph about media print, we all be familiar with
    media is a impressive source of data.

    Here is my web-site http://www.Averiline.ru

  4. TerryDus表示:

    https://generic100mgeasy.shop/# buy generic 100mg viagra online

  5. Williamviacy表示:

    Nucleus Earn is revolutionizing DeFi staking and passive income generation by offering secure, high-yield crypto rewards. With smart contract-powered staking pools, Nucleus Earn allows users to earn rewards effortlessly while maintaining full control over their assets. Whether you’re a beginner or an experienced investor, Nucleus Earn’s decentralized staking platform ensures transparency, security, and optimal returns in the fast-growing world of DeFi. https://nucleusearn.org

  6. BryanLam表示:

    база ссылок для хрумера – Большая база ссылок для Хрумера с автоматизацией

  7. WilliamNop表示:

    Tadalafil Easy Buy: cialis without a doctor prescription – cialis without a doctor prescription

  8. I seriously love your website.. Excellent colors & theme. Did you build this amazing site yourself? Please reply back as I’m wanting to create my own personal site and would like to learn where you got this from or what the theme is named. Thanks!

  9. TerryDus表示:

    https://tadalafileasybuy.com/# cialis without a doctor prescription

  10. Kennethslity表示:

    https://tadalafileasybuy.com/# cialis without a doctor prescription

  11. Supplied that the correct practices and capabilities are instilled into wannabe entrepreneurs, they’ll study the most effective for relaxation of their lives and ascend the easel of success while contributing to the nationwide progress and the human resource development in India.

  12. Dwayneseisa表示:

    Buy Tadalafil 5mg Tadalafil Easy Buy Cialis 20mg price in USA

  13. ILooklWat表示:

    Нужна арматура оптом в Москве – вам на armatura-v-mosmow.ru за выгодными ценами за метр и тонну.

  14. MarvinInget表示:

    кракен купить – kraken зайти, кракен официальный сайт

  15. WilliamNop表示:

    Cheap generic Viagra online: Generic 100mg Easy – viagra canada

  16. Kennethslity表示:

    https://kamagrakopen.pro/# kamagra kopen nederland

  17. GregoryJough表示:

    Generic 100mg Easy: buy generic 100mg viagra online – Cheap Sildenafil 100mg

  18. BryanLam表示:

    http://www.bazyydlyaxrumerkupitt.ru – Купить базы для Xrumer с быстрым доступом

  19. Kennethslity表示:

    http://generic100mgeasy.com/# buy generic 100mg viagra online

  20. TerryDus表示:

    http://generic100mgeasy.com/# buy generic 100mg viagra online

  21. GregoryJough表示:

    cialis without a doctor prescription: Tadalafil Easy Buy – Tadalafil Easy Buy

  22. WilliamNop表示:

    buy generic 100mg viagra online: Viagra generic over the counter – Sildenafil Citrate Tablets 100mg

  23. MarvinInget表示:

    кракен – kraken зеркало, kraken shop

  24. EverettMibra表示:

    результат общего анализа крови купить https://analiz-kupit-spb.ru

  25. TerryDus表示:

    http://generic100mgeasy.com/# buy generic 100mg viagra online

  26. Dwayneseisa表示:

    Tadalafil Easy Buy Tadalafil Easy Buy Buy Cialis online

  27. You can definitely see your expertise within the work you write.
    The world hopes for even more passionate writers like you who aren’t afraid to mention how they believe.
    At all times go after your heart. http://Www.Gz-jj.com/comment/html/?425173.html

  28. Kennethslity表示:

    https://generic100mgeasy.shop/# Cheap generic Viagra online

  29. 25 to seventy five years or extra.

發佈留言

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