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

23,537 Responses

  1. Hello there! I could have sworn I’ve been to this
    web site before but after looking at many of the posts I realized it’s new to
    me. Anyhow, I’m definitely happy I came across it and I’ll be bookmarking it and checking back regularly! http://pspskorea.com/bbs/board.php?bo_table=free&wr_id=395083

  2. Hey there! I know this is kinda off topic but I’d figured I’d
    ask. Would you be interested in trading links or maybe guest authoring a blog article or vice-versa?
    My website addresses a lot of the same subjects as yours and I believe we could greatly benefit from each other.
    If you’re interested feel free to send me an email.
    I look forward to hearing from you! Wonderful blog by the way! https://Bio.rogstecnologia.com.br/fredafrith6

  3. SamuelBix表示:

    buy cipro online usa: CiPharmDelivery – buy cipro without rx

  4. KennethPah表示:

    buy cipro online usa ci pharm delivery buy cipro online canada

  5. DanielAbice表示:

    http://prednibest.com/# prednisone 5mg daily

  6. RobertJar表示:

    20mg prednisone: PredniBest – prednisone 30

  7. Попробуйте аркадные игры и выиграйте
    arkada отзывы [url=https://t.me/s/arkada_casino_online/]аркада регистрация[/url] .

  8. hello!,I really like your writing so so much!

    share we be in contact more approximately your article on AOL?
    I require a specialist on this space to unravel my problem.
    May be that is you! Having a look forward to see you. https://utahsyardsale.com/author/juliusfmx01/

  9. I visited multiple blogs but the audio feature for audio songs
    current at this website is truly wonderful. http://Shop-Lengorgaz.Tmweb.ru/community/profile/mohammedmcphers/

  10. вывод из запоя на дому краснодар круглосуточно вывод из запоя на дому краснодар круглосуточно .

  11. RobertJar表示:

    where can i buy cheap clomid no prescription: how to get generic clomid price – can i buy clomid online

  12. Margarito表示:

    With havin so much written content do you ever run into any problems of plagorism or copyright infringement?
    My site has a lot of completely unique content I’ve either created myself or outsourced but it appears
    a lot of it is popping it up all over the web without my agreement.
    Do you know any methods to help protect against content from being stolen?
    I’d genuinely appreciate it. https://palmer-electrical.com/question/discover-the-benefits-of-canadian-saunas-3/

  13. It is the best time to make some plans for the long run and it is
    time to be happy. I have learn this post and if I could I wish to suggest you
    few interesting issues or advice. Perhaps you could write subsequent articles referring
    to this article. I want to read more issues
    approximately it! http://shop-lengorgaz.tmweb.ru/community/profile/clevelandwolfgr/

  14. Предлагаем услуги профессиональных инженеров офицальной мастерской.
    Еслли вы искали ремонт стиральных машин smeg в москве, можете посмотреть на сайте: ремонт стиральных машин smeg в москве
    Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!

  15. Предлагаем услуги профессиональных инженеров офицальной мастерской.
    Еслли вы искали срочный ремонт стиральных машин smeg, можете посмотреть на сайте: ремонт стиральных машин smeg рядом
    Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!

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

  17. KennethPah表示:

    prednisone 4mg Predni Best buy prednisone online without a script

  18. DanielAbice表示:

    https://cipharmdelivery.com/# ciprofloxacin order online

發佈留言

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