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

36,145 Responses

  1. This model includes shaving or buzzing one or each sides of the head while leaving the top section longer.

  2. Monopoly was first invented in 1903 to demonstrate how economics works with few restrictions, but it wasn’t until 1935 that Parker Brothers published the game.

  3. VirgilBlawl表示:

    cheap clomid no prescription ClmHealthPharm can i order generic clomid price

  4. The fantasy-drenched concept of a race of people residing below ground is actually an previous one.

  5. Roberttic表示:

    https://clmhealthpharm.shop/# buy generic clomid

  6. And if nobody had created such a search engine, it is onerous to say how profoundly completely different your Net experiences could be.

  7. BrandonJag表示:

    can i purchase generic clomid without prescription: ClmHealthPharm – where buy cheap clomid pill

  8. Roberttic表示:

    https://doxhealthpharm.com/# doxycycline 2985

  9. VirgilBlawl表示:

    can i purchase clomid no prescription ClmHealthPharm buy clomid tablets

  10. JustinTam表示:

    zithromax 500 without prescription: zithromax 250 mg pill – zithromax online pharmacy canada

  11. Ben’s look evokes concern in everyone, and in consequence his relationship along with his fiancée ends.

  12. VirgilBlawl表示:

    can i order generic clomid no prescription how to buy cheap clomid without prescription can i get generic clomid without a prescription

  13. JustinTam表示:

    where can i get cheap clomid: how to buy cheap clomid now – where to buy generic clomid online

  14. BrandonJag表示:

    purchase zithromax online: Zithro Pharm – zithromax cost australia

  15. Briantrozy表示:

    how much is amoxicillin: AmoHealthPharm – can we buy amoxcillin 500mg on ebay without prescription

  16. I’m excited to find this site. I need to to thank you for your time just for
    this fantastic read!! I definitely savored every
    bit of it and i also have you saved as a favorite to see new stuff in your website. http://Savimballaggi.it/index.php/component/k2/item/6-the-cuban-money-crisis

  17. JacobLoody表示:

    https://reshetnyakova.ru – Кухни от производителя в Санкт-Петербурге.

  18. For 10 straightforward suggestions that make towing extra efficient and efficient, learn on.

  19. Helena表示:

    Wonderful beat ! I would like to apprentice while you amend
    your website, how could i subscribe for a weblog web site?

    The account aided me a appropriate deal. I were a little bit acquainted of this your broadcast offered vibrant
    clear idea http://Cockeyedcooter.com/__media__/js/netsoltrademark.php?d=Infiroute.com%2Fbbs%2Fboard.php%3Fbo_table%3Dfree%26wr_id%3D1017453

  20. On the other hand, a half hour of no dial tone can simply send individuals right into a panic.

  21. After looking into a number of the blog articles on your web site, I really appreciate your technique of blogging. I book-marked it to my bookmark website list and will be checking back in the near future. Take a look at my website as well and tell me how you feel.

  22. Cl-System.jp表示:

    Woah! I’m really digging the template/theme of this website.
    It’s simple, yet effective. A lot of times it’s very difficult to get that “perfect balance” between superb usability
    and visual appeal. I must say that you’ve done a very good job with this.

    In addition, the blog loads extremely quick for me
    on Firefox. Outstanding Blog! https://Cl-System.jp/question/investissement-immobilier-sur-le-quebec-strategies-et-opportunites-pour-un-financement-reussi/

  23. DavidCooth表示:

    https://slotdemo.auction/# Mesin slot dapat dimainkan dalam berbagai bahasa

  24. AngelCroft表示:

    https://www.freshlyme.ru/ — Место, где мечты о кухне становятся реальностью.

  25. JamesLok表示:

    Slot dengan tema film terkenal menarik banyak perhatian http://slotdemo.auction/# Kasino di Bali menarik banyak pengunjung

  26. Williecrady表示:

    Permainan slot mudah dipahami dan menyenangkan http://bonaslot.site/# Kasino di Bali menarik banyak pengunjung

  27. 14 Common Misconceptions About Small Double Buggy tandem strollers

  28. ThomasThype表示:

    Kasino menyediakan layanan pelanggan yang baik: slot demo pg gratis – demo slot pg

  29. JamesLok表示:

    Kasino menawarkan pengalaman bermain yang seru http://garuda888.top/# Kasino selalu memperbarui mesin slotnya

  30. Greetings, I believe your blog could be having internet browser compatibility issues. When I look at your web site in Safari, it looks fine however, when opening in Internet Explorer, it has some overlapping issues. I merely wanted to provide you with a quick heads up! Besides that, great site!

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

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