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

30,845 Responses

  1. срочное изготовление загранпаспорта срочное изготовление загранпаспорта .

  2. Chong表示:

    Ten LG Freezers That Really Improve Your Life lg
    freezers (Chong)

  3. срочное изготовление загранпаспорта срочное изготовление загранпаспорта .

  4. I pay a visit every day some websites and websites to read content, except this web site offers feature based posts. http://Cmall.gsnu.info/bbs/board.php?bo_table=free&wr_id=154477

  5. Barrybib表示:

    Generic Cialis price: Generic Cialis without a doctor prescription – Buy Cialis online

  6. Minor accidents and accidents might not be a huge burden, but any major accident can wipe away all your life time savings.

  7. Donaldabula表示:

    ed medications cost fast pills easy erectile dysfunction medications online

  8. RogerFaf表示:

    http://fastpillsformen.com/# buy Viagra online

  9. Charlesbot表示:

    https://maxpillsformen.com/# п»їcialis generic

  10. Barrybib表示:

    Buy Tadalafil 5mg: Cheap Cialis – Generic Cialis without a doctor prescription

  11. Just want to say your article is as amazing. The clearness for your put up is simply great and that i can assume you’re an expert in this subject.
    Well together with your permission allow me to take hold of your RSS feed to stay up
    to date with coming near near post. Thank you 1,000,000 and please carry on the rewarding work.

  12. OLaneevige表示:

    Please let me know if you’re looking for a writer for your site. You have some really great articles and I believe I would be a good asset. If you ever want to take some of the load off, I’d absolutely love to write some content for your blog in exchange for a link back to mine. Please blast me an email if interested. Thanks!

    https://ameli-studio.com.ua/headlight-sealing-after-accident.html

  13. срочное оформление загранпаспорта срочное оформление загранпаспорта .

  14. Diplomi_vhml表示:

    купить медицинский диплом купить медицинский диплом .

  15. Diplomi_pjml表示:

    дипломы купить челны дипломы купить челны .

  16. частная скорая наркологическая помощь klin.0pk.me/viewtopic.php?id=4428 .

  17. JacobLoody表示:

    http://pravoslavieug.ru — pravoslavieug — ваш надежный партнер в создании кухонного интерьера.

  18. I truly love your blog.. Very nice colors & theme. Did you create this amazing site yourself? Please reply back as I’m planning to create my very own blog and would like to learn where you got this from or just what the theme is called. Thank you.

  19. загранпаспорт стоимость [url=http://turforum.borda.ru/?1-8-0-00002177-000-0-0-1735287991/]загранпаспорт стоимость[/url] .

  20. StephenDeery表示:

    Why users still make use of to read news papers when in this technological world the whole thing is existing on web?

    http://bagstore.com.ua/uv-resistance-headlight-sealants.html

  21. FobertWen表示:

    Thank you for the good writeup. It in reality used to be a amusement account it. Look complex to more introduced agreeable from you! By the way, how can we keep up a correspondence?

    https://bike-drive.com.ua/diy-headlight-sealing-guide.html

發佈留言

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