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

  1. JasonBib表示:

    Discover Bangladesh’s most trusted online gaming destinations through BDCasinoRatings.online – your premier guide to licensed platforms offering seamless Bkash/Nagad transactions and localized Bangla support. Our expert-curated rankings highlight casinos with fast Taka payouts, exciting Cricket betting options, and generous welcome bonuses tailored for Bangladeshi players. Stay informed with real-time updates on safety standards and exclusive promotions across South Asia’s fastest-growing iGaming market. https://bdcasinoratings.online/

  2. Kimberly表示:

    Thanks for ones marvelous posting! I truly enjoyed reading it, you may
    be a great author. I will make certain to bookmark your blog and will
    eventually come back sometime soon. I want to encourage you to definitely continue your great posts,
    have a nice day! http://maysonplasters.com/__media__/js/netsoltrademark.php?d=thankyou.eoapps.co.kr%2Fbbs%2Fboard.php%3Fbo_table%3Dfree%26wr_id%3D2312852

  3. Curtismence表示:

    http://alo789.auction/# alo 789 dang nh?p

  4. Josephsip表示:

    alo 789: alo789 – alo789in

  5. Greetings! Very useful advice in this particular post! It is the little changes that produce the most important changes. Thanks for sharing!

  6. Stevenkated表示:

    http://alo789.auction/# alo789hk

  7. weblink表示:

    One thing I want to say is the fact that car insurance cancellation is a feared experience and if you’re doing the correct things like a driver you simply will not get one. A lot of people do have the notice that they’ve been officially dropped by their insurance company and several have to fight to get further insurance from a cancellation. Cheap auto insurance rates are frequently hard to get from a cancellation. Knowing the main reasons concerning the auto insurance cancelling can help owners prevent completely losing in one of the most important privileges available. Thanks for the concepts shared by means of your blog.

  8. Adolph表示:

    naturally like your web site however you need to
    test the spelling on quite a few of your posts.
    Several of them are rife with spelling problems and I to find it very troublesome to
    inform the reality then again I will surely come again again. http://new.Jesusaction.org/bbs/board.php?bo_table=free&wr_id=6083922

  9. Curtismence表示:

    http://88betviet.pro/# 88bet slot

  10. Josephsip表示:

    alo789: alo789hk – alo789

  11. сейф表示:

    Тут можно преобрести модели сейфов сейфы москва

  12. Curtismence表示:

    http://k8viet.guru/# nha cai k8

  13. Josephsip表示:

    k8 th? dam: k8 th? dam – nha cai k8

  14. Whats up! I just wish to give a huge thumbs up for the good info you’ve gotten right here on this post. I will be coming back to your blog for more soon.

  15. Stevenkated表示:

    https://k8viet.guru/# link vao k8

  16. Thanks , I’ve just been searching for information about this topic for a long time
    and yours is the greatest I’ve came upon till now. But, what concerning the conclusion?
    Are you certain concerning the supply? http://Dailydecks.com/__media__/js/netsoltrademark.php?d=tangguifang.dreamhosters.com%2Fcomment%2Fhtml%2F%3F1219160.html

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

  18. Josephsip表示:

    k8 bet: k8 – k8 th? dam

  19. Do you mind if I quote a few of your posts as
    long as I provide credit and sources back to your weblog?
    My website is in the very same area of interest as yours and
    my visitors would truly benefit from a lot of the information you provide here.

    Please let me know if this okay with you. Appreciate it! http://Sunchemical-Solutions.net/__media__/js/netsoltrademark.php?d=CL-System.jp%2Fquestion%2Funderstanding-the-basics-of-a-loan-for-bad-credit-no-credit-check-and-personal-loan-options-41%2F

  20. Rubengax表示:

    link vao k8 k8 bet k8

  21. I believe this is among the so much significant info for me.
    And i’m happy reading your article. But wanna remark on few
    common things, The web site taste is ideal, the articles is really excellent : D.
    Just right process, cheers https://365.expresso.blog/question/frequence-de-publication-trouver-le-bon-equilibre-pour-vos-reseaux-sociaux-31/

  22. JamesJap表示:

    Устал сливать в казино? Перестань играть без разбора! Присоединяйся на Наш Telegram канал “Рейтинг Казино”! ??

    Забудь о проигранных средствах и разочарованиях! Наш Telegram-канал “Рейтинг Казино” станет твоим лучшим проводником в мире азартных игр!

    Что именно тебя поджидает в канале:

    Независимые анализы игровых платформ: Мы изучаем все – от разрешения и доброго имени до премий и быстроты переводов. Никаких продвижения, исключительно открытая сведения!
    Свежие списки: Выясни, какие именно казино действительно выплачивают деньги и предлагают самые выгодные условия для клиентов!
    Особенные бонусы и промокоды: Получай наиболее прибыльные варианты от заслуживающих доверия заведений!
    Последние новости из мира ставок: Будь в теме новых фактов и тенденций!
    Рекомендации и тактики от опытных игроков: Повысь свои вероятность на выигрыш и играй с рассудительностью!

    Перестань рассчитывать на удачу! Пора ставить разумно!

    Подписывайся на “Канал “Рейтинг Казино”” сейчас же и преврати игру в прибыль!

    https://vk.com/reyting_top_casino

  23. Rubengax表示:

    k8vip k8 th? dam k8 th? dam

  24. Stevenkated表示:

    https://88betviet.pro/# 188bet 88bet

發佈留言

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