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

  1. JamesLok表示:

    Banyak pemain menikmati bermain slot secara online http://preman69.tech/# Slot dengan grafis 3D sangat mengesankan

  2. AngelCroft表示:

    coins-cccp.ru/ – Доступ к услугам, которые помогут выделить вашу продукцию.

  3. JamesLok表示:

    Pemain sering mencoba berbagai jenis slot http://preman69.tech/# Mesin slot baru selalu menarik minat

  4. Williecrady表示:

    Slot menjadi daya tarik utama di kasino https://preman69.tech/# Slot dengan tema budaya lokal menarik perhatian

  5. ThomasThype表示:

    Beberapa kasino memiliki area khusus untuk slot: preman69.tech – preman69

  6. Aaronbus表示:

    slotdemo slot demo Slot dengan pembayaran tinggi selalu diminati

  7. Sunriji.com表示:

    Hi there! Do you know if they make any plugins to help with SEO?
    I’m trying to get my blog to rank for some targeted keywords but I’m not seeing very good
    success. If you know of any please share. Many thanks! https://Sunriji.com/module/board.php?bo_table=free&wr_id=2573710

  8. 789bet表示:

    This excellent website really has all of the information I wanted about this subject and didn’t know who to ask.

  9. Aaronbus表示:

    slot 88 slot88 Mesin slot digital semakin banyak diminati

  10. I blog quite often and I seriously thank you for your content.

    This article has truly peaked my interest.
    I am going to bookmark your blog and keep checking for new details about once
    a week. I subscribed to your RSS feed too. http://blog-kr.dreamhanks.com/question/insectes-de-maison-au-quebec-identification-et-conseils-de-prevention-69/

  11. Aaronbus表示:

    slot demo rupiah slot demo rupiah Mesin slot digital semakin banyak diminati

  12. DavidCooth表示:

    http://bonaslot.site/# Bermain slot bisa menjadi pengalaman sosial

  13. Williecrady表示:

    Slot menjadi bagian penting dari industri kasino https://bonaslot.site/# Kasino di Indonesia menyediakan hiburan yang beragam

  14. JacobLoody表示:

    https://www.ded-moros.ru/ – Закажите кухню на официальном сайте.

  15. ThomasThype表示:

    Mesin slot sering diperbarui dengan game baru: slot demo gratis – slot demo

  16. DavidCooth表示:

    https://slot88.company/# Mesin slot digital semakin banyak diminati

  17. Just desire to say your article is as astonishing.
    The clarity in your publish is just cool and i could suppose you are knowledgeable in this
    subject. Fine with your permission let me to snatch your RSS feed to keep updated with impending
    post. Thanks one million and please keep up the gratifying work. http://www.dssusan.co.kr/bbs/board.php?bo_table=qna&wr_id=26984

  18. ThomasThype表示:

    Kasino memiliki suasana yang energik dan menyenangkan: slot 88 – slot88

  19. Williecrady表示:

    Kasino memiliki suasana yang energik dan menyenangkan http://preman69.tech/# Kasino menyediakan layanan pelanggan yang baik

  20. ThomasThype表示:

    Beberapa kasino memiliki area khusus untuk slot: slot88 – slot88.company

  21. JamesLok表示:

    Kasino di Jakarta memiliki berbagai pilihan permainan https://slotdemo.auction/# Jackpot besar bisa mengubah hidup seseorang

  22. AngelCroft表示:

    предметная съемка для маркетплейсов – Подготовьте товары для успешного продвижения онлайн. Узнайте, как привлечь покупателей.

  23. Williecrady表示:

    Kasino memiliki suasana yang energik dan menyenangkan http://garuda888.top/# Banyak pemain mencari mesin dengan RTP tinggi

  24. Rollaas.id表示:

    Hey there! I know this is kinda off topic but I was wondering
    which blog platform are you using for this site? I’m getting fed
    up of WordPress because I’ve had problems with hackers and I’m
    looking at options for another platform. I would be fantastic if you could
    point me in the direction of a good platform. https://rollaas.id/2024/12/14/les-meilleurs-marchandises-de-beaute-naturels/

  25. DavidCooth表示:

    https://preman69.tech/# Pemain bisa menikmati slot dari kenyamanan rumah

  26. JacobLoody表示:

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

  27. AngelCroft表示:

    https://www.ug5r.ru — Официальный сайт для выбора и заказа кухонь на заказ.

  28. ThomasThype表示:

    Slot menawarkan kesenangan yang mudah diakses: slot demo – akun demo slot

  29. Mtrc.co.kr表示:

    Hey there exceptional blog! Does running a blog such as this
    require a large amount of work? I’ve no expertise in computer programming but I was hoping to start my own blog soon. Anyway, if you have any ideas
    or techniques for new blog owners please share.

    I know this is off topic nevertheless I simply wanted to ask.
    Thanks a lot! http://Mtrc.co.kr/bbs/board.php?bo_table=free&wr_id=559585

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

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