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

  1. Тут можно преобрести купить сейф для пистолета сейф охотничий купить

  2. Bradleygoath表示:

    http://canadiandrugsgate.com/# buy ed pills online

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

  4. Сервисный центр предлагает замена дсплея toshiba satellite l350 поенять клавиатуру toshiba satellite l350

  5. Uazrkgf表示:

    Можно ли купить аттестат о среднем образовании? Основные рекомендации
    mkkdm.ru/diplom-vipusknika-nachalnoy-shkoli-kupit.html

  6. Uazreyl表示:

    Сколько стоит диплом высшего и среднего образования и как это происходит?

    techinstyle.tv/attestat-polnogo-srednego-obrazovaniya-kupit.html

  7. Сервисный центр предлагает замена заднего стекла micromax canvas power aq5001 замена разъема зарядки micromax canvas power aq5001

  8. Jamiecaw表示:

    http://indianpharmacyeasy.com/# india online pharmacy

  9. Uazrukr表示:

    Можно ли купить аттестат о среднем образовании, основные моменты и вопросы
    unitedindoorfootball.com/kupit-cherniy-diplom.html

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

  11. наркология вывод из запоя ростов gaslo.ukrbb.net/viewtopic.php?f=13&t=3409 .

  12. Jefferyvof表示:

    Groundbreaking telescope reveals first piece of new cosmic map
    [url=https://kra17att.cc]kraken marketplace[/url]
    Greetings, earthlings! I’m Jackie Wattles, and I’m thrilled to be a new name bringing awe to your inbox.

    I’ve covered space exploration for nearly a decade at CNN, and there has never been a more exciting time to follow space and science discoveries. As researchers push forward to explore and understand the cosmos, advancements in technology are sparking rapid developments in rocketry, astronomical observatories and a multitude of scientific instruments.
    https://kra17att.cc
    kraken ссылка
    Look no further than the missions racing to unlock dark matter and the mysterious force known as dark energy, both so named precisely because science has yet to explain these phenomena.

    Astronomers have never detected dark matter, but they believe it makes up about 85% of the total matter in the universe. Meanwhile, the existence of dark energy helps researchers explain why the universe is expanding — and why that expansion is speeding up.
    Extraordinary new scientific instruments are churning out trailblazing data, ready to reshape how scientists view the cosmos.

    A prime example is the European Space Agency’s wide-angle Euclid telescope that launched in 2023 to investigate the riddles of dark energy and dark matter.

    Euclid this week delivered the first piece of a cosmic map — containing about 100 million stars and galaxies — that will take six years to create.

    These stunning 3D observations may help scientists see how dark matter warps light and curves space across galaxies.

    Meanwhile, on a mountaintop in northern Chile, the US National Science Foundation and Stanford University researchers are preparing to power up the world’s largest digital camera inside the Vera C. Rubin Observatory.

    Unearthed
    In the mountains of Uzbekistan, a research team used lasers strapped to a flying robot to uncover two cities buried and lost for centuries.

    The anthropologists said they had mapped these forgotten medieval towns for the first time — located at a key crossroad of ancient silk trade routes — using a drone equipped with LiDAR, or light detection and ranging equipment.

    When nature reclaims what’s left of once thriving civilizations, scientists are increasingly turning to remote sensing to peer through dense vegetation.

    The images revealed two large settlements dotted with watchtowers, fortresses, complex buildings, plazas and pathways that tens of thousands of people may have called home.

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

  14. вывод из запоя дешево ростов-на-дону https://vkontakte.forum.cool/viewtopic.php?id=19596 .

  15. GlennSnofs表示:

    mail order pharmacy india indian pharmacy easy indian pharmacy

發佈留言

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