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

  1. Узнай все о удаление полипа в матке цена в москвеудаление полипа в эндометрии матки

  2. DavidBaide表示:

    mexico pharmacies prescription drugs http://mexicanpharmgate.com/ mexico drug stores pharmacies

  3. Most Popular Money Making Apps in Pakistan, Try These Money Making Apps in Pakistan
    earning app pakistan [url=https://earningappinpakistan.com/]easy earning app in pakistan[/url] .

  4. AlbertDuM表示:

    cytotec online: buy cytotec online – cytotec online

  5. DavidBaide表示:

    mexican drugstore online https://mexicanpharmgate.com/ medicine in mexico pharmacies

  6. xnxx.com表示:

    You need to be a part of a contest for one of the greatest sites on the net. I most certainly will highly recommend this web site!

  7. Enjoy seamless betting on Mostbet in Bangladesh | Win exciting rewards with Mostbet casino bonuses | Download Mostbet Bangladesh app for easy betting | Download Mostbet APK and start betting today | Mostbet app provides a user-friendly experience | Mostbet is the best platform for online betting | Mostbet casino is trusted by players worldwide Mostbet sports betting.

  8. Узнай все о гистероскопия матки удаление полипа москваудаление полипа эндометрия

  9. Download the Mostbet app for easy access | Bet on your favorite sports with Mostbet in Bangladesh | Mostbet Bangladesh offers hassle-free deposits | Win massive jackpots with Mostbet casino games | Mostbet login gives you access to unlimited games and rewards | Download Mostbet and join the winning team today | Bet big and win bigger with Mostbet bonuses Mostbet online gaming.

  10. Узнай все о полипы удаление гистероскопия ценаполип эндометрия операция

  11. BrandenSlomy表示:

    can i buy amoxicillin over the counter: Com Pharm – where to get amoxicillin over the counter

  12. BrandenSlomy表示:

    buy amoxicillin without prescription: amoxicillin 500 mg purchase without prescription – amoxicillin without rx

  13. RobertSam表示:

    What is DeBridge Finance?
    DeBridge Finance is an innovative solution designed to facilitate seamless cross-chain blockchain operations. It empowers developers and users by allowing the transfer of data and assets across different blockchain networks efficiently and securely.
    [url=https://sites.google.com/view/debridge-finance/bridge]Debridge[/url]
    Key Features of DeBridge Finance
    DeBridge Finance stands out due to its remarkable features which include:

    Interoperability: The platform provides effective interoperability between multiple blockchains, eliminating the boundaries that exist.
    Security: By leveraging advanced security protocols, DeBridge ensures the safe transit of data and assets.
    Scalability: It is designed to handle a growing number of transactions without compromising on performance.
    How Does DeBridge Finance Work?
    DeBridge Finance operates through a combination of smart contracts and decentralized communication protocols. These components work together to authenticate and execute cross-chain data and asset transfers swiftly and securely.

    Smart Contracts
    The platform utilizes smart contracts to automate processes and ensure trustless operations across different chain environments.

    Decentralized Communication
    Communication across blockchains is made possible through a decentralized message protocol, enabling effective data sharing.

    Benefits of Using DeBridge Finance
    Choosing DeBridge Finance for cross-chain operations brings several advantages:

    Cost-Effectiveness: By integrating various blockchains, it reduces the cost and complexity of using multiple networks.
    Developer-Friendly: Offering robust tools and resources, DeBridge makes it easier for developers to build cross-chain applications.
    Enhanced User Experience: Users benefit from smoother transactions without the need to switch between different network interfaces.

發佈留言

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