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

  1. быстрый вывод из запоя ростов https://klin.0pk.me/viewtopic.php?id=4405/ .

  2. лучшие онлайн казино http://www.casino-bonus.by .

  3. вывод из запоя на дому ростов-на-дону https://www.golosa.ukrbb.net/viewtopic.php?f=3&t=7467 .

  4. Aviator is India’s go-to for fast-paced, decision-based gambling. The challenge? Cash out at the peak or risk it all. With real-money rounds and demos, this game brings a unique level of engagement to the online casino scene.

    aviator game online aviator online game .

  5. Тут можно преобрести огнестойкий сейф огнеупорные сейфы

  6. Diplomi_vlEa表示:

    реально ли купить диплом о высшем 1oriks-diplom199.ru .

  7. LloydNoice表示:

    https://furpharm.com/# buy lasix fur pharm

  8. Тут можно преобрести купить оружейный сейф в москве купить оружейный шкаф

  9. 아산오피表示:

    I could not resist commenting. Exceptionally well written.

  10. Briankib表示:

    Joseph R. Biden Jr. promised to be the most pro-labor president in history. He embraced unions more overtly than his predecessors in either party, and filled his administration with union supporters.
    [url=https://kraken3yvbvzmhytnrnuhsy772i6dfobofu652e27f5hx6y5cpj7rgyd-onion.net]kraken4qzqnoi7ogpzpzwrxk7mw53n5i56loydwiyonu4owxsh4g67yd.onion[/url]
    Labor seemed to respond accordingly. Filings for unionization elections spiked to their highest level in a decade, as did union victories. There were breakthroughs at companies like Starbucks and Amazon, and unions prevailed in organizing a major foreign auto plant in the South. A United Automobile Workers walkout yielded substantial contract gains — and images of Mr. Biden joining a picket line.

    As Donald J. Trump prepares to retake the White House, labor experts expect the legal landscape for labor to turn sharply in another direction.

    Based on Mr. Trump’s first term and his comments during the campaign — including his praise for Tesla’s chief executive, Elon Musk, for what he said was Mr. Musk’s willingness to fire striking workers — these experts say the new administration is likely to bring fewer challenges to employers who fight unions.

    kraken3yvbvzmhytnrnuhsy772i6dfobofu652e27f5hx6y5cpj7rgyd.onion
    https://kraken3yvbvzmhytnrnuhsy772i6dfobofu652e27f5hx6y5cpj7rgyd.com

  11. MiguelSom表示:

    King Charles has led the nation in two minutes of silence in remembrance of men and women who lost their lives serving in the two world wars or other conflicts.
    [url=https://kra4.vip]kra8.gl[/url]
    Tens of thousands of veterans and civilians joined the King in paying their respects to the fallen at the annual National Service of Remembrance ceremony at the Cenotaph in central London.

    The King was joined by other members of the Royal Family, including the Prince and Princess of Wales, and political leaders.

    Events to mark Remembrance Sunday – observed on the closest Sunday to Armistice Day – are taking place around the country.

    The King laid the first wreath on behalf of the nation. Dressed in the Royal Navy uniform of the Admiral of the Fleet, he saluted after stepping back from the Cenotaph.

    The King was followed by Queen Camilla’s equerry, Major Ollie Plunket, laying a wreath on her behalf as she is currently recovering from a chest infection.

    Prince William, Prince Edward and Princess Anne followed, then Prime Minister Sir Keir Starmer and the country’s other political leaders.

    kra5.at
    https://kr10at.com

  12. Тут можно преобрести огнестойкие сейфы сейф огнестойкий купить

  13. CurtisCem表示:

    lasix lasix furpharm

發佈留言

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