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

10,994 Responses

  1. Richardorele表示:

    buy zithromax online cheap: zithromax purchase online – zithromax generic cost

  2. Rytjix表示:

    viagra professional hopeless – levitra oral jelly cure levitra oral jelly online ham

  3. Henryfet表示:

    prednisone 20mg by mail order: how much is prednisone 10 mg – prednisone nz

  4. MarvinRoave表示:

    amoxicillin generic amoxicillin 500mg over the counter how much is amoxicillin prescription

  5. Henryfet表示:

    prednisone 20mg tab price: buy prednisone nz – 100 mg prednisone daily

  6. Henryfet表示:

    prednisone 50 mg coupon: prednisone pak – where to buy prednisone in canada

  7. Billyved表示:

    https://zithromaxa.store/# zithromax antibiotic without prescription

  8. MarvinRoave表示:

    where can i get doxycycline online doxycycline doxy 200

  9. Billyved表示:

    http://gabapentinneurontin.pro/# neurontin buy online

  10. Henryfet表示:

    neurontin drug: gabapentin generic – neurontin online usa

  11. Charleselila表示:

    zithromax antibiotic: zithromax cost – zithromax pill

  12. MarvinRoave表示:

    zithromax 500 without prescription zithromax online zithromax prescription

  13. Henryfet表示:

    generic neurontin cost: generic neurontin pill – neurontin uk

  14. Richardorele表示:

    can i buy prednisone online without a prescription: prednisone 40 mg price – prednisone 15 mg daily

  15. sex trẻ em表示:

    You’ve made some good points there. I checked on the internet to find out
    more about the issue and found most individuals will go along with your views on this website.

  16. Henryfet表示:

    where to buy zithromax in canada: generic zithromax over the counter – zithromax 250 mg

  17. MarvinRoave表示:

    doxycycline hyclate doxycycline mono buy cheap doxycycline

  18. Billyved表示:

    http://amoxila.pro/# buy amoxicillin 250mg

  19. Billyved表示:

    http://amoxila.pro/# cost of amoxicillin prescription

  20. Richardorele表示:

    prednisone uk price: prednisone pack – where to buy prednisone uk

  21. MarvinRoave表示:

    buy doxycycline without prescription doxycycline 100mg dogs buy doxycycline cheap

  22. Henryfet表示:

    buy amoxicillin 500mg usa: where can you buy amoxicillin over the counter – where can i buy amoxicillin over the counter uk

  23. Charleselila表示:

    doxycycline 150 mg: doxycycline hyclate – doxycycline order online

  24. Henryfet表示:

    prednisone 5mg capsules: cost of prednisone 10mg tablets – purchase prednisone

  25. MarvinRoave表示:

    amoxicillin 250 mg price in india cost of amoxicillin 30 capsules amoxicillin 875 mg tablet

  26. Henryfet表示:

    cost of neurontin 100mg: neurontin 600 mg pill – neurontin 100 mg

  27. Ismaelfer表示:

    Hello there! This is kind of off topic but I need some guidance from an established blog. Is it tough to set up your own blog? I’m not very techincal but I can figure things out pretty fast. I’m thinking about creating my own but I’m not sure where to begin. Do you have any points or suggestions? Thanks
    https://privatebin.net/?caa3c36837d1dfb1#EsdnaJ5GipkYWH4WtL8ddHqRJMUMgYTxmeSvajrm7fBW

  28. Richardorele表示:

    how to get zithromax over the counter: zithromax generic price – zithromax online pharmacy canada

  29. Billyved表示:

    https://amoxila.pro/# amoxicillin without rx

  30. Simply wish to say your article is as surprising. The clearness in your post is simply nice and i
    could assume you are an expert on this subject.

    Well with your permission allow me to grab your feed to keep
    up to date with forthcoming post. Thanks a million and please carry on the rewarding work. http://hanbitoffice.com/f_board/3348326

發佈留言

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