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

  1. kypit 1S_keoa表示:

    программа 1 с купить http://kupit-1s11.ru .

  2. kypit 1S_upoa表示:

    программа 1с купить с установкой программа 1с купить с установкой .

  3. StevenLoN表示:

    Unlock the Power of Eigenlayer
    As the blockchain landscape evolves, Eigenlayer emerges as a beacon of innovation, offering robust solutions to enhance blockchain security and customization. But what exactly does Eigenlayer bring to the table?
    eigenlayer staking rewards
    Revolutionizing Blockchain Security
    Security is paramount in the blockchain world, and Eigenlayer takes this seriously. By leveraging state-of-the-art technology, Eigenlayer provides an unparalleled layer of protection for blockchain protocols. This ensures that transactions are not only secure but also reliable.

    Advanced Encryption: Protects data integrity and confidentiality.
    Scalable Solutions: Ensures that security measures grow with your network’s demand.
    Customization like Never Before
    One of the most compelling features of Eigenlayer is its customization capabilities. Understanding that each blockchain project has unique needs, Eigenlayer offers a flexible architecture allowing projects to tailor solutions to their specific requirements.

    Modular Design: Adapts to various use cases without sacrificing performance.
    Interoperability: Seamlessly integrates with existing blockchain systems.
    Empowering Blockchain Ecosystems
    By providing these advanced features, Eigenlayer doesn’t just offer protection and customization; it empowers blockchain developers to push the boundaries of what’s possible. With Eigenlayer, the limitations often faced in blockchain scalability and security are becoming a thing of the past.

    Whether you are a developer seeking better security solutions or an entrepreneur aiming to launch your blockchain project with tailor-made features, Eigenlayer provides the tools and the support you need to succeed in the competitive digital landscape.

    Explore the potential of Eigenlayer today, and step into the future of blockchain technology with a partner committed to your success.

  4. AlbertDuM表示:

    minocycline: iver fast – ivermectin eye drops

  5. GichardPheve表示:

    I get pleasure from, result in I found exactly what I used to be taking a look for. You have ended my 4 day lengthy hunt! God Bless you man. Have a great day. Bye
    best online casino

  6. BernardMop表示:

    stromectol buy uk buy Ivermectin online stromectol over the counter

  7. Lewisslund表示:

    Hello Dear, are you in fact visiting this site daily, if so afterward you will without doubt get good experience.
    best online casino Australia

  8. DarrenUnjuh表示:

    https://plavixclo.com/# Clopidogrel 75 MG price

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

  10. Most Popular Money Making Apps in Pakistan, The Best and Trusted Money Earning Apps in Pakistan
    easy way to earn money online in pakistan easy way to earn money online in pakistan .

發佈留言

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