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

  1. JacobLoody表示:

    https://osmio.ru/ — надёжные решения для вашего интерьера.

  2. Donaldabula表示:

    cheap viagra FastPillsForMen Viagra generic over the counter

  3. Barrybib表示:

    Buy Tadalafil 10mg: Generic Cialis without a doctor prescription – Cialis without a doctor prescription

  4. This design is steller! You definitely know how to keep a reader amused.

    Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!)
    Wonderful job. I really loved what you had to say,
    and more than that, how you presented it. Too cool! https://tangguifang.dreamhosters.com/comment/html/?1055915.html

  5. 5 minutes for white pieces, four minutes for black items, no increment for the primary 60 moves, three seconds increment per move beginning at the move 61 (3.7.3).

  6. JacobLoody表示:

    https://sklad-ymov.ru — Все для вашего удобства: каталог, консультации и профессиональный сервис.

  7. Charlesbot表示:

    http://maxpillsformen.com/# cialis for sale

  8. Hello my family member! I want to say that this post is awesome,
    great written and come with almost all important infos.
    I would like to peer extra posts like this . https://Tangguifang.Dreamhosters.com/comment/html/?1061395.html

  9. RogerFaf表示:

    https://fastpillsformen.com/# Cheap Viagra 100mg

  10. Best of all, the interesting armoire doesn’t give a clue it’s hiding electronics so, when the doorways are closed, the ambiance remains undisturbed.

  11. JacobLoody表示:

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

  12. Since people understand the collective group to be more vital than the individual, self-sacrificing behavioral ideas, like altruism, are required to maintain the person in line and subservient to the better good.

  13. Diplomi_sspi表示:

    купить диплом в троицке 4russkiy365-diplomy.ru .

  14. Diplomi_mbpi表示:

    сделать диплом о высшем образовании сделать диплом о высшем образовании .

  15. RogerFaf表示:

    https://fastpillseasy.com/# erectile dysfunction medication online

  16. Donaldabula表示:

    generic sildenafil cheap viagra sildenafil over the counter

  17. JacobLoody表示:

    http://nedra2021.ru — идеальное сочетание цены и качества.

  18. Remarkable! Its truly remarkable article, I have got much clear idea about from this
    post. http://vanham.kr/bbs/board.php?bo_table=free&wr_id=156988

  19. Diplomi_wmpi表示:

    купить аттестат школы за 11 класс купить аттестат школы за 11 класс .

  20. Right now it appears like Movable Type is the top blogging platform available right
    now. (from what I’ve read) Is that what you’re using on your blog? http://ww.icmms.co.kr/bbs/board.php?bo_table=free&wr_id=5383

  21. Donaldabula表示:

    Cheap Viagra 100mg buy viagra online Viagra Tablet price

  22. JacobLoody表示:

    http://rlkk.ru — Выбор, которому доверяют наши клиенты. Оформляйте заказ прямо сейчас!

發佈留言

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