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

22,913 Responses

  1. KennethPah表示:

    ciprofloxacin order online buy cipro antibiotics cipro

  2. Paid phone search services usually go with access to unlimited lookups, discounted background and cell phone reports, and an advanced People Search. You can use the peop search application to find old classmates, long lost relatives, or former co-workers.

  3. Admiring the time and effort you put into your website and in depth information you present.
    It’s awesome to come across a blog every once in a while that isn’t the same old
    rehashed material. Fantastic read! I’ve bookmarked your site and I’m adding your RSS
    feeds to my Google account. http://Www.Cqcici.com/comment/html/?288726.html

  4. Born right into a farming neighborhood, he was impressed to play the harmonica after watching his father, Jesse Higgs, play the instrument while singing spirituals, together with “Cryin’ Holy Unto the Lord”.

  5. Asking questions are actually nice thing if you are not understanding
    something fully, however this post gives good understanding yet. https://365.expresso.blog/question/how-do-you-commerce-in-a-automotive-that-is-not-paid-off/

  6. Colette表示:

    I don’t even know the way I stopped up here, however I believed this submit used to be good.

    I do not recognize who you’re but certainly you are going to a famous blogger if you are
    not already. Cheers! http://ic24.xn--2o2b15m1xf36o.com/bbs/board.php?bo_table=problem&wr_id=1711252

  7. This goes to prove the significance of video, whether or not you publish them on YouTube or elsewhere.

  8. Thanks , I’ve recently been searching for information about this subject for ages and yours is the greatest I’ve discovered so far. But, what about the conclusion? Are you sure about the source?

  9. нарколог на дом [url=kozaostra.mybb.ru/viewtopic.php?id=14286]нарколог на дом[/url] .

  10. Hi, i think that i saw you visited my blog so i came to “return the favor”.I
    am attempting to find things to enhance my website!I suppose its ok to use a few of your
    ideas!! http://Laneconstructioncorporation.net/__media__/js/netsoltrademark.php?d=cl-System.jp%2Fquestion%2Fintroduction-a-la-mecanique-diesel-camion-tout-ce-que-vous-devez-savoir-83%2F

  11. My wife and i were really thankful that Peter could conclude his researching from your ideas he received out of the blog. It is now and again perplexing to simply always be handing out ideas which often men and women might have been trying to sell. We figure out we have got the website owner to be grateful to because of that. The specific explanations you have made, the simple web site navigation, the friendships you will make it easier to foster – it’s got mostly fabulous, and it is leading our son and our family reason why this content is entertaining, which is certainly really important. Many thanks for everything!

  12. mi tower表示:

    Excellent post. I was checking constantly this blog and I’m impressed! Extremely useful info specially the last part I care for such information much. I was seeking this particular information for a long time. Thank you and good luck.

  13. MiguelUnind表示:

    https://cipharmdelivery.com/# buy cipro online canada

  14. Kylo Ren (Ben Solo) was a former Jedi and powerful dark aspect wielder, and the secondary antagonist of the Star Wars sequel trilogy.

  15. KennethPah表示:

    buy ciprofloxacin CiPharmDelivery buy cipro online canada

  16. DanielAbice表示:

    http://amoxstar.com/# amoxicillin 500mg cost

  17. RobertJar表示:

    order cheap clomid: clomidonpharm – where buy clomid

  18. Brandie表示:

    After I originally left a comment I seem to have
    clicked on the -Notify me when new comments are added- checkbox and now whenever a comment is added I recieve 4 emails with the same comment.
    Perhaps there is a way you are able to remove me from that service?
    Thanks! https://Vknigah.com/user/MargartCiotti/

發佈留言

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