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

  1. ColinDouro表示:

    Pin Up Casino https://pin-up.noko39.ru Registration and Login to the Official Pin Up Website. thousands of slot machines, online tables and other branded entertainment from Pin Up casino. Come play and get big bonuses from the Pinup brand today

  2. GeorgeTab表示:

    Pin-up Casino https://pin-up.admsov.ru/ is an online casino licensed and regulated by the government of Curacao . Founded in 2016, it is home to some of the industry’s leading providers, including NetEnt, Microgaming, Play’n GO and others. This means that you will be spoiled for choice when it comes to choosing a game.

  3. MatthewSkamp表示:

    1xbet https://1xbet.best-casino-ar.com with withdrawal without commission. Register online in a few clicks. A large selection of slot machines in mobile applications and convenient transfers in just a few minutes.

  4. BrucePed表示:

    Latest news about games for Android https://android-games.com.az, reviews and daily updates. Read now and get the latest information on the most exciting games

  5. Jaredshign表示:

    Веб-студия SUHOV-IT ru в течение Столице – сопряженный интернет-маркетинг “унтер электроключ” и разработка сайтов и приложений
    https://suhov-it.ru/

  6. BarryHop表示:

    Latest news and analytics of the Premier League https://premier-league.com.az. Detailed descriptions of matches, team statistics and the most interesting football events. EPL Azerbaijan is the best place for football fans.

  7. RaphaelShofe表示:

    The most popular sports site https://sports.com.az of Azerbaijan, where the latest sports news, forecasts and analysis are collected.

  8. Leroyral表示:

    Check out the latest news, guides and in-depth reviews of the available options for playing Minecraft Az https://minecraft.com.az. Find the latest information about Minecraft Download, Pocket Edition and Bedrock Edition.

  9. Ismaelfer表示:

    Hello, I desire to subscribe for this blog to obtain newest updates, thus where can i do it please help out.
    сигнализация Pandora на Атлас

  10. HarrySouts表示:

    Play PUBG Mobile https://pubg-mobile.com.az an exciting world of high-quality mobile battle royale. Unique maps, strategies and intense combat await you in this exciting mobile version of the popular game.

  11. JordanRag表示:

    https://santekhnik-moskva.blogspot.com — вызов сантехника на дом в Москве и Московской области в удобное для вас время.

  12. DesmondTug表示:

    Каталог рейтингов хостингов https://pro-hosting.tech на любой вкус и под любые, даже самые сложные, задачи.

  13. JamesMer表示:

    The latest top football news https://futbol.com.az today. Interviews with football players, online broadcasts and match results, analytics and football forecasts, photos and videos.

  14. HectorHutty表示:

    Latest news and details about the NBA in Azerbaijan https://nba.com.az. Hot events, player transfers and the most interesting events. Explore the world of the NBA with us.

  15. Lewisslund表示:

    Hello there! Do you know if they make any plugins to protect against hackers? I’m kinda paranoid about losing everything I’ve worked hard on. Any recommendations?

    Лучшее казино

  16. Timothyvot表示:

    NHL (National Hockey League) News https://nhl.com.az the latest and greatest NHL news for today. Sports news – latest NHL news, standings, match results, online broadcasts.

  17. Jeremybum表示:

    UFC in Azerbaijan https://ufc.com.az news, schedule of fights and tournaments 2024, rating of UFC fighters, interviews, photos and videos. Live broadcasts and broadcasts of tournaments, statistics.

  18. Eddiesaw表示:

    The main sports news of Azerbaijan https://idman.com.az. Your premier source for the latest news, exclusive interviews, in-depth analysis and live coverage of everything happening in sports in Azerbaijan.

  19. VincentFaf表示:

    World of Games https://onlayn-oyunlar.com.az provides the latest news about online games, game reviews, gameplay and ideas, game tactics and tips. The most popular and spectacular

  20. JasonflunD表示:

    Sports in Azerbaijan https://idman-xeberleri.com.az development and popular sports Azerbaijan is a country with rich sports traditions and outstanding achievements on the international stage.

  21. Jimmyzople表示:

    Pin up entry to the official website. Play online casino Pin Up https://pin-up.prostoprosport.ru for real money. Register on the Pin Up Casino website and claim bonuses!

  22. Brianjew表示:

    Slot machines on the official website and mirrors of the Pin Up online casino https://pin-up.tr-kazakhstan.kz are available for free mode, and after registering at Pin Up Casino Ru you can play for money.

  23. Harveyrog表示:

    Pin Up casino https://pin-up.salexy.kz official website, Pin Up slot machines play for money online, Pin Up mirror working for today.

  24. EugeneDob表示:

    Качественная и недорогая https://mebelvam-nn.ru/catalog/mebel_dlya_detskoy_komnaty/ лучшие цены, доставка и сборка.

  25. RichardUteta表示:

    Большой выбор игровых автоматов, рабочее зеркало сайта https://fartunaplay.ru играть на реальные деньги онлайн

  26. Josephdit表示:

    регистрация Dragon Money Casino https://trucktir.ru

  27. This is my first time pay a visit at here and i am really
    pleassant to read all at one place. https://njkkot.org/video/832002

  28. EugeneDob表示:

    Качественная и недорогая https://mebelvam-nn.ru лучшие цены, доставка и сборка.

  29. RichardUteta表示:

    Большой выбор игровых автоматов, рабочее зеркало сайта https://fartunaplay.ru/slot-machines играть на реальные деньги онлайн

發佈留言

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