Frame 1
YTLinkEmbed.main(this);
Symbol 20480 MovieClip [__Packages.YTLinkEmbed] Frame 0
class YTLinkEmbed
{
static var app;
var backgr, thumb, title_tf, flash_tf, button_tf;
function YTLinkEmbed (mc) {
Stage.scaleMode = "noScale";
Stage.align = "TL";
mc._x = 0;
mc._y = 0;
backgr = mc.createEmptyMovieClip("backgr", 1);
thumb = mc.createEmptyMovieClip("thumb", 2);
try {
var _local3 = flash.display.BitmapData.loadBitmap("thumb");
var _local4 = new flash.geom.ColorTransform(0.5, 0.5, 0.5, 1, 0, 0, 0, 0);
_local3.colorTransform(_local3.rectangle, _local4);
imgAspect = _local3.width / _local3.height;
thumb.attachBitmap(_local3, 3);
} catch(_local) {
var e = ( /* Error999 */
);
}
title_tf = mc.createTextField("title_tf", 4, 0, 0, 320, 100);
title_tf.textColor = 16777215 /* 0xFFFFFF */;
title_tf.text = "Watch on YouTube";
var _local5 = title_tf.getTextFormat();
_local5.size = 24;
_local5.bold = true;
_local5.font = "_sans";
title_tf.setTextFormat(_local5);
title_tf.autoSize = "left";
title_tf.selectable = false;
title_tf.filters = [new flash.filters.DropShadowFilter(0)];
flash_tf = mc.createTextField("flash_tf", 5, 0, 0, 320, 100);
flash_tf.textColor = 16777215 /* 0xFFFFFF */;
flash_tf.text = "Flash-embedded videos are no longer supported,\n" + "but you can still watch this video on YouTube.";
_local5 = flash_tf.getTextFormat();
_local5.size = 18;
_local5.align = "center";
_local5.font = "_sans";
flash_tf.setTextFormat(_local5);
flash_tf.autoSize = "left";
flash_tf.selectable = false;
flash_tf.filters = [new flash.filters.DropShadowFilter(0)];
button_tf = mc.createTextField("button_tf", 6, 0, 0, 320, 100);
button_tf.textColor = 16777215 /* 0xFFFFFF */;
button_tf.background = true;
button_tf.backgroundColor = 4293875 /* 0x4184F3 */;
button_tf.text = "\nWATCH ON YOUTUBE\n ";
_local5 = button_tf.getTextFormat();
_local5.size = 13;
_local5.bold = true;
_local5.font = "_sans";
_local5.leftMargin = 30;
_local5.rightMargin = 30;
button_tf.setTextFormat(_local5);
button_tf.autoSize = "center";
button_tf.selectable = false;
onResize();
Stage.addListener(this);
backgr.onRelease = function () {
getURL (YTLinkEmbed.targetUrl, "_blank", "GET");
};
thumb.onRelease = function () {
getURL (YTLinkEmbed.targetUrl, "_blank", "GET");
};
}
function onResize() {
var _local2 = Stage.width;
var _local3 = Stage.height;
backgr.beginFill(0);
backgr.moveTo(0, 0);
backgr.lineTo(_local2, 0);
backgr.lineTo(_local2, _local3);
backgr.lineTo(0, _local3);
backgr.lineTo(0, 0);
backgr.endFill();
var _local4 = (_local2 + (imgAspect * _local3)) / 2;
var _local5 = _local4 / imgAspect;
thumb._width = _local4;
thumb._height = _local5;
thumb._x = (_local2 - _local4) / 2;
thumb._y = (_local3 - _local5) / 2;
title_tf._x = (_local2 - title_tf._width) / 2;
title_tf._y = (_local3 * 0.5) - 80;
flash_tf._x = (_local2 - flash_tf._width) / 2;
flash_tf._y = (_local3 * 0.5) - 40;
button_tf._x = (_local2 - button_tf._width) / 2;
button_tf._y = (_local3 * 0.5) + 20;
}
static function main(mc) {
app = new YTLinkEmbed(mc);
}
//ASSetPropFlags(_local1, null, 1);
static var targetUrl = "https://www.youtube.com/watch?v=R9qu3IhNYAM";
var imgAspect = 1;
}