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

  1. Diplomi_gmml表示:

    советский диплом купить советский диплом купить .

  2. I’ve learn a few excellent stuff here. Definitely price bookmarking for revisiting.
    I wonder how much effort you set to make the sort of wonderful informative web site. http://www.cqcici.com/comment/html/?329030.html

  3. Hi there! I could have sworn I’ve been to your blog before but after going through some of the posts I realized it’s new to me. Anyhow, I’m definitely happy I came across it and I’ll be bookmarking it and checking back regularly.

  4. загранпаспорт быстро [url=turforum.borda.ru/?1-8-0-00002177-000-0-0-1735287991]загранпаспорт быстро[/url] .

  5. BrettTIT表示:

    cialis for sale: Generic Cialis without a doctor prescription – Cialis over the counter

  6. I’m impressed, I have to admit. Rarely do I encounter a blog that’s equally educative and engaging, and let me tell you, you have hit the nail on the head. The problem is something which too few people are speaking intelligently about. I am very happy I came across this during my hunt for something concerning this.

  7. Donaldabula表示:

    best online ed pills fast pills easy ed prescriptions online

  8. наркологическая срочная помощь [url=http://www.gov.ukrbb.net/viewtopic.php?f=3&t=6398]наркологическая срочная помощь[/url] .

  9. RogerFaf表示:

    http://fastpillseasy.com/# best ed pills online

  10. Charlesbot表示:

    https://fastpillsformen.com/# Buy Viagra online cheap

  11. JacobLoody表示:

    http://candykitchen.ru — Узнайте, как легко заказать кухню на сайте Candy Kitchen.

  12. JacobLoody表示:

    https://www.dryshop.ru — стильные и функциональные кухни под заказ.

  13. наркологическая скорая [url=http://klin.0pk.me/viewtopic.php?id=4428/]http://klin.0pk.me/viewtopic.php?id=4428/[/url] .

  14. This page was last edited on 17 February 2021, at 08:54 (UTC).

  15. BrettTIT表示:

    online ed pharmacy: cheap ed drugs – erectile dysfunction medication online

  16. Diplomi_awml表示:

    купить диплом задним числом купить диплом задним числом .

  17. RogerFaf表示:

    http://fastpillsformen.com/# Cheap generic Viagra online

  18. Although we do lose this feature, we consider that with out the dependencies that enabled Magnifier to work in a WPF-specific approach, we may be more agile in what we provide to WPF prospects shifting forward.

  19. Lordmzu表示:

    Every word in this the post is filled with deep meaning and makes you think seriously https://000-google-09.s3.eu-north-1.amazonaws.com/id-10.html
    Like 7272

  20. Empty anchor表示:

    I’m very happy to find this website. I wanted to thank you for ones time for this particularly fantastic read!! I definitely really liked every bit of it and I have you book marked to see new stuff on your site.

  21. Donaldabula表示:

    Cialis 20mg price in USA MaxPillsForMen.com cheapest cialis

  22. Charlesbot表示:

    http://fastpillseasy.com/# boner pills online

  23. mitolyn表示:

    I would like to thank you for the efforts you’ve put in writing this blog. I am hoping to check out the same high-grade blog posts by you in the future as well. In truth, your creative writing abilities has motivated me to get my own website now 😉

發佈留言

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