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

19,206 Responses

  1. Mostbet provides fast registration and instant rewards | Mostbet registration is quick and simple | Sign up on Mostbet and enjoy the best betting odds | Mostbet promo codes unlock extra bonuses for players | Bet smarter with Mostbet’s expert recommendations | Unlock exclusive rewards with Mostbet in Bangladesh | Mostbet promo codes give you the edge in betting Mostbet sports betting.

  2. Play on Mostbet and win big every day | Win exciting rewards with Mostbet casino bonuses | Download Mostbet Bangladesh app for easy betting | Download Mostbet APK and start betting today | Mostbet Bangladesh offers fast payouts and secure betting | Unlock exclusive rewards with Mostbet in Bangladesh | Sign up now to claim your welcome bonus on Mostbet Mostbet app download.

  3. Lazrddr表示:

    Как не стать жертвой мошенников при покупке диплома о среднем полном образовании

    gemiacentesi.org/viewforum.php?f=8

  4. Lazrbsy表示:

    Аттестат 11 класса купить официально с упрощенным обучением в Москве
    fotomaniya.getbb.ru/viewtopic.php?f=16&t=13472

  5. Тут можно преобрести сейфы под оружие стоимость сейфа для оружия

  6. StevenNub表示:

    buy priligy: priligy maxpharm – Priligy tablets

  7. Dereketerm表示:

    can we buy amoxcillin 500mg on ebay without prescription: com pharm – amoxicillin 500 mg tablet price

  8. промокод робокасса promokod-robokassa.ru .

  9. Curtisduh表示:

    BBgate MarketPlace 2024 Breaking Bad Gate Forum
    BBgate MarketPlace

  10. Mostbet offers exciting sports betting options | Mostbet makes online gaming convenient and safe | Mostbet ensures an unmatched gaming experience | Win real money with Mostbet casino games | Mostbet Bangladesh is your trusted betting partner | Win massive jackpots with Mostbet’s exclusive games домен com.

  11. Download the Mostbet app for easy access | Mostbet offers the ultimate betting experience | Sign up now to claim your Mostbet welcome bonus | Discover innovative features on the Mostbet app | Download Mostbet for the best online betting experience | Experience seamless gaming on the Mostbet platform Bangladesh Mostbet.

  12. BrandenSlomy表示:

    prednisone online for sale: ray pharm – 1 mg prednisone cost

  13. BrandenSlomy表示:

    buy prednisone online canada: generic Prednisone – purchase prednisone 10mg

  14. робокасса промокоды https://promokod-robokassa.ru .

  15. Dereketerm表示:

    where can i order prednisone 20mg: cheap prednisone – prednisone 2.5 mg

發佈留言

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