Frame 1
movie = player.movie;
movie.base_url = "/";
movie.tracker_cls = logic.PlayerTracker;
movie.setMovie(video_id, iurl, undefined, l, t);
if (_root.infringe) {
movie.setInfringeMute();
movie.Mute();
}
if (!iurl) {
movie.playMovie();
}
Stage.scaleMode = "noScale";
Stage.addListener(this);
onResize = function () {
player.resize(Stage.width, Stage.height);
};
movie.onEndMovie = function () {
if (_root.playnext) {
getURL ("javascript:gotoNext()");
delete _root.playnext;
return(true);
}
};
var show_fs = _root.fs;
player.controller.showFSButtons(show_fs);
max = player.controller.max;
min = player.controller.min;
if (show_fs || (_root.rs)) {
onEnterFrame = function () {
onResize();
delete this.onEnterFrame;
};
}
min.onRelease = function () {
getURL ("javascript:closeFull()");
};
max.onRelease = function () {
getURL ("javascript:openFull()");
movie.stopAll();
};
if (_root.sn) {
movie.supress_next = true;
}
Symbol 12 MovieClip [SoundController] Frame 1
#initclip 23
Object.registerClass("SoundController", logic.SoundController);
#endinitclip
Symbol 62 MovieClip Frame 1
stop();
normal = function () {
gotoAndStop (1);
};
highLight = function () {
gotoAndStop (2);
};
Symbol 79 MovieClip [ControlBlock] Frame 1
#initclip 16
Object.registerClass("ControlBlock", logic.MovieController);
#endinitclip
sound_control.movie = movie;
fullBar = full_progress_bar.fullBar;
seekBar = full_progress_bar.seekBar;
progressBar = full_progress_bar.progressBar;
seek_time = timer.seek_time;
seek_total_time = timer.seek_total_time;
Symbol 88 MovieClip Frame 1
setStars = function (v) {
this.value = v;
bg._xscale = (v * 100) / 5;
};
Symbol 90 MovieClip [overlay_screen] Frame 1
#initclip 17
Object.registerClass("overlay_screen", logic.Overlay);
#endinitclip
Symbol 98 MovieClip [NextVideoPanel] Frame 1
#initclip 18
Object.registerClass("NextVideoPanel", logic.NextVideoPanel);
#endinitclip
Symbol 102 MovieClip [progressCircle] Frame 1
#initclip 19
Object.registerClass("progressCircle", logic.progressCircle);
#endinitclip
Symbol 126 MovieClip [endScreen] Frame 1
#initclip 20
Object.registerClass("endScreen", logic.EndScreen);
#endinitclip
Symbol 134 MovieClip [OverLay] Frame 1
#initclip 21
Object.registerClass("OverLay", logic.Overlay);
#endinitclip
Symbol 136 MovieClip [fullDisplay] Frame 1
#initclip 22
Object.registerClass("fullDisplay", logic.Movie);
#endinitclip
Symbol 137 MovieClip Frame 1
controller.registerMovie(movie);
movie.useHandCursor = false;
resize = function (w, h) {
controller._y = (h / 2) - controller._height;
controller.resize_width(w);
movie.resize(w, h - controller._height);
};
Symbol 138 MovieClip [__Packages.logic.PlayerTracker] Frame 0
class logic.PlayerTracker
{
var movie, track_point, track_tk, google_tracker;
function PlayerTracker (_m) {
movie = _m;
track_point = 0;
track_tk = _root.tk;
google_tracker = new logic.VideoStats("http://video.google.com/s", "yt", _root.sourceid, _root.q, _root.sk);
var o = _m;
google_tracker.getMediaTime = function () {
return(o.getTime());
};
google_tracker.getMediaDuration = function () {
return(o.getTotalTime());
};
google_tracker.getBytesDownloaded = function () {
var _local1 = o.ns.bytesLoaded;
if (isNaN(_local1)) {
return(0);
}
return(_local1);
};
}
function doSetTrack(time, percentage) {
}
function doTrack(time, percentage) {
if (movie.getTotalTime() && (!google_tracker.__get__playbackStarted())) {
google_tracker.startPlayback(movie.video_id, _root.sw);
}
if (isNaN(percentage) || (!track_tk)) {
return(undefined);
}
if ((track_point < 1) && (time >= 0)) {
sendTrack(time, percentage);
track_point = 1;
} else if ((track_point < 2) && (time >= 20)) {
sendTrack(time, percentage);
track_point = 2;
} else if ((track_point < 3) && (time >= 30)) {
sendTrack(time, percentage);
track_point = 3;
} else if ((track_point < 4) && (percentage >= 0.9)) {
sendTrack(time, percentage);
track_point = 4;
}
}
function doEndMovieTrack() {
google_tracker.sendReport();
}
function endTrack() {
google_tracker.endPlayback();
}
function sendTrack(time, percentage) {
var _local2 = new logic.urlRestXML(movie.base_url);
_local2.dispatch(this, undefined, undefined, "tracker", {w:1, tp:time, p:percentage, i:track_tk});
}
}
Symbol 139 MovieClip [__Packages.logic.VideoStats] Frame 0
class logic.VideoStats
{
var urlBase_, namespace_, visitorId_, sourceId_, query_, playbackStarted_, startTimes_, endTimes_, sendSegments_, eventReporter_, startDownloadTime_, startBytes_, getBytesDownloaded, endDownloadTime_, lastBytes_, numSegments_, numSegmentsSent_, startTime_, lastMediaTime_, getMediaTime, lastRealTime_, segmentStart_, sendInterval_, sentInitialPing_, mediaInterval_, count_, nextCount_, getMediaDuration;
function VideoStats (urlBase, namespace, sourceId, query, visitorId) {
urlBase_ = urlBase;
namespace_ = namespace;
visitorId_ = visitorId;
sourceId_ = sourceId;
query_ = query;
playbackStarted_ = false;
startTimes_ = new Array();
endTimes_ = new Array();
sendSegments_ = false;
}
function startPlayback(docid, sw) {
if (playbackStarted_) {
endPlayback();
}
playbackStarted_ = true;
eventReporter_ = new logic.EventReporter(urlBase_);
if ((namespace_ != undefined) && (namespace_ != "")) {
eventReporter_.addGlobalParameters({ns:namespace_});
}
if ((sourceId_ != undefined) && (sourceId_ != "")) {
eventReporter_.addGlobalParameters({sourceid:escape(sourceId_)});
}
if ((query_ != undefined) && (query_ != "")) {
eventReporter_.addGlobalParameters({q:escape(query_)});
}
if ((visitorId_ != undefined) && (visitorId_ != "")) {
eventReporter_.addGlobalParameters({vid:visitorId_});
}
eventReporter_.addGlobalParameters({docid:docid});
if (sw != undefined) {
eventReporter_.addGlobalParameters({sw:sw});
sendSegments_ = true;
}
startDownloadTime_ = getTimer();
startBytes_ = getBytesDownloaded();
endDownloadTime_ = startDownloadTime_;
lastBytes_ = startBytes_;
numSegments_ = 0;
numSegmentsSent_ = 0;
startTime_ = startDownloadTime_;
lastMediaTime_ = getMediaTime();
lastRealTime_ = startTime_;
segmentStart_ = lastMediaTime_;
sendInterval_ = null;
sentInitialPing_ = false;
mediaInterval_ = setInterval(this, "mediaUpdate", 100);
}
function endPlayback() {
if (playbackStarted_) {
playbackStarted_ = false;
if (mediaInterval_ != null) {
clearInterval(mediaInterval_);
}
if (sendInterval_ != null) {
clearInterval(sendInterval_);
}
sendSegments();
delete eventReporter_;
}
}
function get playbackStarted() {
return(playbackStarted_);
}
function sendReport() {
addSegment();
sendSegments();
}
function onInterval() {
count_--;
if (count_ == 0) {
count_ = nextCount_;
if (nextCount_ < 4) {
nextCount_ = nextCount_ * 2;
}
sendReport();
}
}
function mediaUpdate() {
var _local4 = getBytesDownloaded();
var _local2 = getMediaTime();
var _local3 = getTimer();
if ((!sentInitialPing_) && (_local2 > 0)) {
sentInitialPing_ = true;
eventReporter_.send({st:_local2, et:_local2, len:getMediaDuration(), rt:(_local3 - startTime_) / 1000, fv:escape(System.capabilities.version)});
count_ = 1;
nextCount_ = 2;
sendInterval_ = setInterval(this, "onInterval", 10000);
}
if ((startBytes_ == 0) || (_local4 < lastBytes_)) {
startDownloadTime_ = _local3;
endDownloadTime_ = _local3;
startBytes_ = _local4;
} else {
var _local7 = _local4 - lastBytes_;
if (_local7 > 0) {
endDownloadTime_ = _local3;
}
}
lastBytes_ = _local4;
var _local5 = _local2 - lastMediaTime_;
if (_local5 != 0) {
var _local6 = _local3 - lastRealTime_;
if ((_local5 < 0) || (_local5 > (_local6 + 200))) {
addSegment();
segmentStart_ = _local2;
}
lastRealTime_ = _local3;
}
lastMediaTime_ = _local2;
}
function addSegment() {
if (numSegmentsSent_ > MAX_REQ) {
return(undefined);
}
if ((lastMediaTime_ - segmentStart_) > 3) {
startTimes_[numSegments_] = segmentStart_;
endTimes_[numSegments_] = lastMediaTime_;
numSegments_++;
segmentStart_ = lastMediaTime_;
}
}
function sendSegments() {
var _local5 = getTimer() - startTime_;
if (numSegments_ > 0) {
var _local4 = String(startTimes_[0]);
var _local3 = String(endTimes_[0]);
var _local2 = 1;
while (_local2 < numSegments_) {
_local4 = _local4 + ("," + String(startTimes_[_local2]));
_local3 = _local3 + ("," + String(endTimes_[_local2]));
_local2++;
}
if (sendSegments_) {
eventReporter_.send({st:_local4, et:_local3, len:getMediaDuration(), rt:_local5 / 1000, bc:lastBytes_, bd:lastBytes_ - startBytes_, bt:(endDownloadTime_ - startDownloadTime_) / 1000});
}
startBytes_ = getBytesDownloaded();
startDownloadTime_ = getTimer();
endDownloadTime_ = startDownloadTime_;
numSegmentsSent_++;
numSegments_ = 0;
}
}
var MAX_REQ = 400;
}
Symbol 140 MovieClip [__Packages.logic.UrlConstructor] Frame 0
class logic.UrlConstructor
{
var baseUrl_, hasParameter_;
function UrlConstructor (baseUrl) {
baseUrl_ = baseUrl;
hasParameter_ = true;
if (baseUrl_.indexOf("?") < 0) {
hasParameter_ = false;
baseUrl_ = baseUrl_ + "?";
}
}
function addGlobalParameters(args) {
baseUrl_ = makeUrl(args);
hasParameter_ = true;
}
function get url() {
return(baseUrl_);
}
function makeUrl(args) {
var _local2 = baseUrl_;
var _local3 = hasParameter_;
for (var _local5 in args) {
if (_local3) {
_local2 = _local2 + "&";
}
_local2 = _local2 + ((_local5 + "=") + args[_local5]);
_local3 = true;
}
return(_local2);
}
}
Symbol 141 MovieClip [__Packages.logic.EventReporter] Frame 0
class logic.EventReporter extends logic.UrlConstructor
{
var makeUrl;
function EventReporter (baseUrl) {
super(baseUrl);
}
function send(args) {
var _local2 = makeUrl(args);
sendUrl(_local2);
}
function sendUrl(url) {
var _local2 = new MovieClipLoader();
var _local3 = _root.createEmptyMovieClip("junkClip", 999999);
_local2.loadClip(url, _local3);
}
}
Symbol 142 MovieClip [__Packages.logic.restXML] Frame 0
class logic.restXML
{
var request_url;
function restXML (_req_url) {
request_url = _req_url;
}
function get_call_string(method) {
return("api2_rest?method=" + escape(method));
}
function dispatch(o, cb, cb_error, method, params) {
var _local7 = new XML();
var _local8 = new XML();
_local8.ignoreWhite = false;
_local7.ignoreWhite = true;
if (_root.auth_code != undefined) {
_local8.addRequestHeader("Authorization", _root.auth_code);
}
var _local3 = get_call_string(method);
for (var _local5 in params) {
if (_local3.indexOf("?") == -1) {
_local3 = _local3 + "?";
} else {
_local3 = _local3 + "&";
}
_local3 = _local3 + (_local5 + "=");
_local3 = _local3 + escape(params[_local5]);
}
var _local9 = request_url + _local3;
var pr = this;
_local7.onLoad = function (success) {
if (success) {
var _local2 = pr.process(this);
if (_local2.error) {
cb_error.call(o, _local2.data);
} else {
cb.call(o, _local2.data);
}
} else {
cb_error.call(o);
}
};
_local8.sendAndLoad(_local9, _local7);
}
function process(xml_rsp) {
var _local1 = {};
var _local2 = get_sub_node("ut_response", xml_rsp);
if (_local2.attributes.status == "ok") {
_local1.data = get_dict(_local2);
} else if (_local2.attributes.status == "fail") {
var _local3 = get_dict(_local2);
_local1.data = get_dict(_local3.error);
_local1.error = true;
} else {
_local1.error = true;
}
return(_local1);
}
static function get_dict(node) {
if (!node) {
return(undefined);
}
var _local5 = new Object();
var _local2 = 0;
while (_local2 < node.childNodes.length) {
var _local1 = node.childNodes[_local2];
if (_local1.nodeType == 1) {
var _local3 = _local1.childNodes[0];
if (_local3.nodeType == 3) {
_local5[_local1.nodeName] = strip_white_space(_local3.nodeValue);
} else {
_local5[_local1.nodeName] = _local1;
}
}
_local2++;
}
return(_local5);
}
static function get_sub_array(name, node) {
if (!node) {
return(undefined);
}
var _local4 = [];
var _local1 = 0;
while (_local1 < node.childNodes.length) {
var _local2 = node.childNodes[_local1];
if (_local2.nodeName == name) {
_local4.push(_local2);
}
_local1++;
}
return(_local4);
}
static function get_sub_node(name, node) {
var _local2 = node.childNodes;
for (var _local4 in _local2) {
node = _local2[_local4];
if ((node.nodeType == 1) and (node.nodeName == name)) {
return(node);
}
}
}
static function get_sub_text(name, node) {
node = get_sub_node(name, node);
var _local2 = node.childNodes;
for (var _local3 in _local2) {
node = _local2[_local3];
if (node.nodeType == 3) {
return(strip_white_space(node.nodeValue));
}
}
}
static function add_text_node(name, value, node) {
var _local2 = new XML();
var _local1 = _local2.createElement(name);
_local1.appendChild(_local2.createTextNode(value));
node.appendChild(_local1);
}
static function is_whitespace(c) {
return(((c == " ") || (c == newline)) || (c == "\t"));
}
static function strip_white_space(buffer) {
var _local4 = 0;
var _local3 = buffer.length - 1;
var _local1 = 0;
while (_local1 < buffer.length) {
if ((_local4 == _local1) && (is_whitespace(buffer.charAt(_local4)))) {
_local4++;
}
if ((_local3 == (buffer.length - (_local1 + 1))) && (is_whitespace(buffer.charAt(_local3)))) {
_local3--;
}
if ((_local4 == (_local1 + 1)) || (_local3 == (buffer.length - (_local1 + 2)))) {
} else {
break;
}
_local1++;
}
return(buffer.slice(_local4, _local3 + 1));
}
}
Symbol 143 MovieClip [__Packages.logic.urlRestXML] Frame 0
class logic.urlRestXML extends logic.restXML
{
function urlRestXML (r) {
super(r);
}
function get_call_string(method) {
return(method);
}
}
Symbol 144 MovieClip [__Packages.logic.MovieController] Frame 0
class logic.MovieController extends MovieClip
{
var pause_button, play_button, stop_button, slider, full_progress_bar, getBounds, left_justified_elements, ldiv, right_justified_elements, timer, mrdiv, sound_control, rdiv, regular, small, min, max, movie, right_bg, left_bg, main_bg, seek_time, seek_total_time, fullBar, seekBar, progressBar;
function MovieController () {
super();
pause_button._visible = false;
var o = this;
play_button.onRelease = function () {
o.movie.playMovie();
};
pause_button.onRelease = function () {
o.movie.pauseMovie();
};
stop_button.onRelease = function () {
o.movie.stopMovie();
};
var _local6 = function () {
o.slider_down = true;
o.slider.highLight();
this.onEnterFrame = function () {
var _local1 = o._xmouse;
if (_local1 < o.full_progress_bar._x) {
_local1 = o.full_progress_bar._x;
} else if (_local1 > (o.full_progress_bar._x + o.full_progress_bar._width)) {
_local1 = o.full_progress_bar._x + o.full_progress_bar._width;
}
o.slider._x = _local1;
o.movie.peekSeekRatio(o.getScale());
};
};
var _local7 = function () {
o.slider.normal();
o.movie.setSeekRatio(o.getScale());
o.slider_down = false;
delete this.onEnterFrame;
};
full_progress_bar.onPress = (slider.onPress = _local6);
full_progress_bar.onRelease = (full_progress_bar.onReleaseOutside = (slider.onRelease = (slider.onReleaseOutside = _local7)));
var _local3 = getBounds(this);
left_justified_elements = [play_button, pause_button, stop_button, ldiv, full_progress_bar];
for (var _local5 in left_justified_elements) {
left_justified_elements[_local5]._xstart = _local3.xMin - left_justified_elements[_local5]._x;
}
right_justified_elements = [timer, mrdiv, sound_control, rdiv, regular, small, min, max];
for (var _local5 in right_justified_elements) {
right_justified_elements[_local5]._xstart = _local3.xMax - right_justified_elements[_local5]._x;
}
full_progress_bar._xend = _local3.xMax - (full_progress_bar._width + full_progress_bar._x);
}
function registerMovie(m) {
movie = m;
sound_control.registerMovie(m);
var o = this;
m.onPauseMovie = function () {
o.showPlay();
};
var old_play_handler = m.onPlayMovie;
m.onPlayMovie = function () {
o.showPause();
old_play_handler.call(this);
};
m.onSeek = function (ir, r) {
o.showSeek(ir, r);
};
m.onProgress = function (ir, r) {
o.showProgress(ir, r);
};
}
function getScale() {
var _local2 = (slider._x - full_progress_bar._x) / full_progress_bar._width;
if (_local2 < 0) {
return(0);
}
return(_local2);
}
function resize_width(w) {
main_bg._width = w - (left_bg._width + right_bg._width);
left_bg._x = -1 * (w / 2);
right_bg._x = w / 2;
for (var _local2 in left_justified_elements) {
left_justified_elements[_local2]._x = (-1 * (w / 2)) - left_justified_elements[_local2]._xstart;
}
var _local5 = full_progress_bar._x + MIN_PROGRESS_BAR_SIZE;
var _local3;
var _local2 = 0;
while (_local2 < right_justified_elements.length) {
right_justified_elements[_local2]._x = (w / 2) - right_justified_elements[_local2]._xstart;
if (right_justified_elements[_local2]._x < rdiv._x) {
if ((right_justified_elements[_local2]._x - 10) < _local5) {
right_justified_elements[_local2]._visible = false;
} else {
makeVisible(right_justified_elements[_local2]);
if (isNaN(_local3)) {
_local3 = right_justified_elements[_local2]._x;
}
}
} else {
makeVisible(right_justified_elements[_local2]);
if (isNaN(_local3)) {
_local3 = right_justified_elements[_local2]._x;
}
}
_local2++;
}
full_progress_bar._width = (_local3 - full_progress_bar._x) - 10;
}
function showPlay() {
play_button._visible = true;
pause_button._visible = false;
}
function showPause() {
play_button._visible = false;
pause_button._visible = true;
}
function format_minute_time(t) {
if (t == undefined) {
return("0:00");
}
var _local1 = String(Math.floor(t % 60));
if (_local1.length == 1) {
_local1 = "0" + _local1;
}
var _local2 = String(Math.floor(t / 60));
if (_local2.length == 1) {
_local2 = "0" + _local2;
}
return((_local2 + ":") + _local1);
}
function showSeek(ir, r) {
if (isNaN(r)) {
r = 0;
}
seek_time.text = format_minute_time(movie.getCurrentTime());
seek_total_time.text = format_minute_time(movie.getTotalTime());
seekBar._x = ir * fullBar._width;
seekBar._width = (r - ir) * fullBar._width;
if (!slider_down) {
slider._x = (r * full_progress_bar._width) + full_progress_bar._x;
}
}
function showProgress(ir, r) {
progressBar._x = ir * fullBar._width;
if (r) {
progressBar._width = (r - ir) * fullBar._width;
} else {
progressBar._width = 0;
}
}
function showFSButtons(_show) {
var o = this;
if (_show) {
permShow(min);
permHide(max);
permHide(regular);
permHide(small);
} else {
permHide(min);
permShow(max);
permHide(regular);
permShow(small);
regular.onPress = function () {
o.movie.resizeNormal();
o.permHide(o.regular);
o.permShow(o.small);
};
small.onRelease = function () {
o.movie.resizeOriginal();
o.permShow(o.regular);
o.permHide(o.small);
};
}
}
function permShow(clip) {
clip._visible = true;
clip._perm_visible = true;
}
function permHide(clip) {
clip._visible = false;
clip._perm_visible = false;
}
function makeVisible(clip) {
if (clip._perm_visible != undefined) {
clip._visible = clip._perm_visible;
} else {
clip._visible = true;
}
}
var slider_down = false;
static var MIN_PROGRESS_BAR_SIZE = 100;
}
Symbol 145 MovieClip [__Packages.logic.Overlay] Frame 0
class logic.Overlay extends MovieClip
{
var loading, _width, play_button, _alpha, bg, img, getURL, _parent, onRelease, createEmptyMovieClip;
function Overlay () {
super();
loading._visible = false;
loading._woffset = _width - loading._width;
play_button._visible = false;
}
function show_message(msg) {
loading.text = msg;
}
function show_loading() {
loading._visible = true;
play_button._visible = false;
}
function hide() {
loading._visible = false;
_alpha = 0;
}
function show() {
loading._visible = false;
_alpha = 100;
}
function resize(w, h) {
bg._width = w;
bg._height = h;
loading._width = w - loading._woffset;
if (loading._xscale > 100) {
loading._xscale = 100;
}
loading._yscale = loading._xscale;
loading._x = (-1 * loading._width) / 2;
fit_img();
}
function fit_img() {
if (img._loaded) {
img._width = bg._width;
img._height = bg._height;
img._x = (-1 * bg._width) / 2;
img._y = (-1 * bg._height) / 2;
}
}
function gotoURL() {
(getURL(_parent.movie_url, "_blank"));// not popped
}
function makePressable() {
onRelease = gotoURL;
}
function makePlayPressable() {
onRelease = function () {
(this.getURL(this._parent.movie_url, "_self"));// not popped
};
}
function makePlayMoviePressable() {
play_button._visible = true;
onRelease = function () {
this.play_button._visible = false;
this._parent.playMovie();
delete this.onRelease;
};
}
function loadClip(still_url) {
var _local2 = new Object();
var o = this;
if ((!still_url) || (still_url.indexOf("http://") != 0)) {
return(undefined);
}
_local2.onLoadInit = function (target_mc) {
target_mc._loaded = true;
o.fit_img();
};
var _local3 = new MovieClipLoader();
_local3.addListener(_local2);
createEmptyMovieClip("img", loading.getDepth() - 1);
_local3.loadClip(still_url, img);
}
}
Symbol 146 MovieClip [__Packages.logic.NextVideoPanel] Frame 0
class logic.NextVideoPanel extends MovieClip
{
var _visible, clip1, clip2, load_next, active_clip, bg, clip_bounds, server, _parent, data, clip_index, swap_clip, clip3, animate_interval_id, title_field, run_time, view_count, author, stars, loaded, paused, _alpha, getURL, clip_interval_id;
function NextVideoPanel () {
super();
_visible = false;
clip1._visible = false;
clip2._visible = false;
load_next = undefined;
active_clip = clip1;
bg._alpha = 30;
clip_bounds = clip1.getBounds(clip1._parent);
server = _parent;
}
function load(next_data) {
load_next = next_data;
}
function load_data(d) {
data = d;
if (data == undefined) {
_visible = false;
return(undefined);
}
clip_index = 1;
active_clip = (swap_clip = clip2);
logic.Util.loadImgClip(clip2, data.thumbnail_url2, this, clip_bounds);
clip1._visible = false;
clip2._visible = false;
clip3._visible = false;
clip1.loaded = false;
clip2.loaded = false;
clip3.loaded = false;
clearInterval(animate_interval_id);
animate_interval_id = undefined;
title_field.text = "";
run_time.text = "";
view_count.text = "";
author.text = "";
stars.setStars(0);
bg._alpha = 30;
loaded = false;
}
function makeActiveClip(c) {
swap_clip = c;
swap_clip._visible = true;
if (active_clip != swap_clip) {
swap_clip._alpha = 0;
} else {
swap_clip._alpha = 100;
}
}
function onClipLoaded(clip, error) {
_visible = true;
if (!error) {
makeActiveClip(clip);
clip.loaded = true;
}
if (!loaded) {
loaded = true;
animate_interval_id = setInterval(this, "animate", 25);
server.clip_loaded();
}
}
function loadNextClip() {
clip_index = (clip_index + 1) % 3;
var _local2 = this["clip" + (clip_index + 1)];
if (_local2.loaded) {
makeActiveClip(_local2);
} else {
logic.Util.loadImgClip(_local2, data["thumbnail_url" + (clip_index + 1)], this, clip_bounds);
}
}
function onEnterFrame() {
if (load_next && (!paused)) {
if ((_alpha > 0) && (data)) {
_alpha = _alpha - 10;
} else {
_alpha = 100;
_visible = false;
load_data(load_next);
load_next = undefined;
}
}
if (active_clip != swap_clip) {
if (active_clip._alpha > 0) {
active_clip._alpha = active_clip._alpha - 3;
swap_clip._alpha = 100 - active_clip._alpha;
} else {
active_clip._visible = false;
active_clip = swap_clip;
active_clip._alpha = 100;
}
}
}
function animate() {
if (title_field.text.length < data.title.length) {
title_field.text = title_field.text + data.title.charAt(title_field.text.length);
}
if (run_time.text.length < data.run_time.length) {
run_time.text = run_time.text + data.run_time.charAt(run_time.text.length);
}
if (view_count.text.length < data.view_count.length) {
view_count.text = view_count.text + data.view_count.charAt(view_count.text.length);
}
if (author.text.length < data.author.length) {
author.text = author.text + data.author.charAt(author.text.length);
}
if (stars.value < Number(data.rating)) {
stars.setStars(stars.value + 0.1);
}
}
function onRelease() {
(getURL(data.url + "&NR=1", "_self"));// not popped
}
function setTextNormal(c) {
title_field.textColor = 6724044 /* 0x6699CC */;
run_time.textColor = 10066329 /* 0x999999 */;
view_count.textColor = 6724044 /* 0x6699CC */;
author.textColor = 6724044 /* 0x6699CC */;
author.textColor = 6724044 /* 0x6699CC */;
}
function setTextHighlight() {
title_field.textColor = 10079487 /* 0x99CCFF */;
run_time.textColor = 13421772 /* 0xCCCCCC */;
view_count.textColor = 10079487 /* 0x99CCFF */;
author.textColor = 10079487 /* 0x99CCFF */;
author.textColor = 10079487 /* 0x99CCFF */;
}
function onRollOver() {
_alpha = 100;
bg._alpha = 50;
paused = true;
server.pause();
setTextHighlight();
if (swap_clip == active_clip) {
loadNextClip();
}
clip_interval_id = setInterval(this, "loadNextClip", 3000);
}
function onRollOut() {
bg._alpha = 30;
paused = false;
server.unpause();
setTextNormal();
clearInterval(clip_interval_id);
}
var MAX_LIFE = 200;
}
Symbol 147 MovieClip [__Packages.logic.Util] Frame 0
class logic.Util
{
function Util () {
}
static function alert(msg) {
getURL (("javascript:alert('" + escape(msg)) + "');");
}
static function call_js(func) {
var _local4 = "";
var _local2 = 1;
while (_local2 < arguments.length) {
var _local3 = ("'" + arguments[_local2]) + "'";
if (_local4.length) {
_local4 = _local4 + ("," + _local3);
} else {
_local4 = _local4 + _local3;
}
_local2++;
}
getURL (((("javascript:" + func) + "(") + _local4) + ");");
}
static function popUpWin(url, winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable) {
getURL ((((((((((((((((((((((((((((((((("javascript:var " + winName) + ";if (!") + winName) + "||") + winName) + ".closed){") + winName) + "=window.open('") + url) + "', '") + winName) + "', '") + "width=") + w) + ", height=") + h) + ", toolbar=") + toolbar) + ", location=") + location) + ", directories=") + directories) + ", status=") + status) + ", menubar=") + menubar) + ", scrollbars=") + scrollbars) + ", resizable=") + resizable) + "')}else{") + winName) + ".focus();};void(0);");
}
static function format_minute_time(t) {
if (t == undefined) {
return("0:00");
}
var _local1 = String(Math.floor(t % 60));
if (_local1.length == 1) {
_local1 = "0" + _local1;
}
var _local2 = String(Math.floor(t / 60));
if (_local2.length == 1) {
_local2 = "0" + _local2;
}
return((_local2 + ":") + _local1);
}
static function popUpShare(base_url, video_id) {
getURL (((base_url + "share?v=") + video_id) + "&embed=1", "_blank");
}
static function popUpSharePlayList(base_url, pl_id) {
getURL (((base_url + "share?p=") + pl_id) + "&embed=1", "_blank");
}
static function loadImgClip(clip, img_url, notifier, _b) {
var _local1 = new Object();
var b = _b;
if (!b) {
b = clip.getBounds(clip._parent);
}
var n = notifier;
var _local4 = function (target_mc, error) {
target_mc._x = b.xMin;
target_mc._y = b.yMin;
target_mc._width = b.xMax - b.xMin;
target_mc._height = b.yMax - b.yMin;
if (n) {
n.onClipLoaded(target_mc, error);
}
};
_local1.onLoadInit = _local4;
_local1.onLoadError = _local4;
var _local3 = new MovieClipLoader();
_local3.addListener(_local1);
_local3.loadClip(img_url, clip);
}
}
Symbol 148 MovieClip [__Packages.logic.progressCircle] Frame 0
class logic.progressCircle extends MovieClip
{
var radius, paused, clear, bg, beginFill, lineStyle, moveTo, lineTo, curveTo, endFill, value, notifier, onEnterFrame;
function progressCircle () {
super();
radius = 11;
paused = false;
}
function genCurvePoints(r, d, delta) {
var _local6 = Math.sin(d) * r;
var _local5 = (-1 * Math.cos(d)) * r;
var _local2 = Math.tan(d);
var _local12 = Math.sin(d - delta) * r;
var _local11 = (-1 * Math.cos(d - delta)) * r;
var _local3 = Math.tan(d - delta);
var _local4;
var _local10;
var _local9 = _local11 - (_local3 * _local12);
var _local8 = _local5 - (_local2 * _local6);
_local4 = (_local8 - _local9) / (_local3 - _local2);
if (Math.abs(_local3) < Math.abs(_local2)) {
_local10 = _local9 + (_local3 * _local4);
} else {
_local10 = _local8 + (_local2 * _local4);
}
return([_local4, _local10, _local6, _local5]);
}
function drawCircle(r, v) {
var _local4 = 1 - v;
clear();
if (bg) {
beginFill(16777215, 40);
}
lineStyle(0, 0, 0);
moveTo(0, 0);
lineTo(r * Math.sin((_local4 * Math.PI) * 2), (-r) * Math.cos((_local4 * Math.PI) * 2));
lineStyle(2, 13421772, 100);
var _local2 = 0;
while (_local2 < 8) {
if (((_local2 + 1) * 0.125) > _local4) {
var _local3;
if ((_local2 * 0.125) > _local4) {
_local3 = genCurvePoints(r, (Math.PI * (_local2 + 1)) / 4, (Math.PI/4));
} else {
_local3 = genCurvePoints(r, (Math.PI * (_local2 + 1)) / 4, Math.PI * (((_local2 + 1) / 4) - (2 * _local4)));
}
curveTo(_local3[0], _local3[1], _local3[2], _local3[3]);
}
_local2++;
}
lineStyle(0, 0, 0);
lineTo(0, 0);
if (bg) {
endFill();
}
}
function display_value(v) {
value = v;
drawCircle(radius, v);
}
function start_count_down(v, count_down_notifier) {
notifier = count_down_notifier;
display_value(v);
onEnterFrame = count_down;
}
function is_counting() {
return(onEnterFrame != undefined);
}
function end_count() {
display_value(0);
}
function count_down() {
if (paused) {
return(undefined);
}
if (value != undefined) {
if (value <= 0) {
notifier.count_down_end();
delete value;
delete onEnterFrame;
} else {
display_value(value - 0.005);
}
}
}
function reset() {
display_value(0);
delete onEnterFrame;
}
function pause() {
paused = true;
}
function unpause() {
paused = false;
}
function onRollOver() {
bg = true;
}
function onRollOut() {
bg = false;
}
function onRelease() {
end_count();
}
}
Symbol 149 MovieClip [__Packages.logic.EndScreen] Frame 0
class logic.EndScreen extends MovieClip
{
var movie, _parent, share, end_buttons, replay, prev_button, next_panel, count_down, next_visible, _visible, bg, awsome_data, awsome_videos, attachMovie, next_index;
function EndScreen () {
super();
movie = _parent;
share = end_buttons.share;
replay = end_buttons.replay;
var o = this;
replay.onPress = function () {
if (o.movie.rePlay) {
o.movie.rePlay();
} else {
o.movie.playMovie();
}
};
share.onRelease = function () {
o.movie.share();
};
prev_button.onRelease = function () {
o.load_previous_panels();
};
init();
}
function init() {
end_buttons._visible = true;
next_panel._visible = false;
count_down._visible = false;
prev_button._visible = false;
next_visible = false;
}
function show() {
if (!_visible) {
_visible = true;
init();
display_next();
}
}
function hide() {
_visible = false;
count_down.reset();
}
function resize(w, h) {
bg._width = w;
bg._height = h;
end_buttons._width = w - 20;
if (end_buttons._xscale > 100) {
end_buttons._xscale = 100;
}
end_buttons._yscale = end_buttons._xscale;
layout_next();
}
function load_for_awsome() {
var _local2 = new logic.urlRestXML(movie.base_url);
next_visible = false;
_local2.dispatch(this, parse_next, undefined, "set_awesome", {video_id:movie.video_id, w:movie.getSeekRatio(), l:movie.getTotalTime(), m:""});
}
function show_next() {
next_visible = true;
_visible = true;
end_buttons._visible = false;
var _local3 = new logic.urlRestXML(movie.base_url);
_local3.dispatch(this, parse_next, undefined, "next_awesome", {video_id:movie.video_id, w:movie.getSeekRatio(), l:movie.getTotalTime(), nc:_root.nc});
}
function parse_next(data) {
_root.status.text = "data receieved";
awsome_data = data;
if (_visible) {
display_next();
}
}
function parse_data() {
if (awsome_data) {
var _local4 = logic.restXML.get_sub_array("video", awsome_data.video_list);
awsome_videos = [];
var _local3 = 0;
while (_local3 < _local4.length) {
awsome_videos.push(logic.restXML.get_dict(_local4[_local3]));
_local3++;
}
awsome_data = undefined;
_root.status.text = "Data parsed :" + awsome_videos.length;
}
}
function display_next() {
if (!movie.supress_next) {
if (next_visible) {
end_buttons._visible = false;
}
if (awsome_data) {
parse_data();
}
layout_next();
}
}
function layout_next() {
if (!next_panel) {
return(undefined);
}
var _local7 = bg.getBounds(this);
var _local10 = _local7.yMin;
var _local9 = _local7.yMax - _local7.yMin;
var _local8 = 0;
if (end_buttons._visible == true) {
_local8 = end_buttons._height + (2 * margin);
}
var _local5 = Math.max(0, Math.min(int((_local9 - _local8) / (next_panel._height + margin)), 4));
var _local6 = _local7.yMin + ((_local9 - ((_local8 + (next_panel._height * _local5)) + (margin * Math.max(_local5 - 1, 0)))) / 2);
if (end_buttons._visible == true) {
end_buttons._y = _local6 + (end_buttons._height / 2);
_local6 = _local6 + (end_buttons._height + (2 * margin));
}
panels = [];
var _local3 = 0;
while (_local3 < _local5) {
var _local2;
if (_local3 == 0) {
_local2 = next_panel;
} else {
_local2 = attachMovie("NextVideoPanel", "next_panel" + _local3, _local3);
}
_local2._x = next_panel._x;
_local2._y = _local6 + (_local2._height / 2);
_local6 = _local6 + (_local2._height + margin);
_local2.load(get_next());
panels.push(_local2);
_local3++;
}
var _local4 = _local5;
while (_local4 < last_panels) {
if (_local4 != 0) {
this["next_panel" + _local4].removeMovieClip();
}
_local4++;
}
last_panels = _local5;
resize_next_prev_buttons(_local7);
count_down.reset();
count_down._visible = false;
prev_button._visible = false;
}
function resize_next_prev_buttons(bounds) {
count_down._x = bounds.xMax - ((margin / 2) + (count_down._width / 2));
count_down._y = bounds.yMax - ((margin / 2) + (count_down._height / 2));
prev_button._x = (bounds.xMin + (margin / 2)) + (prev_button._width / 2);
prev_button._y = bounds.yMax - ((margin / 2) + (prev_button._height / 2));
}
function get_next() {
if (isNaN(next_index)) {
next_index = 0;
} else {
next_index = (next_index + 1) % awsome_videos.length;
}
return(awsome_videos[next_index]);
}
function clip_loaded() {
var _local2 = 0;
while (_local2 < panels.length) {
if (!panels[_local2].loaded) {
return(undefined);
}
_local2++;
}
count_down._visible = true;
prev_button._visible = true;
count_down.start_count_down(1, this);
}
function count_down_end() {
var _local2 = 0;
while (_local2 < panels.length) {
panels[_local2].load(get_next());
_local2++;
}
count_down._visible = false;
prev_button._visible = false;
}
function load_previous_panels() {
if (count_down.is_counting()) {
next_index = next_index - (2 * panels.length);
if (next_index < 0) {
next_index = next_index + awsome_videos.length;
}
}
count_down.end_count();
}
function pause() {
count_down.pause();
}
function unpause() {
count_down.unpause();
}
var panels = [];
var last_panels = 0;
var margin = 11;
}
Symbol 150 MovieClip [__Packages.logic.Movie] Frame 0
class logic.Movie extends MovieClip
{
var videoDisplay, snd, createEmptyMovieClip, sound_data_so, sound_data, audio, base_url, display_ratio, end_screen, onShowMute, onShowVolume, is_playing, onPlayMovie, onPauseMovie, video_id, track_id, movie_url, movieTime, cues, load_awsome, tracker, tracker_cls, started, restart, start_time, start_bytes, stall_count, api_loaded, max_seek_ratio, overlay, loader, ns, static_share_clip, static_share, _parent, attachMovie, getNextHighestDepth, onEndMovie, onStartMovie, onSeek, is_peeking, onProgress, lastTime, stallCount, bg;
function Movie () {
super();
videoDisplay.smoothing = true;
snd = createEmptyMovieClip("snd", 0);
sound_data_so = SharedObject.getLocal("soundData", "/");
sound_data = sound_data_so.data;
audio = new Sound(snd);
if (sound_data.volume == undefined) {
sound_data.volume = 100;
}
if (sound_data.mute == undefined) {
sound_data.mute = false;
}
if (_root.BASE_YT_URL == undefined) {
base_url = "http://www.youtube.com/";
} else {
base_url = _root.BASE_YT_URL;
}
display_ratio = videoDisplay._width / videoDisplay._height;
registerLoader(new logic.MovieLoader());
end_screen._visible = false;
}
function initController() {
if (sound_data.mute) {
audio.setVolume(0);
onShowMute();
} else {
onShowVolume(sound_data.volume);
audio.setVolume(sound_data.volume);
}
if (is_playing) {
onPlayMovie();
} else {
onPauseMovie();
}
}
function setMovie(_video_id, image_url, movie_url, l, _track_id, eurl, append_vars) {
video_id = _video_id;
track_id = _track_id;
var _local2 = image_url;
if ((_local2 == undefined) && (is_embed)) {
_local2 = "http://static.youtube.com/get_still.php?video_id=" + video_id;
}
if (eurl == undefined) {
eurl = "";
}
if (append_vars == undefined) {
append_vars = "";
}
if (movie_url == undefined) {
movie_url = (((base_url + "watch?v=") + video_id) + "&eurl=") + escape(eurl);
}
this.movie_url = movie_url;
movieTime = l;
cues = undefined;
if (is_embed) {
append_vars = append_vars + ("&eurl=" + escape(eurl));
if (is_ad) {
append_vars = append_vars + "&adp=1";
}
load_awsome = false;
} else {
load_awsome = true;
}
if (tracker) {
tracker.endTrack();
delete tracker;
}
if (tracker_cls) {
tracker = new this.tracker_cls(this);
}
setSeek(0);
pauseMovie();
hideEnded();
is_playing = false;
started = false;
restart = true;
start_time = 0;
start_bytes = 0;
stall_count = 0;
api_loaded = false;
max_seek_ratio = 0;
if (_local2) {
if (is_ad) {
overlay.makePlayPressable();
} else if (is_embed) {
overlay.makePressable();
} else {
overlay.makePlayMoviePressable();
}
overlay.loadClip(_local2);
}
loader.load(base_url, video_id, track_id, append_vars);
if (!loader.started) {
overlay.show();
} else {
overlay.hide();
}
}
function registerLoader(_loader, leave_old) {
if (loader) {
if (!leave_old) {
loader.die();
}
delete ns;
delete loader;
}
loader = _loader;
loader.setMovie(this);
ns = loader.ns;
videoDisplay.attachVideo(ns);
snd.attachAudio(ns);
}
function popLoader() {
var _local2 = loader;
delete ns;
delete loader;
registerLoader(new logic.MovieLoader());
return(_local2);
}
function share() {
if (static_share_clip) {
static_share_clip.removeMovieClip();
delete static_share_clip;
} else if (static_share) {
_parent.play_button._visible = false;
attachMovie("StaticShare", "static_share_clip", getNextHighestDepth(), {share_url:movie_url});
} else {
logic.Util.popUpShare(base_url, video_id);
}
pauseMovie();
}
function endMovie() {
if (tracker) {
tracker.doTrack(getTime(), getSeekRatio());
tracker.doEndMovieTrack();
}
restart = true;
pauseMovie();
if (load_awsome) {
end_screen.load_for_awsome();
load_awsome = false;
}
if (!onEndMovie()) {
showEnded();
}
}
function showEnded() {
end_screen.show();
}
function hideEnded() {
end_screen.hide();
}
function pauseMovie() {
ns.pause(true);
is_playing = false;
onPauseMovie();
}
function stopMovie() {
restart = true;
pauseMovie();
setSeek(0);
}
function stopAll() {
is_playing = false;
loader.die();
pauseMovie();
}
function playMovie() {
if (static_share_clip) {
static_share_clip.removeMovieClip();
delete static_share_clip;
}
if (loader.started == false) {
loader.start();
overlay.show_loading();
onStartMovie();
} else {
if (restart == true) {
setSeek(0);
}
ns.pause(false);
}
hideEnded();
onPlayMovie();
is_playing = true;
restart = false;
}
function isPlaying() {
return(is_playing);
}
function getMovieInfo() {
var _local2 = new logic.restXML(base_url);
_local2.dispatch(this, parseMovieInfo, undefined, "youtube.videos.get_video_info", {video_id:video_id});
}
function parseMovieInfo(data) {
if (data.video) {
var _local2 = logic.restXML.get_dict(data.video);
var _local3 = Number(_local2.length_seconds);
if (_local3) {
movieTime = _local3;
}
if ((_local2.embed_status == "rejected") || (_local2.embed_status == "unavail")) {
overlay.show_message("This video is no longer available.");
stopAll();
} else if (_local2.embed_status == "not_allowed") {
overlay.show_message("The owner of this video does not allow video embedding please watch this video on YouTube.com");
stopAll();
}
api_loaded = true;
}
}
function Mute() {
sound_data.mute = true;
audio.setVolume(0);
onShowMute();
sound_data_so.flush();
}
function setInfringeMute() {
is_infringe_mute = true;
}
function unMute() {
if (!is_infringe_mute) {
sound_data.mute = false;
audio.setVolume(sound_data.volume);
onShowVolume(sound_data.volume);
sound_data_so.flush();
}
}
function use_master_sound(master_movie) {
sound_data = Object();
sound_data_so = undefined;
var _local2 = master_movie.sound_data;
sound_data = {mute:_local2.mute, volume:_local2.volume};
if (sound_data.mute) {
Mute();
} else {
unMute();
}
}
function toggleMute() {
if (sound_data.mute) {
unMute();
} else {
Mute();
}
}
function setVolume(v) {
if (!is_infringe_mute) {
sound_data.volume = v;
sound_data.mute = false;
audio.setVolume(sound_data.volume);
onShowVolume(sound_data.volume);
sound_data_so.flush();
}
}
function setSeekRatio(ratio) {
setSeek(ratio * movieTime);
}
function getTotalTime() {
return(movieTime);
}
function getCurrentTime() {
return(ns.time);
}
function findCue(t) {
if (cues) {
var _local2 = 0;
while (_local2 < cues.times.length) {
var _local3 = _local2 + 1;
if ((cues.times[_local2] <= t) && ((cues.times[_local3] >= t) || ((_local3 + 1) == cues.times.length))) {
return({time:cues.times[_local2], position:cues.positions[_local2]});
}
_local2++;
}
}
}
function setSeek(s) {
if (s != undefined) {
ns.seek(s - start_time);
onSeek(getStartRatio(), getSeekRatio());
if (tracker) {
tracker.doSetTrack(getTime(), getSeekRatio());
}
is_peeking = false;
ns.pause(!is_playing);
}
}
function peekSeekRatio(r) {
hideEnded();
restart = false;
is_peeking = true;
hideEnded();
ns.seek((r * movieTime) - start_time);
onSeek(getStartRatio(), getSeekRatio());
}
function getLoadRatio() {
var _local3 = ns.bytesLoaded + start_bytes;
var _local2 = ns.bytesTotal + start_bytes;
if (_local2 == 0) {
return(0);
}
if ((_local3 == _local2) && (_local3 > 1000)) {
return(1);
}
return(_local3 / _local2);
}
function getSeekRatio() {
if (restart == true) {
return(0);
}
if ((start_time + ns.time) > movieTime) {
return(1);
}
return((start_time + ns.time) / movieTime);
}
function getStartRatio() {
if (start_time == undefined) {
return(0);
}
if (start_time > movieTime) {
return(1);
}
return(start_time / movieTime);
}
function getTime() {
if (start_time == undefined) {
return(ns.time);
}
return(start_time + ns.time);
}
function onEnterFrame() {
var _local4 = getStartRatio();
var _local3 = getSeekRatio();
var _local2 = getTime();
onSeek(_local4, _local3);
onProgress(_local4, getLoadRatio());
max_seek_ratio = Math.max(max_seek_ratio, _local3);
if ((_local3 > 0.8) && (load_awsome)) {
end_screen.load_for_awsome();
load_awsome = false;
}
if (tracker) {
tracker.doTrack(_local2, _local3);
}
if (init_run) {
initController();
init_run = false;
} else if ((((ns.bytesLoaded == ns.bytesTotal) && (_local2 >= (movieTime - 1))) && (is_playing)) && (!is_peeking)) {
if (lastTime != _local2) {
lastTime = _local2;
stallCount = 0;
} else if (stallCount < 30) {
stallCount++;
} else {
endMovie();
stallCount = 0;
}
}
}
function resizeNormal() {
videoDisplay._height = overlay._height;
videoDisplay._width = overlay._width;
videoDisplay._x = videoDisplay._width / -2;
videoDisplay._y = videoDisplay._height / -2;
}
function resizeOriginal() {
videoDisplay._height = videoDisplay.height;
videoDisplay._width = videoDisplay.width;
videoDisplay._x = videoDisplay._width / -2;
videoDisplay._y = videoDisplay._height / -2;
}
function resize(w, h) {
var _local4 = w / h;
if (_local4 > display_ratio) {
w = h * display_ratio;
} else {
h = w / display_ratio;
}
videoDisplay._width = w;
videoDisplay._height = h;
videoDisplay._x = (-1 * w) / 2;
videoDisplay._y = (-1 * h) / 2;
bg._width = w;
bg._height = h;
overlay.resize(w, h);
end_screen.resize(w, h);
}
var init_run = true;
var is_embed = false;
var is_ad = false;
var is_infringe_mute = false;
}
Symbol 151 MovieClip [__Packages.logic.MovieLoader] Frame 0
class logic.MovieLoader
{
var started, nc, ns, interval_id, append_vars, file, movie, wait_time, movieTime;
function MovieLoader () {
started = false;
nc = new NetConnection();
nc.connect(null);
ns = new NetStream(nc);
ns.setBufferTime(2);
var o = this;
ns.onMetaData = function (obj) {
if (obj.duration != undefined) {
o.movieTime = obj.duration;
if (obj.keyframes) {
o.cues = {times:obj.keyframes.times, positions:obj.keyframes.filepositions};
}
} else {
o.movieTime == undefined;
o.cues = undefined;
}
};
ns.onStatus = function (object) {
if (object.code == "NetStream.Play.Stop") {
if (o.movie.is_playing) {
o.movie.endMovie();
}
} else if (object.code == "NetStream.Play.Start") {
o.started = true;
o.movie.overlay.hide();
o.movie.onDisplayMovie();
} else if (object.code == "NetStream.Buffer.Full") {
o.movie.onDisplayMovie();
if (o.movieTime && (o.movie.movieTime == undefined)) {
o.movie.movieTime = o.movieTime;
} else if ((o.movie.movieTime == undefined) && (!o.api_loaded)) {
o.movie.getMovieInfo();
}
} else if (object.code == "NetStream.Play.StreamNotFound") {
if (o.movie.is_embed && (!o.movie.api_loaded)) {
o.movie.getMovieInfo();
}
o.loadLater();
}
};
}
function loadLater(waited) {
if (interval_id) {
clearInterval(interval_id);
interval_id = undefined;
}
if (waited) {
ns.play(file + append_vars);
ns.pause(!((movie.loader == this) && (movie.is_playing)));
} else {
interval_id = setInterval(this, "loadLater", wait_time * 1000, true);
wait_time = wait_time * 5;
}
}
function load(base_url, video_id, track_id, _append_vars) {
var _local2 = (((base_url + "get_video?video_id=") + video_id) + "&t=") + track_id;
if (interval_id) {
clearInterval(interval_id);
interval_id = undefined;
}
if (_local2 != file) {
append_vars = _append_vars;
file = _local2;
movieTime = undefined;
wait_time = 5;
started = false;
}
}
function setMovie(m) {
movie = m;
}
function die() {
started = false;
ns.close();
if (interval_id) {
clearInterval(interval_id);
}
}
function preLoad() {
if (!started) {
ns.play(file + append_vars);
ns.pause(true);
}
}
function start() {
if (!started) {
ns.play(file + append_vars);
}
}
}
Symbol 152 MovieClip [__Packages.logic.SoundController] Frame 0
class logic.SoundController extends MovieClip
{
var sound_bar, knob, sound_button, movie;
function SoundController () {
super();
var o = this;
var _local4 = function () {
o.knob.highLight();
o.onEnterFrame = function () {
var _local2 = this._xmouse - o.sound_bar._x;
if (_local2 < 0) {
_local2 = 0;
} else if (_local2 > o.sound_bar._width) {
_local2 = o.sound_bar._width;
}
this.hideMute();
this.knob._x = _local2 + o.sound_bar._x;
o.movie.setVolume(o.getSoundPos(this.knob._x));
};
};
sound_bar.onPress = _local4;
knob.onPress = _local4;
var _local6 = function () {
o.knob.normal();
var _local2 = o.getSoundPos(o.knob._x);
o.movie.setVolume(_local2);
delete this._parent.onEnterFrame;
};
sound_bar.onRelease = (sound_bar.onReleaseOutside = (knob.onRelease = (knob.onReleaseOutside = _local6)));
sound_button.onRelease = function () {
o.movie.toggleMute();
};
}
function registerMovie(m) {
movie = m;
var o = this;
m.onShowMute = function () {
o.showMute();
};
m.onShowVolume = function (v) {
o.hideMute();
o.showVolume(v);
};
}
function getSoundPos(pos) {
var _local2 = Math.round(((pos - sound_bar._x) * 100) / sound_bar._width);
_local2 = Math.min(_local2, 100);
return(Math.max(_local2, 0));
}
function showMute() {
showVolume(0);
}
function hideMute() {
}
function showVolume(v) {
var _local3 = ((v * sound_bar._width) / 100) + sound_bar._x;
knob._x = _local3;
showBars(v);
}
function showBars(v) {
var _local3 = Math.round((v * num_bars) / 100);
var _local2 = 1;
while (_local2 <= num_bars) {
if (_local2 <= _local3) {
this["v" + _local2]._visible = true;
} else {
this["v" + _local2]._visible = false;
}
_local2++;
}
if (_local3 == 0) {
sound_button._alpha = 50;
} else {
sound_button._alpha = 100;
}
}
var num_bars = 4;
var volume_spacer = 5;
var vs_space = 5;
var muted = false;
}