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. Arthurhow表示:

    https://interpharmonline.shop/# reputable canadian online pharmacy
    safe online pharmacies in canada

  2. Astrology describes that firoza gem is extra presupposed to serve higher responses when used with gold ring, pendant or bracelet.

  3. Williszew表示:

    http://mexicanpharminter.com/# Mexican Pharm International

  4. Georgewhend表示:

    india online pharmacy store: India Med Fast – IndiaMedFast

  5. Montebeera表示:

    cheapest online pharmacy india order medicines online india online medicine shopping in india

  6. nhatvip表示:

    Saved as a favorite, I really like your site!

  7. Arthurhow表示:

    http://interpharmonline.com/# safe canadian pharmacy
    canadian pharmacy tampa

  8. Williszew表示:

    http://indiamedfast.com/# IndiaMedFast.com

  9. Arthurhow表示:

    http://interpharmonline.com/# safe canadian pharmacy
    canada pharmacy online

  10. But researchers have been curious — do male gestational carriers have some of the same tricks that females use for extra strong offspring?

  11. v8club表示:

    Great post! We will be linking to this great post on our site. Keep up the good writing.

  12. JamesGag表示:

    online medicine shopping in india: order medicines online india – IndiaMedFast.com

  13. pdacenter.ru – сервис по ремонту бытовой техники
    Ремонт MacBook в Красноярске в официальном сервисном центре PDACENTER.
    Наши инженеры выполняют ремонт любой сложности по дотупным ценам!

  14. It’s amazing for me to have a web site, which
    is valuable in favor of my knowledge. thanks admin https://Classifieds.Ocala-News.com/author/verenafiori

  15. JamesGag表示:

    mexican pharmacy online store: buying from online mexican pharmacy – mexican pharmacy online store

  16. Hi! I’ve been reading your weblog for a long time now and finally got the bravery to go ahead and give you a shout out
    from Atascocita Texas! Just wanted to tell you keep up the fantastic
    work! http://interiorwork.Co.kr/bbs/board.php?bo_table=free&wr_id=2231451

  17. Arthurhow表示:

    https://mexicanpharminter.com/# buying from online mexican pharmacy
    canadian pharmacy meds reviews

  18. Georgewhend表示:

    online medicine shopping in india: India Med Fast – India Med Fast

  19. Montebeera表示:

    Mexican Pharm International mexican pharmacy online Mexican Pharm Inter

  20. kasyno表示:

    Zaskakująco duży wybór legalnych bukmacherów z cashbackiem | Dobry opis funkcjonalności serwisów kasynowych | Przydatne porady jak wypłacić pieniądze z konta | Opcja filtrowania kasyn według metod płatności – super | Bardzo dobre porównanie kodów promocyjnych | Porównywarka kasyn idealna do szybkiego wyboru | Oferty kasyn z rejestracją w kilka kliknięć | Przydatne informacje dla każdego gracza | Ranking kasyn 2024 – aktualne dane zakłady lol.

  21. xanh9表示:

    I’m impressed, I must say. Rarely do I encounter a blog that’s both educative and entertaining, and let me tell you, you have hit the nail on the head. The issue is something which not enough men and women are speaking intelligently about. Now i’m very happy that I stumbled across this in my hunt for something concerning this.

  22. Arthurhow表示:

    https://indiamedfast.com/# online medicine shopping in india
    canadadrugpharmacy com

  23. Тут можно преобрести навес для машины из поликарбоната в Санкт-Петербурге подробно на сайте навес на даче

  24. This is actually appealing, You’re a significantly seasoned author. I have joined with your feed plus expect witnessing the very good write-ups. And additionally, We’ve shared your web blog inside our social networking sites.

  25. Georgewhend表示:

    vipps canadian pharmacy: legitimate canadian pharmacies online – cheap canadian pharmacy

  26. Hello there, just became aware of your blog through Google, and found that it’s really informative.
    I am gonna watch out for brussels. I’ll appreciate if
    you continue this in future. A lot of people will
    be benefited from your writing. Cheers! http://bloflaherty.com/__media__/js/netsoltrademark.php?d=gratisafhalen.be%2Fauthor%2Flatonyarame%2F

  27. Williszew表示:

    http://mexicanpharminter.com/# Mexican Pharm Inter

  28. mayclub表示:

    Oh my goodness! Amazing article dude! Thank you so much, However I am going through problems with your RSS. I don’t understand why I cannot subscribe to it. Is there anyone else getting the same RSS problems? Anyone that knows the answer will you kindly respond? Thanx!!

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

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