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

32,571 Responses

  1. by88表示:

    Thank you for this article. I will also like to say that it can possibly be hard when you find yourself in school and simply starting out to create a long credit rating. There are many college students who are just simply trying to pull through and have an extended or favourable credit history are often a difficult factor to have.

  2. Профессиональный сервисный центр по ремонту бытовой техники с выездом на дом.
    Мы предлагаем:ремонт крупногабаритной техники в москве
    Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!

  3. Dwayneseisa表示:

    cialis without a doctor prescription Generic Cialis price cialis without a doctor prescription

  4. Williamuniot表示:

    пин ап зеркало – пинап казино

  5. Профессиональный сервисный центр по ремонту бытовой техники с выездом на дом.
    Мы предлагаем:сервисные центры в москве
    Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!

  6. BryanLam表示:

    https://bazyydlyaxrumerkupitt.ru/ – Официальный сайт с базами для Xrumer

  7. Профессиональный сервисный центр по ремонту бытовой техники с выездом на дом.
    Мы предлагаем:сервис центры бытовой техники москва
    Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!

  8. Williamuniot表示:

    пин ап – пин ап вход

  9. JesseDex表示:

    пин ап зеркало: https://pinupkz.life/

  10. JesseDex表示:

    pinup 2025: https://pinupkz.life/

  11. What’s up i am kavin, its my first occasion to
    commenting anywhere, when i read this article i thought i could also make comment due to this sensible piece of writing. http://Fairviewumc.church/bbs/board.php?bo_table=free&wr_id=6193230

  12. Jamesavata表示:

    пин ап казино – пинап казино

  13. Jamesavata表示:

    пин ап казино – пин ап

  14. Williamuniot表示:

    пин ап зеркало – пин ап

  15. Davidbop表示:

    Upshift Finance is a next-generation decentralized trading platform designed to provide secure, fast, and efficient crypto transactions. With smart contract automation, low transaction fees, and seamless integration with DeFi protocols, Upshift Finance empowers traders to swap digital assets and execute trades with maximum security. Whether you’re a beginner or an experienced trader, Upshift Finance offers a powerful, transparent, and user-friendly trading ecosystem. https://upshift.ink

  16. Dwayneseisa表示:

    TadalafilEasyBuy.com Tadalafil Easy Buy cialis without a doctor prescription

  17. BryanLam表示:

    xrumer базы – Готовые Xrumer базы для массового размещения ссылок

  18. Williamuniot表示:

    pinup 2025 – pinup 2025

  19. Jamesavata表示:

    пин ап – пин ап

  20. Jamesavata表示:

    пин ап вход – пинап казино

  21. I love reading through a post that will make men and women think. Also, many thanks for permitting me to comment.

  22. Davidhunty表示:

    Perena is a cutting-edge blockchain development platform designed to empower decentralized applications (dApps) with scalable and secure solutions. Built for Web3 innovators, Perena blockchain solutions offer seamless integration, high-performance smart contracts, and decentralized infrastructure. Whether you’re building DeFi protocols, NFT marketplaces, or enterprise blockchain applications, Perena provides the tools needed to scale with confidence. https://perena.tech

  23. Normally, you might deduct what you pay for state, local and even international actual property property taxes.

  24. Jamesimini表示:

    UnagiSwap is a cutting-edge decentralized exchange (DEX) that provides fast, secure, and transparent crypto trading. Designed for traders looking to swap digital assets efficiently without intermediaries, UnagiSwap offers low fees, deep liquidity, and seamless smart contract execution. Whether you’re a casual trader or a professional investor, UnagiSwap’s non-custodial platform ensures full control over your assets in a decentralized environment. https://unagiswap.org

  25. JesseDex表示:

    пин ап казино зеркало: https://pinupkz.life/

  26. Amazing! This blog looks exactly like my old one!
    It’s on a totally different subject but it has pretty much the same page layout and design.
    Excellent choice of colors! http://gocincy5k.com/__media__/js/netsoltrademark.php?d=Heart-Hotel.com%2Fcomment%2Fhtml%2F%3F157232.html

發佈回覆給「Davidhunty」的留言 取消回覆

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