[Tools][Expand/Collapse All]Note that automatic extraction of ActionScript 3 is still pretty much unsupported by swfchan. AS1/AS2 works okay most of the time.Frame 1 (8 KiB) ● ●
function checkVersion() {
flashVersion = getVersion();
versionNumber = parseInt(flashVersion.substr(flashVersion.indexOf(",") - 1, 1));
if (versionNumber == 7) {
flash7 = true;
}
if (versionNumber == 6) {
flash6 = true;
}
}
function logEvent(eventName) {
var _local2 = new LoadVars();
var _local1 = new Date();
_local2.load(((((((((((((((((((((((((("http://www.veoh.com/webplayed.xml?action=" + eventName) + "&videoId=") + _level0.videoId) + "&version=") + version) + "&id=") + id) + "&inVeoh=") + inVeoh) + "&isVlog=") + isVlog) + "&flashVersion=") + flashVersion) + "&time=") + _local1.getTime()) + _local1.getMilliseconds()) + "&secondsPlayed=") + _level0.timer.current_time) + "&totalVideos=1") + "&videoSequence=1") + "&FavoriteUserName=") + user) + "&SessionID=") + guid) + "&ad=") + ad);
}
function loadVideoDetails(path, xml, mov) {
titlePath = path;
title_array = xml;
_level0.len = title_array.length - 1;
var _local3 = 0;
while (_local3 < title_array.length) {
len = title_array.length;
_level0.videoId = title_array[_local3].attributes.videoId;
m.menulabel.menulabel.text = title_array[_local3].attributes.title;
m.menu_list.menu_list = title_array[_local3].firstChild.nodeValue;
_local3++;
}
if (_root.videoAutoPlay == 1) {
m.mov = title_array[0].attributes[videoVersion];
_level0.loadVideo(title_array[0].attributes[videoVersion], 1);
} else {
if (inVeoh and (!isVlog)) {
m.mov = title_array[0].attributes[videoVersion];
_level0.loadVideo(title_array[0].attributes[videoVersion], 1);
}
if (inVeoh and isVlog) {
this.playmovie.gotoAndStop(2);
this.playmovie.btn._alpha = 100;
image = title_array[0].attributes.fullHighResImagePath;
playmovie.loadImage();
}
if (!inVeoh) {
this.playmovie.gotoAndStop(2);
this.playmovie.btn._alpha = 100;
image = title_array[0].attributes.fullHighResImagePath;
playmovie.loadImage();
}
}
_level0.movie = title_array[0].attributes[videoVersion];
_level0.movieTitle = title_array[0].attributes.title;
logEvent("FlashPlayerLoaded");
image = title_array[0].attributes.fullHighResImagePath;
}
function loadVideo(video, scrollpaneHL) {
nc = new NetConnection();
nc.connect(null);
_root.ns = new NetStream(nc);
_root.ns.setBufferTime(5);
_root.attachAudio(ns);
audio = new Sound(_root);
logEvent("WebPlayed");
audio.setVolume(100);
videoDisplay._alpha = 0;
videoDisplay.attachVideo(_root.ns);
video2 = video;
_root.ns.play(video2);
_root.ns.onMetaData = function (obj) {
callNeilsenRatings();
duration = obj.duration;
trace("DUREATION = " + duration);
video_length = obj.duration;
videoWidth = obj.width;
videoHeight = obj.height;
adjustVideoSize();
};
}
function callNeilsenRatings() {
scCI = "us-431859";
scCG = nielsenPlayer;
scTL = "dav0-" + escape(_level0.movieTitle);
scSI = escape("http://www.veoh.com/videos/" + _level0.permalinkId);
scC0 = "pa,Veoh%20Networks";
scC1 = "br,Veoh";
scC6 = "vc,b01";
var _local1 = ((((((((((((((("http://secure-us.imrworldwide.com/cgi-bin/m?ci=" + scCI) + "&cg=") + scCG) + "&si=") + scSI) + "&tl=") + scTL) + "&c0=") + scC0) + "&c1=") + scC1) + "&c6=") + scC6) + "&cc=1") + "&rnd=") + Math.ceil(Math.random() * 100000000);
trace("neilsenURL: " + _local1);
loadMovieNum (_local1, 100);
}
function adjustVideoSize() {
stageHeight = Stage.height - _root.offset;
wRatio = Stage.width / videoWidth;
hRatio = stageHeight / videoHeight;
if ((videoHeight * wRatio) < stageHeight) {
videoDisplay._width = Stage.width;
videoDisplay._height = videoHeight * wRatio;
} else {
videoDisplay._width = videoWidth * hRatio;
videoDisplay._height = stageHeight;
}
videoDisplay._x = (Stage.width - videoDisplay._width) / 2;
videoDisplay._y = ((Stage.height - _root.offset) - videoDisplay._height) / 2;
videoDisplay._alpha = 100;
}
function videoPlayer() {
var _local2 = this.createEmptyMovieClip("video" + _level0.count, 2000);
_level0.count++;
_local2.onEnterFrame = function () {
if (duration > 3600) {
overLimit = "over";
}
if (duration > 3600) {
if (ns.time > 300) {
ns.close();
playerClose = "over";
playmovie._visible = false;
delete this.onEnterFrame;
_level0.controls.gotoAndStop(2);
_level0.similarInterval2 = setInterval(_level0, "loadSimilar", 700);
}
}
if (Math.ceil(ns.time) == Math.ceil(duration)) {
delete this.onEnterFrame;
_level0.controls.gotoAndStop(2);
_level0.similarInterval = setInterval(_level0, "loadSimilar", 700);
_level0.ns.seek(0);
_level0.ns.pause(true);
}
};
}
function loadSimilar() {
if (!_level0.similarLoaded) {
clearInterval(_level0.similarInterval);
clearInterval(_level0.similarInterval2);
_level0.similarLoaded = true;
if (_level0.inVeoh) {
loadMovieNum ("http://www.veoh.com/static/flash/players/similar_menu.swf", 2);
}
loadMovieNum ("http://www.veoh.com/static/flash/players/menus_videodetails.swf", 1);
}
}
function unloadSimilar() {
unloadMovieNum (2);
}
stop();
_level0.playStatus = "on";
_level0.dl_mc._visible = false;
local_data = SharedObject.getLocal("user_data");
guid = Math.round(Math.random() * 100000000);
local_data.data.guid = guid;
if ((playAuto == undefined) and (external == undefined)) {
inVeoh = "false";
isVlog = "false";
} else if ((playAuto == true) and (external == true)) {
inVeoh = "false";
isVlog = "false";
} else if ((playAuto == true) and (external == false)) {
inVeoh = "true";
isVlog = "false";
} else if ((playAuto == false) and (external == true)) {
inVeoh = "false";
isVlog = "false";
} else if ((playAuto == false) and (external == false)) {
inVeoh = "true";
isVlog = "true";
} else {
inVeoh = "false";
isVlog = "false";
}
((!_root.id) ? ((id = "1")) : ((id = _root.id)));
((!_root.inVeoh) ? ((inVeoh = false)) : ((inVeoh = _root.inVeoh.substr(0, 4) == "true")));
((!_root.isVlog) ? ((isVlog = false)) : ((isVlog = _root.isVlog.substr(0, 4) == "true")));
((!_root.queryParams) ? ((queryParams = "")) : ((queryParams = _root.queryParams)));
if (inVeoh) {
nielsenPlayer = "videodetails";
} else {
nielsenPlayer = "videodetailsembedded";
}
if (isVlog) {
nielsenPlayer = "vlog";
}
version = "3.2";
flash7 = false;
flash6 = false;
checkVersion();
var video = new XML();
video.ignoreWhite = true;
if (_level0.permalinkId == undefined) {
_level0.permalinkId = "e63310f2zw8aep";
video.load(_level0.permalinkId + ".xml");
} else {
permalinkId2 = _level0.permalinkId;
video.load(("http://www.veoh.com/rest/video/" + _level0.permalinkId) + "/details");
}
video.onLoad = function (success) {
if (success) {
item2 = mx.xpath.XPathAPI.selectSingleNode(this.firstChild, "/videos");
if (item2.attributes.items == 0) {
_root.no_data.gotoAndStop(2);
}
titlePath = "/videos/video";
title_array = mx.xpath.XPathAPI.selectNodeList(this.firstChild, titlePath);
file = mx.xpath.XPathAPI.selectSingleNode(this.firstChild, "/videos/video/");
loadVideoDetails(titlePath, title_array, file);
} else {
trace("error loading XML");
}
};
if (_level0.versionNumber > 7) {
videoVersion = "fullPreviewHashPath";
} else {
videoVersion = "fullPreviewHashLowPath";
}
var offset = 36;
var videoWidth = 1;
var videoHeight = 1;
time = Math.round(ns.time);
var count = 2;
videoPlayer();
_level0.similarLoaded = false;
audio_data = SharedObject.getLocal("audio_data", "http://www.veoh.com/static/flash/players");
var audio_level = 100;
if (audio_data.data.level != undefined) {
audio_level = audio_data.data.level;
} else {
audio_data.data.level = audio_level;
}
audio_data.flush();
_root.controller.setVolume(audio_level);
if (videoAutoPlay == true) {
video_details_mc.gotoAndStop(2);
}
_root.createEmptyMovieClip("dl_holder", 11);
dl_holder.onEnterFrame = function () {
trace("foo");
if ((duration > 3600) and (ns.time > 1)) {
_root.attachMovie("download_rating", "dl_mc", 500);
}
};
Frame 2 (1 B)
Symbol 5 Button (304 B)
on (release) {
if (_level0.inVeoh) {
getURL ("javascript:autoDownload()");
return(undefined);
}
if (!_level0.inVeoh) {
var my_lv = new LoadVars();
my_lv.send(("http://www.veoh.com/videos/" + _level0.permalinkId) + "?&autoDownload=true", (_level0.inVeoh ? "_self" : "_blank"), "POST");
}
}
Symbol 9 MovieClip [download_rating] Frame 1 (1.25 KiB) ●
function mouseDetection() {
onMouseMove = (onMouseDown = function () {
clearInterval(motionDetection);
visibleMenus();
mouseInMotion = true;
motionDetection = setInterval(noMotionDetected, 2000);
});
}
function noMotionDetected() {
clearInterval(motionDetection);
mouseInMotion = false;
motionDetection = setInterval(motionDetector, 500);
}
function noMotionDetected2() {
clearInterval(motionDetection);
mouseInMotion = true;
visibleMenus();
delete this.onMouseMove;
}
function startUp() {
mouseDetection();
}
function motionDetector() {
if (!mouseInMotion) {
novisibleMenus();
}
}
function visibleMenus() {
this.onEnterFrame = function () {
this._alpha = this._alpha + ((100 - this._alpha) / 5);
};
}
function novisibleMenus() {
this.onEnterFrame = function () {
this._alpha = this._alpha + ((-this._alpha) / 5);
};
}
delete _root.dl_holder.onEnterFrame;
this.createEmptyMovieClip("holder", 33);
holder.onEnterFrame = function () {
if (((_level0.duration < 3600) || (_root.time == undefined)) || (_root.time == 0)) {
_level0.dl_mc._visible = false;
} else {
_level0.dl_mc._visible = true;
}
};
var motionDetection;
var mouseInMotion;
menus = true;
mouseDetection();
noMotionDetected();
Symbol 15 MovieClip [no_data] Frame 1 (8 B)
stop();
Symbol 26 MovieClip Frame 1 (1.5 KiB) ●
function startTimeTracking() {
this.onEnterFrame = function () {
duration2 = _root.duration;
minutes = Math.floor(_root.ns.time / 60);
hours = Math.floor(minutes / 60);
if (hours > 0) {
minutes = minutes - (hours * 60);
}
seconds = Math.round(_root.ns.time % 60);
minutes2 = Math.floor(duration2 / 60);
hours2 = Math.floor(minutes2 / 60);
if (hours2 > 0) {
minutes2 = minutes2 - (hours2 * 60);
}
seconds2 = Math.round(duration2 % 60);
secStr2 = (minStr2 = "00");
if (_root.duration != undefined) {
secStr2 = ((seconds2 < 10) ? ("0" + seconds2) : (seconds2));
minStr2 = ((minutes2 < 10) ? ("0" + minutes2) : (minutes2));
}
total_time = (minStr2 + ":") + secStr2;
if (hours2 > 0) {
total_time = (hours2 + ":") + total_time;
}
if (_root.ns.time == undefined) {
current_time = "00:00";
_level0.secondsPlayed = "00:00";
}
secStr = (minStr = "00");
if (_root.ns.time != undefined) {
secStr = ((seconds < 10) ? ("0" + seconds) : (seconds));
minStr = ((minutes < 10) ? ("0" + minutes) : (minutes));
}
current_time = (minStr + ":") + secStr;
if (hours > 0) {
current_time = (hours + ":") + current_time;
_level0.secondsPlayed = current_time;
}
if ((_root.ns.time != undefined) && (_root.duration != undefined)) {
if (Math.round(_root.ns.time) >= Math.round(_root.duration)) {
current_time = total_time;
}
}
};
}
var minutes = 0;
var seconds = 0;
startTimeTracking();
Symbol 31 Button (125 B)
on (press) {
_level0.ns.pause(true);
loadMovieNum ("http://www.veoh.com/static/flash/players/menus_videodetails.swf", 1);
}
Symbol 32 MovieClip Frame 1 (8 B)
stop();
Symbol 38 Button (85 B)
on (press) {
trace("mute one");
gotoAndStop (2);
_parent.progressBar._width = 0;
}
Symbol 39 Button (103 B)
on (press) {
trace("mute two");
gotoAndStop (1);
_parent.progressBar._width = _parent.volumeState;
}
Symbol 40 MovieClip Frame 1 (8 B)
stop();
Symbol 44 MovieClip Frame 1 (1 KiB)
function setVolume(percent) {
progressBar._width = (percent * 46) / 100;
}
percentbarWidth = scrubber._width;
progressBar._width = setVolume(_root.audio_level);
volumeState = progressBar._width;
scrubber.onPress = function () {
mute.gotoAndStop(1);
this.onEnterFrame = function () {
if (_xmouse < (scrubber._width + progressBar._x)) {
progressBar._width = _xmouse - progressBar._x;
}
};
};
scrubber.onRelease = (scrubber.onReleaseOutside = function () {
delete this.onEnterFrame;
volumeState = progressBar._width;
volume = Math.floor((progressBar._width * 100) / 46);
vol = volume;
if (vol <= 5) {
vol = 0;
}
_root.audio_data = SharedObject.getLocal("audio_data", "http://www.veoh.com/static/flash/players");
_root.audio_data.data.level = vol;
_root.audio_data.flush();
});
this.onEnterFrame = function () {
volume = Math.floor((progressBar._width * 100) / 46);
if (volume > 5) {
_root.audio.setVolume(volume);
} else {
_root.audio.setVolume(0);
}
};
Symbol 49 Button (469 B)
on (press) {
_level0.controls.gotoAndStop(2);
_level0.playStatus = "off";
_level0.ns.pause(true);
}
on (release) {
foo = ("javascript:NewWindow=window.open('http://www.veoh.com/fullscreen_single.html?permalinkId=" + _level0.permalinkId) + "','newWin','width='+screen.availWidth+',height='+screen.availHeight+',left=0,top=10,toolbar=No,location=No,scrollbars=No,status=No,resizable=Yes,fullscreen=Yes'); NewWindow.focus(); void(0);";
trace(foo);
getURL (foo);
}
Symbol 53 Button (86 B)
on (press) {
_level0.playStatus = "off";
_level0.ns.pause(true);
gotoAndStop (2);
}
Symbol 63 Button (375 B)
on (press) {
_level0.logEvent("WebPlayed");
_level0.playStatus = "on";
_level0.ns.pause(false);
if (Math.round(_level0.ns.time) >= Math.round(_level0.duration)) {
_level0.ns.seek(0);
_level0.ns.pause(false);
gotoAndStop (1);
}
}
on (release) {
gotoAndStop (1);
unloadMovieNum (1);
unloadMovieNum (2);
_level0.videoPlayer();
_level0.similarLoaded = false;
}
Symbol 64 MovieClip Frame 1 (132 B)
stop();
i = 0;
var clicks = 0;
var listenerObject = new Object();
var lastPos = 0;
videos = 0;
foo = 0;
foo2 = 0;
foo3 = 0;
Symbol 64 MovieClip Frame 2 (32 B)
_level0.logEvent("WebStopped");
Symbol 71 MovieClip Frame 1 (1.25 KiB) ●
percentbarWidth = 540;
progressBar._width = 0;
percentBar.onEnterFrame = function () {
loaded = _root.ns.bytesLoaded;
total = _root.ns.bytesTotal;
if ((loaded == total) && (loaded > 1000)) {
percentBar._width = percentbarWidth;
} else {
percentBar._width = int((percentbarWidth * loaded) / total);
}
};
progressBar.onEnterFrame = function () {
this._width = Stage.width * Number(_root.ns.time / _root.duration);
if (this._width < ((blue_scrub._width / 2) - 1)) {
blue_scrub._x = (blue_scrub._width / 2) - 1;
} else if (this._width > ((Stage.width - (blue_scrub._width / 2)) + 1)) {
blue_scrub._x = (Stage.width - (blue_scrub._width / 2)) + 1;
} else {
blue_scrub._x = this._width;
}
};
scrubber.onPress = function () {
this.onEnterFrame = function () {
if (_level0.duration < 3600) {
xpos = ((this._xmouse * this._xscale) / percentbarWidth) / 100;
_root.ns.seek(xpos * _root.duration);
}
if (_level0.playStatus == "on") {
_root.controls.gotoAndStop(1);
}
};
};
scrubber.onRelease = (scrubber.onReleaseOutside = function () {
xpos = ((this._xmouse * this._xscale) / percentbarWidth) / 100;
_root.ns.seek(xpos * _root.duration);
delete this.onEnterFrame;
_root.videoPlayer();
});
Symbol 80 Button (114 B)
on (release) {
_parent.video_details_mc.gotoAndStop(2);
gotoAndStop (3);
_level0.loadVideo(_level0.movie, 1);
}
Symbol 84 MovieClip Frame 1 (38 B)
stop();
trans.useHandCursor = false;
Symbol 84 MovieClip Frame 2 (441 B)
function loadImage() {
var _local2 = new MovieClipLoader();
var _local1 = new Object();
_local1.onLoadInit = function (target_mc) {
target_mc._width = Stage.width;
target_mc._height = Stage.height;
target_mc._quality = "BEST";
};
_local2.addListener(_local1);
_local2.loadClip(_level0.image, imageloader);
}
stop();
loadImage();
trans.useHandCursor = false;
if (_level0.overLimit == "over") {
gotoAndStop (3);
}
Symbol 84 MovieClip Frame 3 (23 B)
_root.ns.pause(false);
Symbol 85 Button (117 B)
on (release) {
getURL (("http://www.veoh.com/videos/" + _level0.permalinkId) + "&source=embedVideo", "_self");
}
Symbol 87 MovieClip Frame 1 (8 B)
stop();
Symbol 88 MovieClip [__Packages.mx.xpath.XPathAPI] Frame 0 (10.6 KiB) ● ●
class mx.xpath.XPathAPI
{
function XPathAPI () {
}
static function getEvalString(node, path) {
var _local7 = "";
var _local4 = null;
var _local9 = getPathSet(path);
var _local3 = _local9[0].nodeName;
var _local8;
var _local2 = node;
var _local5 = false;
if ((_local3 != undefined) && ((_local3 == "*") || (node.nodeName == _local3))) {
var _local6 = 1;
while (_local6 < _local9.length) {
_local3 = _local9[_local6].nodeName;
_local8 = _local3.indexOf("@");
if (_local8 >= 0) {
_local3 = _local3.substring(_local8 + 1);
_local5 = _local2.attributes[_local3] != undefined;
_local7 = _local7 + (".attributes." + _local3);
} else {
_local5 = false;
var _local1 = 0;
while (_local1 < _local2.childNodes.length) {
_local4 = _local2.childNodes[_local1];
if (_local4.nodeName == _local3) {
_local7 = _local7 + (".childNodes." + _local1);
_local1 = _local2.childNodes.length;
_local2 = _local4;
_local5 = true;
}
_local1++;
}
}
if (!_local5) {
return("");
}
_local6++;
}
if (!_local5) {
_local7 = "";
} else if (_local8 == -1) {
_local7 = _local7 + ".firstChild.nodeValue";
}
} else {
_local7 = "";
}
return(_local7);
}
static function selectNodeList(node, path) {
var _local2 = new Array(node);
var _local5 = getPathSet(path);
var _local4 = _local5[0];
var _local6 = _local4.__get__nodeName();
var _local1 = null;
if ((_local6 != undefined) && ((_local6 == "*") || (node.nodeName == _local6))) {
if (_local4.__get__filter().length > 0) {
_local1 = new mx.xpath.FilterStack(_local4.__get__filter());
_local2 = filterNodes(_local2, _local1);
}
if (_local2.length > 0) {
var _local3 = 1;
while (_local3 < _local5.length) {
_local4 = _local5[_local3];
_local2 = getAllChildNodesByName(_local2, _local4.__get__nodeName());
if (_local4.__get__filter().length > 0) {
_local1 = new mx.xpath.FilterStack(_local4.__get__filter());
} else {
_local1 = null;
}
if ((_local1 != null) && (_local1.__get__exprs().length > 0)) {
_local2 = filterNodes(_local2, _local1);
}
_local3++;
}
}
} else {
_local2 = new Array();
}
return(_local2);
}
static function selectSingleNode(node, path) {
var _local1 = selectNodeList(node, path);
if (_local1.length > 0) {
return(_local1[0]);
}
return(null);
}
static function setNodeValue(node, path, newValue) {
var _local1 = new Array(node);
var _local9 = getPathSet(path);
var _local7 = _local9[_local9.length - 1].nodeName;
if (_local7.charAt(0) == "@") {
_local7 = _local7.substring(1, _local7.length);
_local9.pop();
} else {
_local7 = null;
}
var _local5 = _local9[0];
var _local11 = _local5.__get__nodeName();
var _local3 = null;
if ((_local11 != undefined) && ((_local11 == "*") || (node.nodeName == _local11))) {
if (_local5.__get__filter().length > 0) {
_local3 = new mx.xpath.FilterStack(_local5.__get__filter());
_local1 = filterNodes(_local1, _local3);
}
if (_local1.length > 0) {
var _local2 = 1;
while (_local2 < _local9.length) {
_local5 = _local9[_local2];
_local1 = getAllChildNodesByName(_local1, _local5.__get__nodeName());
if (_local5.__get__filter().length > 0) {
_local3 = new mx.xpath.FilterStack(_local5.__get__filter());
} else {
_local3 = null;
}
if ((_local3 != null) && (_local3.__get__exprs().length > 0)) {
_local1 = filterNodes(_local1, _local3);
}
_local2++;
}
}
} else {
_local1 = new Array();
}
var _local4 = null;
var _local6 = null;
var _local10 = new XML();
var _local2 = 0;
while (_local2 < _local1.length) {
if (_local7 != null) {
_local1[_local2].attributes[_local7] = newValue;
} else {
_local4 = _local1[_local2];
if ((_local4.firstChild == null) || (_local4.firstChild.nodeType != 3)) {
_local6 = _local10.createTextNode(newValue);
_local4.appendChild(_local6);
} else {
_local6 = _local4.firstChild;
_local6.nodeValue = newValue;
}
}
_local2++;
}
return(_local1.length);
}
static function copyStack(toStk, fromStk) {
var _local1 = 0;
while (_local1 < fromStk.length) {
toStk.splice(_local1, 0, fromStk[_local1]);
_local1++;
}
}
static function evalExpr(expr, node) {
var _local2 = true;
if (expr.__get__attr()) {
_local2 = ((expr.__get__value() != null) ? (node.attributes[expr.__get__name()] == expr.__get__value()) : (node.attributes[expr.__get__name()] != null));
} else {
var _local3 = getChildNodeByName(node, expr.__get__name());
if (_local3 != null) {
_local2 = ((expr.__get__value() != null) ? (_local3.firstChild.nodeValue == expr.__get__value()) : true);
} else {
_local2 = false;
}
}
return(_local2);
}
static function filterNodes(nodeList, stack) {
var _local13 = new Array();
var _local2;
var _local3;
var _local9;
var _local6;
var _local10;
var _local1 = true;
var _local4;
var _local5;
var _local8 = 0;
while (_local8 < nodeList.length) {
_local5 = true;
_local2 = new Array();
_local3 = new Array();
copyStack(_local2, stack.__get__exprs());
copyStack(_local3, stack.__get__ops());
_local4 = nodeList[_local8];
while ((_local2.length > 0) && (_local5)) {
if (typeof(_local2[_local2.length - 1]) == "object") {
_local9 = mx.xpath.FilterExpr(_local2.pop());
_local1 = evalExpr(_local9, _local4);
} else {
_local10 = Boolean(_local2.pop());
_local1 = _local10;
}
if (_local3.length > 0) {
var _local7 = _local2.pop();
_local6 = _local7;
switch (_local3[_local3.length - 1]) {
case "and" :
_local1 = _local1 && (evalExpr(_local6, _local4));
_local5 = _local1;
break;
case "or" :
_local1 = _local1 || (evalExpr(_local6, _local4));
_local5 = !_local1;
}
_local3.pop();
_local2.push(_local1);
}
}
if (_local1) {
_local13.push(_local4);
}
_local8++;
}
return(_local13);
}
static function getAllChildNodesByName(nodeList, name) {
var _local5 = new Array();
var _local2;
var _local3 = 0;
while (_local3 < nodeList.length) {
_local2 = nodeList[_local3].childNodes;
if (_local2 != null) {
var _local1 = 0;
while (_local1 < _local2.length) {
if ((name == "*") || (_local2[_local1].nodeName == name)) {
_local5.push(_local2[_local1]);
}
_local1++;
}
}
_local3++;
}
return(_local5);
}
static function getChildNodeByName(node, nodeName) {
var _local2;
var _local3 = node.childNodes;
var _local1 = 0;
while (_local1 < _local3.length) {
_local2 = _local3[_local1];
if (_local2.nodeName == nodeName) {
return(_local2);
}
_local1++;
}
return(null);
}
static function getKeyValues(node, keySpec) {
var _local5 = "";
var _local3 = new mx.utils.StringTokenParser(keySpec);
var _local2 = _local3.nextToken();
var _local1;
var _local6;
while (_local2 != mx.utils.StringTokenParser.tkEOF) {
_local1 = _local3.token;
_local5 = _local5 + (" " + _local1);
if (_local2 == mx.utils.StringTokenParser.tkSymbol) {
if (_local1 == "@") {
_local2 = _local3.nextToken();
_local1 = _local3.token;
if (_local2 == mx.utils.StringTokenParser.tkSymbol) {
_local5 = _local5 + (((_local1 + "='") + node.attributes[_local1]) + "'");
}
} else if (_local1 == "/") {
_local2 = _local3.nextToken();
if (_local2 == mx.utils.StringTokenParser.tkSymbol) {
_local1 = _local3.token;
node = getChildNodeByName(node, _local1);
if (node != null) {
_local5 = _local5 + _local1;
}
}
} else if ((((_local1 != "and") && (_local1 != "or")) && (_local1 != "[")) && (_local1 != "]")) {
_local6 = getChildNodeByName(node, _local1);
if (_local6 != null) {
_local5 = _local5 + (("='" + _local6.firstChild.nodeValue) + "'");
}
}
}
if (node == null) {
trace(("Invalid keySpec specified. '" + keySpec) + "' Error.");
return("ERR");
}
_local2 = _local3.nextToken();
}
return(_local5.slice(1));
}
static function getPath(node, keySpecs) {
var _local2 = "";
var _local5 = keySpecs[node.nodeName];
if (_local5 == undefined) {
var _local8 = "";
var _local10;
for (_local10 in node.attributes) {
_local8 = _local8 + (((("@" + _local10) + "='") + node.attributes[_local10]) + "' and ");
}
var _local7 = "";
var _local1;
var _local6;
var _local4 = 0;
while (_local4 < node.childNodes.length) {
_local1 = node.childNodes[_local4];
_local6 = _local1.firstChild.nodeValue;
if (_local6 != undefined) {
_local7 = _local7 + (((_local1.nodeName + "='") + _local6) + "' and ");
}
_local4++;
}
if (_local8.length > 0) {
if (_local7.length > 0) {
_local2 = (((("/" + node.nodeName) + "[") + _local8) + _local7.substring(0, _local7.length - 4)) + "]";
} else {
_local2 = ((("/" + node.nodeName) + "[") + _local8.substring(0, _local8.length - 4)) + "]";
}
} else {
_local2 = ((("/" + node.nodeName) + "[") + _local7.substring(0, _local7.length - 4)) + "]";
}
} else {
_local2 = _local2 + (("/" + node.nodeName) + getKeyValues(node, _local5));
}
var _local1 = node.parentNode;
while (_local1.parentNode != null) {
_local5 = keySpecs[_local1.nodeName];
if (_local5 != undefined) {
_local2 = (("/" + _local1.nodeName) + getKeyValues(_local1, _local5)) + _local2;
} else {
_local2 = ("/" + _local1.nodeName) + _local2;
}
_local1 = _local1.parentNode;
}
return(_local2);
}
static function getPathSet(path) {
var _local6 = new Array();
var _local4;
var _local1;
var _local2;
var _local5;
while (path.length > 0) {
_local4 = path.lastIndexOf("/");
_local1 = path.substring(_local4 + 1);
_local2 = _local1.indexOf("[", 0);
_local5 = ((_local2 >= 0) ? (_local1.substring(_local2 + 1, _local1.length - 1)) : "");
_local1 = ((_local2 >= 0) ? (_local1.substring(0, _local2)) : (_local1));
_local6.splice(0, 0, new mx.xpath.NodePathInfo(_local1, _local5));
path = path.substring(0, _local4);
}
return(_local6);
}
}
Symbol 89 MovieClip [__Packages.mx.xpath.NodePathInfo] Frame 0 (285 B)
class mx.xpath.NodePathInfo
{
function NodePathInfo (nodeName, filter) {
__nodeName = nodeName;
__filter = filter;
}
function get nodeName() {
return(__nodeName);
}
function get filter() {
return(__filter);
}
var __nodeName = null;
var __filter = null;
}
Symbol 90 MovieClip [__Packages.mx.xpath.FilterStack] Frame 0 (1.35 KiB) ●
class mx.xpath.FilterStack
{
var __expr, __ops;
function FilterStack (filterVal) {
__expr = new Array();
__ops = new Array();
var _local2 = new mx.utils.StringTokenParser(filterVal);
var _local5 = _local2.nextToken();
var _local4;
var _local3 = _local2.__get__token();
while (_local5 != mx.utils.StringTokenParser.tkEOF) {
if (_local3 == "@") {
_local5 = _local2.nextToken();
_local3 = _local2.token;
_local4 = new mx.xpath.FilterExpr(true, _local3, null);
__expr.splice(0, 0, _local4);
if (_local2.nextToken() == mx.utils.StringTokenParser.tkSymbol) {
if (_local2.__get__token() == "=") {
_local5 = _local2.nextToken();
_local4.__set__value(_local2.token);
}
}
} else if ((_local3 == "and") || (_local3 == "or")) {
__ops.splice(0, 0, _local3);
} else if ((_local3 != ")") && (_local3 != "(")) {
_local4 = new mx.xpath.FilterExpr(false, _local3, null);
__expr.splice(0, 0, _local4);
if (_local2.nextToken() == mx.utils.StringTokenParser.tkSymbol) {
if (_local2.__get__token() == "=") {
_local5 = _local2.nextToken();
_local4.__set__value(_local2.token);
}
}
}
_local5 = _local2.nextToken();
_local3 = _local2.token;
}
}
function get exprs() {
return(__expr);
}
function get ops() {
return(__ops);
}
}
Symbol 91 MovieClip [__Packages.mx.utils.StringTokenParser] Frame 0 (3.17 KiB) ●
class mx.utils.StringTokenParser
{
var _source, _skipChars;
function StringTokenParser (source, skipChars) {
_source = source;
_skipChars = ((skipChars == undefined) ? null : (skipChars));
}
function get token() {
return(_token);
}
function getPos() {
return(_index);
}
function nextToken() {
var _local4;
var _local2;
var _local3 = _source.length;
skipBlanks();
if (_index >= _local3) {
return(tkEOF);
}
_local2 = _source.charCodeAt(_index);
if (((((_local2 >= 65) && (_local2 <= 90)) || ((_local2 >= 97) && (_local2 <= 122))) || ((_local2 >= 192) && (_local2 <= Number.POSITIVE_INFINITY))) || (_local2 == 95)) {
_local4 = _index;
_index++;
_local2 = _source.charCodeAt(_index);
while (((((((_local2 >= 65) && (_local2 <= 90)) || ((_local2 >= 97) && (_local2 <= 122))) || ((_local2 >= 48) && (_local2 <= 57))) || ((_local2 >= 192) && (_local2 <= Number.POSITIVE_INFINITY))) || (_local2 == 95)) && (_index < _local3)) {
_index++;
_local2 = _source.charCodeAt(_index);
}
_token = _source.substring(_local4, _index);
return(tkSymbol);
}
if ((_local2 == 34) || (_local2 == 39)) {
_index++;
_local4 = _index;
_local2 = _source.charCodeAt(_local4);
while (((_local2 != 34) && (_local2 != 39)) && (_index < _local3)) {
_index++;
_local2 = _source.charCodeAt(_index);
}
_token = _source.substring(_local4, _index);
_index++;
return(tkString);
}
if ((_local2 == 45) || ((_local2 >= 48) && (_local2 <= 57))) {
var _local5 = tkInteger;
_local4 = _index;
_index++;
_local2 = _source.charCodeAt(_index);
while (((_local2 >= 48) && (_local2 <= 57)) && (_index < _local3)) {
_index++;
_local2 = _source.charCodeAt(_index);
}
if (_index < _local3) {
if (((((((_local2 >= 48) && (_local2 <= 57)) || (_local2 == 46)) || (_local2 == 43)) || (_local2 == 45)) || (_local2 == 101)) || (_local2 == 69)) {
_local5 = tkFloat;
}
while ((((((((_local2 >= 48) && (_local2 <= 57)) || (_local2 == 46)) || (_local2 == 43)) || (_local2 == 45)) || (_local2 == 101)) || (_local2 == 69)) && (_index < _local3)) {
_index++;
_local2 = _source.charCodeAt(_index);
}
}
_token = _source.substring(_local4, _index);
return(_local5);
}
_token = _source.charAt(_index);
_index++;
return(tkSymbol);
}
function skipBlanks() {
if (_index < _source.length) {
var _local2 = _source.charAt(_index);
while ((_local2 == " ") || ((_skipChars != null) && (skipChar(_local2)))) {
_index++;
_local2 = _source.charAt(_index);
}
}
}
function skipChar(ch) {
var _local2 = 0;
while (_local2 < _skipChars.length) {
if (ch == _skipChars[_local2]) {
return(true);
}
_local2++;
}
return(false);
}
static var tkEOF = -1;
static var tkSymbol = 0;
static var tkString = 1;
static var tkInteger = 2;
static var tkFloat = 3;
var _index = 0;
var _token = "";
}
Symbol 92 MovieClip [__Packages.mx.xpath.FilterExpr] Frame 0 (532 B)
class mx.xpath.FilterExpr
{
function FilterExpr (attrInit, nameInit, valueInit) {
__attr = attrInit;
__name = nameInit;
__value = valueInit;
}
function get attr() {
return(__attr);
}
function set attr(newVal) {
__attr = newVal;
}
function get name() {
return(__name);
}
function set name(newVal) {
__name = newVal;
}
function get value() {
return(__value);
}
function set value(newVal) {
__value = newVal;
}
var __attr = false;
var __value = null;
var __name = null;
}