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

  1. 母狗表示:

    This is a topic that’s near to my heart… Take care! Exactly where can I find the contact details for questions?

  2. Williecrady表示:

    Kasino di Jakarta memiliki berbagai pilihan permainan http://slot88.company/# Slot klasik tetap menjadi favorit banyak orang

  3. See What The Glass Doctor Tricks The Celebs Are Using The glass Doctor

  4. DavidCooth表示:

    http://garuda888.top/# Slot klasik tetap menjadi favorit banyak orang

  5. JacobLoody表示:

    https://ok-sochi.ru – Официальный сайт производителя кухонь.

  6. What’s up to every one, the contents present at this web site are actually amazing for people experience, well, keep up the good
    work fellows. https://Utahsyardsale.com/author/trentrausch/

  7. DavidCooth表示:

    http://bonaslot.site/# Mesin slot menawarkan berbagai tema menarik

  8. ThomasThype表示:

    Keseruan bermain slot selalu menggoda para pemain: BonaSlot – bonaslot

  9. ThomasThype表示:

    Slot dengan fitur interaktif semakin banyak tersedia: garuda888.top – garuda888

  10. Williecrady表示:

    п»їKasino di Indonesia sangat populer di kalangan wisatawan https://slot88.company/# Slot memberikan kesempatan untuk menang besar

  11. Spot on with this write-up, I absolutely think this web site needs a lot more attention. I’ll probably be returning to read through more, thanks for the info!

  12. Dannysex表示:

    лучшие фильмы 2025 подборка hdrezka сериалы драмы на телефоне

  13. Williecrady表示:

    Kasino memastikan keamanan para pemain dengan baik https://slot88.company/# Mesin slot menawarkan pengalaman bermain yang cepat

  14. DavidCooth表示:

    http://garuda888.top/# Pemain harus memahami aturan masing-masing mesin

  15. Greetings! Very helpful advice in this particular article! It is the little changes that produce the greatest changes. Many thanks for sharing!

  16. Aaronbus表示:

    akun demo slot slot demo gratis Banyak kasino memiliki program loyalitas untuk pemain

  17. Jane表示:

    Excellent site you have got here.. It’s difficult to find high-quality writing
    like yours these days. I seriously appreciate individuals like you!
    Take care!! http://Drsarapharmd.com/__media__/js/netsoltrademark.php?d=blog-Kr.Dreamhanks.com%2Fquestion%2Fservices-de-gestion-immobiliere-a-laval-optimisez-la-gestion-de-vos-proprietes-22%2F

  18. Great blog! Do you have any suggestions for aspiring writers?

    I’m planning to start my own website soon but I’m a little lost on everything.
    Would you advise starting with a free platform like WordPress or go for a paid option? There are so many choices
    out there that I’m completely overwhelmed .. Any recommendations?
    Bless you!

    Feel free to visit my web page :: หวยลาวซุปเปอร์ ล่าสุด

  19. JacobLoody表示:

    кухни на заказ – Широкий выбор кухонь на заказ с гарантией качества.

  20. Have you ever thought about writing an ebook or guest authoring
    on other blogs? I have a blog based upon on the same subjects you discuss and
    would love to have you share some stories/information. I know my visitors
    would appreciate your work. If you are even remotely interested, feel free to shoot me an email. http://Ptxperts.com/question/re-max-crystal-a-sainte-therese-votre-partenaire-de-confiance-pour-limmobilier/

  21. ThomasThype表示:

    Kasino menawarkan pengalaman bermain yang seru: slot demo – demo slot pg

  22. This is a really good tip especially to those new to the blogosphere. Brief but very accurate info… Thank you for sharing this one. A must read post.

  23. Aaronbus表示:

    slot88.company slot 88 Slot menjadi bagian penting dari industri kasino

  24. DavidCooth表示:

    http://bonaslot.site/# Slot dengan grafis 3D sangat mengesankan

  25. Williecrady表示:

    Slot menawarkan berbagai jenis permainan bonus http://bonaslot.site/# Kasino menawarkan pengalaman bermain yang seru

  26. DavidCooth表示:

    http://slotdemo.auction/# Pemain sering berbagi tips untuk menang

  27. JacobLoody表示:

    кухни от производителя – Кухни напрямую от производителя без переплат.

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

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