This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
縮圖: | |
http://i.ytimg.com/vi/VIDEO_ID/0.jpg (medium sized image) | |
http://i.ytimg.com/vi/VIDEO_ID/1.jpg (Thumbnail) | |
http://i.ytimg.com/vi/VIDEO_ID/2.jpg (Thumbnail) | |
http://i.ytimg.com/vi/VIDEO_ID/3.jpg (Thumbnail) | |
http://i.ytimg.com/vi/VIDEO_ID/maxresdefault.jpg (Maximum resolution) | |
影片: | |
http://www.youtube.com/v/VIDEO_ID?version=3&rel=0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pages | |
{ | |
import flash.display.Loader; | |
import flash.display.Sprite; | |
import flash.events.Event; | |
import flash.net.URLRequest; | |
import flash.system.Security; | |
public class YoutubeClip extends Sprite | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pages | |
{ | |
import com.greensock.events.LoaderEvent; | |
import com.greensock.layout.ScaleMode; | |
import com.greensock.loading.data.VideoLoaderVars; | |
import com.greensock.loading.VideoLoader; | |
import com.robertpataki.heartcode.ProgressIndicator; | |
import flash.display.Loader; | |
import flash.display.MovieClip; | |
import flash.display.Sprite; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
http://gskinner.com/RegExr/?2tsac | |
Author: Roberto Rama | |
*/ | |
var pattern:RegExp = /(?<=v(\=|\/))([-a-zA-Z0-9_]+)|(?<=youtu\.be\/)([-a-zA-Z0-9_]+)/gm; | |
var result:Object = pattern.exec("http://www.youtube.com/watch?v=9bZkp7q19f0"); | |
trace(result); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 驗證 Youtube ******************************************************************* | |
private function validateHaveVideoID(str:String):String | |
{ | |
var pattern:RegExp = /(?<=v(\=|\/))([-a-zA-Z0-9_]+)|(?<=youtu\.be\/)([-a-zA-Z0-9_]+)/gm; | |
var result:Object = pattern.exec(str); | |
//trace(result); | |
if (result) { | |
return result[0]; | |
}else { | |
return null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<title></title> | |
<style type="text/css"> | |
html, body { height:100%; } | |
body { margin:0; padding:0; overflow:hidden; text-align:left; background-color: #222; } | |
object:focus { outline:none; } | |
#container { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//http://www.murtensaerbi.be/blog/index.php/2008/08/11/skinning-a-combobox-component-in-actionscript-3/ | |
// create a new textformat and set the style of it | |
var myFormat : TextFormat = new TextFormat(); | |
myFormat.font = "Cooper Std Black"; | |
myFormat.color = 0xffffff; | |
myFormat.size = 13; | |
myFormat.indent = 4; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override protected function init():void | |
{ | |
// 0ms, 表示一定會看到 Preload,至少會閃一下 | |
// 若首頁一定要看到 loading 可以這樣做 | |
// 之後要設回 150ms | |
Gaia.api.setPreloaderDelay(0); | |
initComplete(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript | |
function getParameterByName(name) { | |
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); | |
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), | |
results = regex.exec(location.search); | |
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); | |
} | |
var prodId = getParameterByName('prodId'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://bassta.bg/2013/05/smooth-page-scrolling-with-tweenmax/ | |
$(function(){ | |
var $window = $(window); | |
var scrollTime = 1.2; | |
var scrollDistance = 170; | |
$window.on("mousewheel DOMMouseScroll", function(event){ |