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

  1. StephenDeery表示:

    Hi i am kavin, its my first time to commenting anyplace, when i read this piece of writing i thought i could also create comment due to this sensible post.

    http://blooms.com.ua/bi-led-linzy-dlya-avto-reitynh-naykrashchykh-varyantiv-2025-roku

  2. AndreDib表示:

    escrow pharmacy canada https://mexicaneasypharm.com/# purple pharmacy mexico price list
    indian pharmacies safe

  3. CurtisBam表示:

    certified canadian pharmacy: canadian pharmacy 24h com safe – legitimate canadian online pharmacies

  4. AndreDib表示:

    trusted canadian pharmacy https://mexicaneasypharm.shop/# Mexican Easy Pharm
    online pharmacy india

  5. сравнение процессоров для пк [url=http://topcpu.ru/]http://topcpu.ru/[/url] .

  6. JacobLoody表示:

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

  7. click4r.com表示:

    20 Fun Facts About Best Lawyer For Accidents accident Lawsuits – click4r.com,

  8. OLaneevige表示:

    Hi there I am so happy I found your blog page, I really found you by mistake, while I was researching on Digg for something else, Anyways I am here now and would just like to say thanks a lot for a incredible post and a all round enjoyable blog (I also love the theme/design), I don’t have time to browse it all at the moment but I have saved it and also included your RSS feeds, so when I have time I will be back to read a great deal more, Please do keep up the great jo.

    https://delavore.com.ua/bi-led-linzy-dlya-avto-chomu-ikh-vybyrayut-tysyachi-vodiyiv

  9. If the corporate has declared plenty of dividends previously, then you possibly can certainly go for it.

  10. Dersoom.com表示:

    Hi! I know this is somewhat off-topic but I had to
    ask. Does building a well-established website such as yours require a large amount of
    work? I’m completely new to operating a blog but I do write in my journal on a daily basis.

    I’d like to start a blog so I will be able to share my personal experience and views online.

    Please let me know if you have any suggestions or tips for new aspiring bloggers.
    Appreciate it! http://Dersoom.com/bbs/board.php?bo_table=free&wr_id=338697

  11. The overwhelmingly popular move here – about 10 times more common than everything else mixed – is 2. Nf3.

  12. AngelCroft表示:

    fitnessclubmalibu.ru — Онлайн-ресурс для поиска стильных кухонь на заказ.

  13. 電気脱毛表示:

    You should be a part of a contest for one of the finest sites on the web. I’m going to recommend this blog!

  14. index表示:

    Hello, I do believe your web site might be having internet browser compatibility issues. When I take a look at your website in Safari, it looks fine however, if opening in Internet Explorer, it’s got some overlapping issues. I simply wanted to provide you with a quick heads up! Apart from that, great blog.

  15. KS79表示:

    Hi there! This post couldn’t be written much better! Looking through this post reminds me of my previous roommate! He constantly kept talking about this. I most certainly will send this information to him. Pretty sure he’ll have a good read. Thanks for sharing!

  16. какой процессор лучше http://www.topcpu.ru/ .

  17. FrankEmine表示:

    slot siteleri: slot siteleri – slot oyunlar? puf noktalar?

  18. JacobLoody表示:

    http://a-p-i.ru — создаём комфорт в вашем доме.

  19. BradleyEdino表示:

    canl? casino siteleri Casino Siteleri guvenilir casino siteleri

  20. Wallacefex表示:

    casino bahis siteleri: casino bahis siteleri – ilk giriЕџte bonus veren bahis siteleri

  21. FrankEmine表示:

    sweet bonanza guncel: sweet bonanza demo oyna – sweet bonanza slot

發佈留言

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