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

18,591 Responses

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

  2. After exploring a few of the articles on your web site, I truly appreciate your way of blogging. I added it to my bookmark website list and will be checking back soon. Please check out my web site too and tell me what you think.

  3. Cassy Lawn表示:

    The Reasons You Should Experience Mesothelioma Asbestosis At Least Once In Your Lifetime Cassy Lawn

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

  5. Diplomi_moEa表示:

    Привет, друзья!
    Заказать документ ВУЗа можно у нас в Москве.
    opentown.blogspot.com/2014/04/blog-post_20

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

  7. Mazrxoo表示:

    Добрый день!
    Стоимость дипломов высшего и среднего образования и процесс их получения
    finance-bank.ru/rubricator/medicina_i_zdorov_e/oficial_nye_organiza

  8. Lazrqah表示:

    Добрый день!
    Мы изготавливаем дипломы психологов, юристов, экономистов и прочих профессий по разумным ценам.
    ada.waaron.org/blog/index.php?entryid=21942

  9. KevinSounc表示:

    http://sweetbonanza.network/# sweet bonanza slot

  10. JoshuaDen表示:

    The man turning jet planes into cool houses
    русский анальный секс
    Wasilla, south central Alaska. Home to bears, lakes, mountains and a flight school that’s fast becoming a private aviation wonderland.

    At FLY8MA Pilot Lodge, you can opt for a scenic flight tour with glacier views, take the controls for a flying lesson, or go all in and get your pilot training.

    When night falls over the broad vistas of the US state they call the Last Frontier, you can then climb the steps to two unique accommodation experiences: a converted McDonnell Douglas DC-6 airplane and the newest arrival, a McDonnell Douglas DC-9 – still with its DHL livery.

    The fast-developing site is an ongoing project by FLY8MA founder Jon Kotwicki, who previously owned a flight school in Florida, before working as a commercial pilot and eventually ending up in Alaska.

    Flying for the airlines “pays good money and everything, but it’s a very boring job,” he says. “Driving Uber is more interesting because you could talk to your passengers.”

    Having fallen in love with the south central region on a vacation spent hiking, fishing and spotting bears and grizzlies, he chose it as a spot where he and his team – and his trusty Pomeranian dog Foxtrot – could “buy a lot of property and perhaps develop our own airport and run our own show.”

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

  12. Itxsrm表示:

    colospa 135 mg usa – cilostazol 100 mg cost cilostazol without prescription

  13. Diplomi_ttEa表示:

    Здравствуйте!
    Купить документ о получении высшего образования вы имеете возможность у нас в Москве.
    pedolog-pro.ru/forums

  14. Sazrqzm表示:

    Добрый день!
    Диплом для вас
    telegra.ph/diplom-srednego-obrazovaniya-kupit-08-22-3

  15. Mazrxlk表示:

    Привет, друзья!
    Легальная покупка диплома ПТУ с сокращенной программой обучения
    wow-tour.ru/page/4

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

  17. Sazrphh表示:

    Привет!
    Диплом магистра
    jagplay.ekafe.ru/viewtopic.php?f=22&t=4149

  18. Cazribu表示:

    Здравствуйте!
    Купить диплом института
    zpu-journal.ru/forum/view_profile.php?UID=309037

  19. Trefyzs表示:

    Здравствуйте!
    Реально ли приобрести диплом стоматолога? Основные этапы
    visualchemy.gallery/forum/viewtopic.php?pid=3410260#p3410260
    Всегда вам поможем!.

  20. Sazrnoy表示:

    Привет, друзья!
    Диплом по специальности на выбор
    telegra.ph/kupit-diplom-oficialnyj-08-13-6

  21. Darrelherse表示:

    slot siteleri guvenilir: en yeni slot siteleri – en guvenilir slot siteleri

  22. Frankguara表示:

    The man turning jet planes into cool houses
    [url=https://kompromatwiki.org/wiki/%D0%A0%D0%BE%D0%BC%D0%B0%D0%BD_%D0%92%D0%B8%D0%BA%D1%82%D0%BE%D1%80%D0%BE%D0%B2%D0%B8%D1%87_%D0%92%D0%B0%D1%81%D0%B8%D0%BB%D0%B5%D0%BD%D0%BA%D0%BE]раз анальный секс[/url]
    Wasilla, south central Alaska. Home to bears, lakes, mountains and a flight school that’s fast becoming a private aviation wonderland.

    At FLY8MA Pilot Lodge, you can opt for a scenic flight tour with glacier views, take the controls for a flying lesson, or go all in and get your pilot training.

    When night falls over the broad vistas of the US state they call the Last Frontier, you can then climb the steps to two unique accommodation experiences: a converted McDonnell Douglas DC-6 airplane and the newest arrival, a McDonnell Douglas DC-9 – still with its DHL livery.

    The fast-developing site is an ongoing project by FLY8MA founder Jon Kotwicki, who previously owned a flight school in Florida, before working as a commercial pilot and eventually ending up in Alaska.

    Flying for the airlines “pays good money and everything, but it’s a very boring job,” he says. “Driving Uber is more interesting because you could talk to your passengers.”

    Having fallen in love with the south central region on a vacation spent hiking, fishing and spotting bears and grizzlies, he chose it as a spot where he and his team – and his trusty Pomeranian dog Foxtrot – could “buy a lot of property and perhaps develop our own airport and run our own show.”

  23. Mazridh表示:

    Здравствуйте!
    Приобретение диплома ПТУ с сокращенной программой обучения в Москве
    batiklinda.ru/index.php?productID=406

  24. Richardsudge表示:

    The man turning jet planes into cool houses
    [url=https://stoppiramida.ru/news/2172/]русское порно жесток[/url]
    Wasilla, south central Alaska. Home to bears, lakes, mountains and a flight school that’s fast becoming a private aviation wonderland.

    At FLY8MA Pilot Lodge, you can opt for a scenic flight tour with glacier views, take the controls for a flying lesson, or go all in and get your pilot training.

    When night falls over the broad vistas of the US state they call the Last Frontier, you can then climb the steps to two unique accommodation experiences: a converted McDonnell Douglas DC-6 airplane and the newest arrival, a McDonnell Douglas DC-9 – still with its DHL livery.

    The fast-developing site is an ongoing project by FLY8MA founder Jon Kotwicki, who previously owned a flight school in Florida, before working as a commercial pilot and eventually ending up in Alaska.

    Flying for the airlines “pays good money and everything, but it’s a very boring job,” he says. “Driving Uber is more interesting because you could talk to your passengers.”

    Having fallen in love with the south central region on a vacation spent hiking, fishing and spotting bears and grizzlies, he chose it as a spot where he and his team – and his trusty Pomeranian dog Foxtrot – could “buy a lot of property and perhaps develop our own airport and run our own show.”

  25. Lazroal表示:

    Привет!
    Мы изготавливаем дипломы любой профессии по доступным тарифам.
    forum.resmihat.kz/viewtopic.php?t=1770593

  26. Next time I read a blog, I hope that it won’t fail me as much as this particular one. After all, Yes, it was my choice to read, nonetheless I actually thought you would probably have something useful to say. All I hear is a bunch of whining about something that you could possibly fix if you weren’t too busy seeking attention.

發佈留言

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