Frame 1
function statTrack(what) {
ExternalInterface.call("urchinTracker", "/special/games/pipes/" + what);
trace("statTrack for: /special/games/pipes/" + what);
}
function fadeOut(startFrame, endFrame) {
if (_root.fader == undefined) {
_root.attachMovie("fader", "fader", 10010);
fader._x = 0;
fader._y = 0;
fader._xscale = 100;
fader._yscale = 100;
fader.endFrame = endFrame;
_root.gotoAndStop(startFrame);
fader.onEnterFrame = function () {
this._alpha = this._alpha + this.dir;
if (this._currentframe >= this._totalframes) {
trace("kill!");
this.removeMovieClip();
} else if (this._currentframe == Math.round(this._totalframes / 2)) {
_root.gotoAndPlay(endFrame);
}
};
}
}
Stage.scaleMode = "noScale";
Stage.align = "TL";
var scoreService = new ScoreService();
var myListener = new Object();
myListener.submitScoresComplete = function () {
trace("submitScoresComplete with " + resultId);
fadeOut(_currentframe + 9, "submitok");
play();
};
myListener.getBestScoresComplete = function () {
trace("getBestScoresComplete");
};
myListener.scoresError = function (error) {
trace("get/set scores failed");
fadeOut(_currentframe + 9, "submitfail");
};
scoreService.addListener(myListener);
statTrack("loaded");
var isChallenged = false;
if ((((_root.challengeName != undefined) && (_root.challengeName != "")) && (_root.challengeScore != undefined)) && (_root.challengeScore != "")) {
var challengeText = ((("You've been challenged by " + _root.challengeName) + " to beat the score ") + _root.challengeScore);
_root.isChallenged = true;
statTrack("challenged");
}
url = new String(_root._url);
if (url.indexOf("grapefrukt.com") == -1) {
}
Frame 2
MochiAd.showPreloaderAd({id:"c8b43dcf1fcc19a8", res:"500x310"});
Frame 3
Stage.scaleMode = "showAll";
Frame 51
fadeOut(_currentframe, "splash");
Frame 60
btnPlay.onRelease = function () {
fadeOut(_currentframe + 9, "game");
};
btnScores.onRelease = function () {
fadeOut(_currentframe + 9, "view");
};
stop();
Frame 70
function rotateBlock(block, rotations) {
block.targetrota = block.targetrota + (90 * rotations);
}
function lightConnected(startBlock, newstate) {
var _local5 = 0;
setBlockState(startBlock, newstate);
var _local2 = getLinked(startBlock);
var _local3 = 0;
while (_local3 < _local2.length) {
setBlockState(_local2[_local3], newstate);
_local5++;
var _local1 = getLinked(_local2[_local3]);
for (var _local4 in _local1) {
if (searchArray(_local2, _local1[_local4].xpos, _local1[_local4].ypos) == false) {
_local2.push(_local1[_local4]);
}
}
_local3++;
}
return(_local5);
}
function updateBlocks() {
for (var _local2 in grid) {
for (var _local1 in grid[_local2]) {
updateBlock(grid[_local2][_local1]);
}
}
}
function updateExplodedBlocks() {
if (explodedBlocks.length > 0) {
this._quality = "LOW";
} else {
this._quality = "HIGH";
}
for (var _local4 in explodedBlocks) {
var _local3 = explodedBlocks[_local4]._x;
var _local2 = explodedBlocks[_local4]._y;
explodedBlocks[_local4]._x = explodedBlocks[_local4]._x + ((explodedBlocks[_local4]._x - explodedBlocks[_local4].oldx) * 0.9);
explodedBlocks[_local4]._y = explodedBlocks[_local4]._y + (explodedBlocks[_local4]._y - explodedBlocks[_local4].oldy);
explodedBlocks[_local4]._xscale = explodedBlocks[_local4]._xscale - 5;
explodedBlocks[_local4]._yscale = explodedBlocks[_local4]._yscale - 5;
explodedBlocks[_local4]._y = explodedBlocks[_local4]._y + 4;
explodedBlocks[_local4]._rotation = explodedBlocks[_local4]._rotation + (explodedBlocks[_local4]._x - explodedBlocks[_local4].oldx);
explodedBlocks[_local4].oldx = _local3;
explodedBlocks[_local4].oldy = _local2;
if ((((explodedBlocks[_local4]._y > Stage.height) || (explodedBlocks[_local4]._y < -10)) || (explodedBlocks[_local4]._x > Stage.width)) || (explodedBlocks[_local4]._x < -10)) {
explodedBlocks[_local4].removeMovieClip();
explodedBlocks.splice(_local4, 1);
}
}
}
function resetBlocks() {
for (var _local2 in grid) {
for (var _local1 in grid[_local2]) {
if (grid[_local2][_local1]._currentframe != 3) {
setBlockState(grid[_local2][_local1], 1);
}
}
}
}
function searchArray(searchArray, searchX, searchY) {
var _local2 = false;
for (var _local5 in searchArray) {
if ((searchArray[_local5].xpos == searchX) && (searchArray[_local5].ypos == searchY)) {
_local2 = true;
break;
}
}
return(_local2);
}
function setBlockState(block, newstate) {
if (block._currentframe != 3) {
block.gotoAndStop(newstate);
}
}
function getLinked(block) {
tmpArray = new Array();
if ((block.u._visible && (grid[block.xpos][block.ypos - 1].d._visible)) && (grid[block.xpos][block.ypos - 1].isMoving == 0)) {
tmpArray.push(grid[block.xpos][block.ypos - 1]);
}
if ((block.d._visible && (grid[block.xpos][block.ypos + 1].u._visible)) && (grid[block.xpos][block.ypos + 1].isMoving == 0)) {
tmpArray.push(grid[block.xpos][block.ypos + 1]);
}
if ((block.l._visible && (grid[block.xpos - 1][block.ypos].r._visible)) && (grid[block.xpos - 1][block.ypos].isMoving == 0)) {
tmpArray.push(grid[block.xpos - 1][block.ypos]);
}
if ((block.r._visible && (grid[block.xpos + 1][block.ypos].l._visible)) && (grid[block.xpos + 1][block.ypos].isMoving == 0)) {
tmpArray.push(grid[block.xpos + 1][block.ypos]);
}
return(tmpArray);
}
function collapseBlocks() {
var _local5 = 0;
var _local3 = gridSizeX - 1;
while (_local3 >= 0) {
var _local2 = gridSizeY - 1;
while (_local2 >= 0) {
if (grid[_local3][_local2]._currentframe == 3) {
savedTime = savedTime + timeBonus;
grid[_local3][_local2].oldy = grid[_local3][_local2]._y + 20;
grid[_local3][_local2].oldx = (grid[_local3][_local2]._x + (Math.random() * 40)) - 20;
explodedBlocks.push(grid[_local3][_local2]);
grid[_local3][_local2] = undefined;
_local5++;
if (_local5 >= collapsePerFrame) {
_local3 = -1;
_local2 = -1;
}
} else if (grid[_local3][_local2] == undefined) {
var _local4 = 1;
do {
if (!((grid[_local3][_local2 - _local4]._currentframe == 3) || (grid[_local3][_local2 - _local4] == undefined))) {
break;
}
_local4++;
} while (_local4 <= gridSizeY);
grid[_local3][_local2] = grid[_local3][_local2 - _local4];
grid[_local3][_local2 - _local4] = undefined;
grid[_local3][_local2].xpos = _local3;
grid[_local3][_local2].ypos = _local2;
grid[_local3][_local2].targetpos = playFieldYPos + ((playFieldYSize / gridSizeY) * _local2);
}
_local2--;
}
_local3--;
}
if (_local5 > 0) {
_root["soundDie" + Math.ceil(Math.random() * 7)].start(0, 1);
}
return(_local5);
}
function spawnNewBlocks() {
var _local1 = gridSizeX - 1;
while (_local1 >= 0) {
if (grid[_local1][0] == undefined) {
grid[_local1][0] = spawnBlock(_local1, 0, true);
}
_local1--;
}
}
function spawnBlock(newXpos, newYpos, toFall) {
var _local1 = attachMovie("pipeblock", "pipeblock" + (objects++), objects);
var _local3 = Math.round(Math.random() * 3);
switch (_local3) {
case 0 :
_local1.u._visible = 1;
_local1.d._visible = 1;
_local1.l._visible = 0;
_local1.r._visible = 0;
break;
case 1 :
_local1.u._visible = 1;
_local1.d._visible = 0;
_local1.l._visible = 1;
_local1.r._visible = 0;
break;
case 2 :
_local1.u._visible = 1;
_local1.d._visible = 1;
_local1.l._visible = 1;
_local1.r._visible = 0;
break;
case 3 :
_local1.u._visible = 1;
_local1.d._visible = 1;
_local1.l._visible = 1;
_local1.r._visible = 1;
}
_local1._x = playFieldXPos + ((playFieldXSize / gridSizeX) * newXpos);
_local1._y = playFieldYPos + ((playFieldYSize / gridSizeY) * newYpos);
_local1._width = (playFieldXSize / gridSizeX) - playFieldMargin;
_local1._height = (playFieldYSize / gridSizeY) - playFieldMargin;
_local1.xpos = newXpos;
_local1.ypos = newYpos;
_local1.targetpos = 0;
if (toFall) {
_local1.targetpos = playFieldYPos + ((playFieldYSize / gridSizeY) * newYpos);
_local1._y = playFieldYPos + ((playFieldYSize / gridSizeY) * -3);
}
_local1.targetrota = 0;
_local1.rota = 0;
_local1.u.stop();
_local1.d.stop();
_local1.l.stop();
_local1.r.stop();
rotateBlock(_local1, Math.round(Math.random() * 3));
needUpdateCollapse = 1;
needUpdateLight = 1;
return(_local1);
}
function updateBlock(block) {
block.isMoving = false;
if (block.targetrota != 0) {
block.isMoving = true;
block.rota = block.rota + ((block.targetrota - block.rota) * 0.5);
block._rotation = block.rota;
if ((block.targetrota - block.rota) < 2) {
var _local3 = 0;
while (_local3 < (block.targetrota / 90)) {
var _local2 = new Object();
_local2.u = block.u._visible;
_local2.r = block.r._visible;
_local2.d = block.d._visible;
_local2.l = block.l._visible;
block.u._visible = _local2.l;
block.r._visible = _local2.u;
block.d._visible = _local2.r;
block.l._visible = _local2.d;
_local3++;
}
block._rotation = 0;
block.rota = 0;
block.targetrota = 0;
needUpdateLight = 1;
trace("calling linkage update");
}
}
if (block.targetpos != 0) {
block.isMoving = true;
var _local4 = (block.targetpos - block._y) * 0.3;
if (_local4 > 20) {
_local4 = 40;
}
block._y = block._y + _local4;
if ((block.targetpos - block._y) < 0.2) {
needUpdateCollapse = 1;
needUpdateLight = 1;
trace("calling both updates");
block.targetpos = 0;
}
}
}
function timer(countdown, type) {
seconds = Math.round(((countdown - getTimer()) + timebase) / 1000);
minutes = Math.floor(seconds / 60);
seconds = seconds % 60;
if (seconds.toString().length < 2) {
seconds = "0" + seconds;
}
if (type == 1) {
return((countdown - getTimer()) + timebase);
}
if (type == 2) {
return((minutes + ":") + seconds);
}
return(Math.round((getTimer() - timebase) / 1000));
}
var soundDie1 = new Sound();
soundDie1.attachSound("ricochet_dirt_1.wav");
var soundDie2 = new Sound();
soundDie2.attachSound("ricochet_dirt_2.wav");
var soundDie3 = new Sound();
soundDie3.attachSound("ricochet_dirt_3.wav");
var soundDie4 = new Sound();
soundDie4.attachSound("ricochet_dirt_4.wav");
var soundDie5 = new Sound();
soundDie5.attachSound("ricochet_dirt_5.wav");
var soundDie6 = new Sound();
soundDie6.attachSound("ricochet_dirt_6.wav");
var soundDie7 = new Sound();
soundDie7.attachSound("ricochet_dirt_7.wav");
var soundTimeOut = new Sound();
soundTimeOut.attachSound("fote_fire_swish.wav");
var soundCombo = new Sound();
soundCombo.attachSound("power_gear.wav");
var gridSizeX = 8;
var gridSizeY = 5;
var playFieldXPos = 70;
var playFieldYPos = 50;
var playFieldXSize = 640;
var playFieldYSize = 400;
var playFieldMargin = -1;
var objects = 1;
var inPos = Math.floor(Math.random() * gridSizeY);
var outPos = Math.floor(Math.random() * gridSizeY);
_root.attachMovie("inarrow", "inarrow", 10001);
_root.attachMovie("outarrow", "outarrow", 10002);
inarrow._x = playFieldXPos + ((playFieldXSize / gridSizeX) * 0);
outarrow._x = playFieldXPos + ((playFieldXSize / gridSizeX) * (gridSizeX - 1));
inarrow._width = ((playFieldXSize / gridSizeX) - playFieldMargin) * 1.2;
inarrow._height = ((playFieldYSize / gridSizeY) - playFieldMargin) * 1.2;
outarrow._width = (playFieldXSize / gridSizeX) - playFieldMargin;
outarrow._height = (playFieldYSize / gridSizeY) - playFieldMargin;
var blockCount = 0;
var lastCombo = 0;
var comboTimer = 0;
var lastScore = 0;
var score = 0;
var dispScore = 0;
var comboDisp = "";
var needUpdateLight = 1;
var needUpdateCollapse = 1;
var ageSpeed = 0.2;
var maxAgeSpeed = 0.5;
var maxTime = 60;
var minMaxTime = 15;
var timeBonus = 0.2;
var collapsePerFrame = 1;
var comboTimerMax = 90;
var frameCount = 0;
var inAge = 100;
var savedTime = 60;
var elapsedTime = 0;
var timebase = getTimer();
var explodedBlocks = new Array();
var grid = new Array();
var i = 0;
while (i < gridSizeX) {
var tmpArr = new Array();
var j = 0;
while (j < gridSizeY) {
var tmpClip = spawnBlock(i, j);
tmpArr.push(tmpClip);
j++;
}
grid.push(tmpArr);
i++;
}
_root.onEnterFrame = function () {
if (needUpdateLight) {
resetBlocks();
lightConnected(grid[0][inPos], 2);
needUpdateLight = needUpdateLight - 0.5;
}
if (needUpdateCollapse) {
var _local4 = collapseBlocks();
trace(_local4);
if (_local4 < 1) {
needUpdateCollapse = 0;
}
}
updateBlocks();
spawnNewBlocks();
updateExplodedBlocks();
inarrow._y = playFieldYPos + ((playFieldYSize / gridSizeY) * inPos);
outarrow._y = playFieldYPos + ((playFieldYSize / gridSizeY) * outPos);
inAge = inAge - ageSpeed;
inarrow.widget.gotoAndStop(100 - Math.round(100 * (inAge / 100)));
if (inAge < 0) {
setBlockState(grid[0][inPos], 3);
_root.soundTimeOut.start(0, 1);
inPos = Math.floor(Math.random() * gridSizeY);
inAge = 100;
}
if (grid[gridSizeX - 1][outPos]._currentframe == 2) {
needUpdateCollapse = 1;
blockCount = blockCount + lightConnected(grid[gridSizeX - 1][outPos], 3);
if (blockCount != 0) {
trace(blockCount + " blocks removed");
if (lastScore != 0) {
_root.soundCombo.start(0, 1);
}
lastScore = lastScore + (100 + Math.pow(blockCount, 2));
trace(Math.round(lastScore / blockCount) + " points per block");
lastCombo = lastCombo + blockCount;
comboTimer = comboTimerMax;
comboDisp = ((lastCombo + " blocks for ") + lastScore) + " points.";
}
inAge = 100;
inPos = Math.floor(Math.random() * gridSizeY);
outPos = Math.floor(Math.random() * gridSizeY);
if (maxTime > minMaxTime) {
maxTime--;
}
}
comboTimer--;
if (comboTimer < 0) {
score = score + lastScore;
lastScore = 0;
lastCombo = 0;
blockCount = 0;
comboDisp = "";
}
if (dispScore < (score - 111)) {
dispScore = dispScore + 111;
} else if (dispScore < score) {
dispScore = score;
}
grid[gridSizeX - 1][outPos].u._visible = 1;
grid[gridSizeX - 1][outPos].d._visible = 1;
grid[gridSizeX - 1][outPos].l._visible = 1;
grid[gridSizeX - 1][outPos].r._visible = 1;
grid[0][inPos].u._visible = 1;
grid[0][inPos].d._visible = 1;
grid[0][inPos].l._visible = 1;
grid[0][inPos].r._visible = 1;
elapsedTime = timer();
if ((savedTime - elapsedTime) > maxTime) {
savedTime = elapsedTime + maxTime;
}
meter._xscale = meter._xscale - ((meter._xscale - (((savedTime - elapsedTime) / maxTime) * 90)) * 0.1);
if (((savedTime - elapsedTime) / maxTime) < 0.3) {
meter.play();
} else {
meter.gotoAndStop(1);
}
if ((savedTime - elapsedTime) <= 0) {
_root.onEnterFrame = undefined;
Mouse.removeListener(mouseListener);
for (var _local3 in grid) {
for (var _local2 in grid[_local3]) {
grid[_local3][_local2].removeMovieClip();
}
}
inarrow.removeMovieClip();
outarrow.removeMovieClip();
fadeOut(_currentframe + 9, "highscores");
}
if (objects > 10000) {
objects = 1;
}
};
var mouseListener = new Object();
mouseListener.onMouseUp = function () {
var _local3 = _root._xmouse;
var _local2 = _root._ymouse;
_local3 = _local3 - (playFieldXPos - (((playFieldXSize / gridSizeX) - playFieldMargin) / 2));
_local2 = _local2 - (playFieldYPos - (((playFieldYSize / gridSizeY) - playFieldMargin) / 2));
_local3 = Math.floor((_local3 / playFieldXSize) * gridSizeX);
_local2 = Math.floor((_local2 / playFieldYSize) * gridSizeY);
trace(((("x: " + _local3) + "\ny: ") + _local2) + newline);
rotateBlock(grid[_local3][_local2], 1);
needUpdateLight = 1;
};
Mouse.addListener(mouseListener);
stop();
Frame 80
btnPlayAgain.onRelease = function () {
fadeOut(_currentframe + 9, "game");
};
btnSubmit.onRelease = function () {
fadeOut(_currentframe + 9, "submit");
};
trace("score: " + score);
trace("dispScore: " + dispScore);
stop();
Frame 90
if (canScore == false) {
gotoAndPlay ("reset");
}
statTrack("submitscores");
scoreService.submitScores(1, scoreName, score);
stop();
Frame 100
statTrack("viewscores");
scoreService.getBestScores(scoreNames, scoreScores, 1, 15);
scoreNumber.text = "";
var i = 0;
while (i < 15) {
scoreNumber.text = scoreNumber.text + ((i + 1) + ".\n");
i++;
}
btnBack.onRelease = function () {
fadeOut(_currentframe + 9, "splash");
};
stop();
Frame 110
stop();
btnPlayAgain.onRelease = function () {
fadeOut(_currentframe + 9, "splash");
};
btnScores.onRelease = function () {
fadeOut(_currentframe + 9, "view");
};
Frame 129
gotoAndPlay ("block");
Symbol 21 MovieClip [fps_meter] Frame 1
#initclip 26
FPS = function () {
this.onEnterFrame = function () {
this.fc++;
};
setInterval(this, "calc", 1000);
};
var p = ((FPS.prototype = new MovieClip()));
p.calc = function () {
this.dp.text = this.fc;
this.fc = 0;
};
Object.registerClass("fps_meter", FPS);
#endinitclip
Symbol 100 MovieClip [__Packages.ScoreService] Frame 0
class ScoreService
{
var service, scoreArray, targetNames, targetScores, broadcastMessage;
function ScoreService () {
mx.remoting.debug.NetDebug.initialize();
AsBroadcaster.initialize(this);
service = new mx.remoting.Service(gatewayUrl, null, "ScoreService");
scoreArray = new Array();
}
function getBestScores(newTargetNames, newTargetScores, gameId, count) {
targetNames = newTargetNames;
targetScores = newTargetScores;
var _local2 = service.getBestScores(gameId, count);
_local2.__set__responder(new mx.rpc.RelayResponder(this, "handleGetBestScores", "handleRemotingError"));
}
function submitScores(gameId, name, score) {
var _local2 = service.submitScores(gameId, name, score);
_local2.__set__responder(new mx.rpc.RelayResponder(this, "handleSubmitScores", "handleRemotingError"));
}
function handleGetBestScores(re) {
var _local3 = re.__get__result().getIterator();
targetNames.text = "";
targetScores.text = "";
while (_local3.hasNext()) {
var _local2 = _local3.next();
scoreArray.push(_local2);
trace(_local2.playername);
targetNames.text = targetNames.text + (_local2.playername + newline);
targetScores.text = targetScores.text + (_local2.score + newline);
}
broadcastMessage("getBestScoresComplete", re);
}
function handleSubmitScores(re) {
broadcastMessage("submitScoresComplete", re.__get__result().currentItem.id);
}
function handleRemotingError(fault) {
mx.remoting.debug.NetDebug.trace({level:"None", message:"Error: " + fault.__get__fault().__get__faultstring()});
broadcastMessage("scoresError", fault.__get__fault().__get__faultstring());
}
var gatewayUrl = "http://www.grapefrukt.com/games/highscores/new/gateway.php";
}
Symbol 101 MovieClip [__Packages.mx.remoting.Service] Frame 0
class mx.remoting.Service extends Object
{
var log, __conn, __serviceName, __responder;
function Service (gatewayURI, logger, serviceName, conn, resp) {
super();
log = logger;
log.logInfo("Creating Service for " + serviceName, mx.services.Log.VERBOSE);
if ((gatewayURI == "") && (conn == null)) {
gatewayURI = mx.remoting.NetServices.gatewayUrl;
}
gatewayURI = mx.remoting.NetServices.getHttpUrl(gatewayURI);
if (conn == null) {
conn = mx.remoting.NetServices.getConnection(gatewayURI);
if (conn == null) {
log.logInfo("Creating gateway connection for " + gatewayURI, mx.services.Log.VERBOSE);
conn = mx.remoting.NetServices.createGatewayConnection(gatewayURI, logger);
}
}
__conn = conn;
conn.updateConfig();
_allowRes = true;
__serviceName = serviceName;
__responder = resp;
log.logInfo("Successfully created Service", mx.services.Log.VERBOSE);
}
function get connection() {
return(__conn);
}
function __resolve(methodName) {
if (_allowRes) {
var _local2 = __makeOpFunc(methodName);
this[methodName] = _local2;
return(_local2);
}
return(null);
}
function __makeOpFunc(name) {
var op = (new mx.remoting.Operation(name, this));
var _local3 = function () {
op.invoke(arguments);
return(op.send());
};
_local3.send = function () {
return(op.createThenSend());
};
_local3.setResponder = function (resp) {
op.responder = resp;
};
_local3.getRequest = function () {
return(op.request);
};
_local3.setRequest = function (val) {
op.request = val;
};
_local3.addProperty("request", _local3.getRequest, _local3.setRequest);
_local3.operation = op;
return(_local3);
}
function get name() {
return(__serviceName);
}
function get responder() {
return(__responder);
}
static var version = "1.2.0.124";
var _allowRes = false;
}
Symbol 102 MovieClip [__Packages.mx.services.Log] Frame 0
class mx.services.Log
{
var level, name;
function Log (logLevel, name) {
level = ((logLevel == undefined) ? (BRIEF) : (logLevel));
this.name = ((name == undefined) ? "" : (name));
}
function logInfo(msg, level) {
if (level == undefined) {
level = BRIEF;
}
if (level <= this.level) {
if (level == DEBUG) {
onLog((((getDateString() + " [DEBUG] ") + name) + ": ") + msg);
} else {
onLog((((getDateString() + " [INFO] ") + name) + ": ") + msg);
}
}
}
function logDebug(msg) {
logInfo(msg, DEBUG);
}
function getDateString() {
var _local1 = new Date();
return(((((((((_local1.getMonth() + 1) + "/") + _local1.getDate()) + " ") + _local1.getHours()) + ":") + _local1.getMinutes()) + ":") + _local1.getSeconds());
}
function onLog(message) {
trace(message);
}
static var NONE = -1;
static var BRIEF = 0;
static var VERBOSE = 1;
static var DEBUG = 2;
}
Symbol 103 MovieClip [__Packages.mx.remoting.Connection] Frame 0
class mx.remoting.Connection extends NetConnection
{
var uri, __urlSuffix, __originalUrl;
function Connection () {
super();
}
function getService(serviceName, client) {
var _local2 = new mx.remoting.NetServiceProxy(this, serviceName, client);
return(_local2);
}
function setCredentials(userId, password) {
addHeader("Credentials", false, {userid:userId, password:password});
}
function clone() {
var _local2 = new mx.remoting.Connection();
_local2.connect(uri);
return(_local2);
}
function getDebugId() {
return(null);
}
function getDebugConfig() {
return(null);
}
function setDebugId(id) {
}
function updateConfig() {
}
function call() {
super.call.apply(super, arguments);
}
function close() {
super.close();
}
function connect(url) {
return(super.connect(url));
}
function addHeader(name, mustUnderstand, obj) {
super.addHeader(name, mustUnderstand, obj);
}
function trace(traceObj) {
}
function AppendToGatewayUrl(urlSuffix) {
__urlSuffix = urlSuffix;
if (__originalUrl == null) {
__originalUrl = uri;
}
var _local2 = __originalUrl + urlSuffix;
connect(_local2);
}
function ReplaceGatewayUrl(newUrl) {
connect(newUrl);
}
function RequestPersistentHeader(info) {
addHeader(info.name, info.mustUnderstand, info.data);
}
static var version = "1.2.0.124";
}
Symbol 104 MovieClip [__Packages.mx.remoting.NetServiceProxy] Frame 0
class mx.remoting.NetServiceProxy extends Object
{
var nc, serviceName, client;
function NetServiceProxy (netC, servName, cli) {
super();
if (netC != null) {
nc = netC;
serviceName = servName;
client = cli;
}
_allowRes = true;
}
function _setParentService(service) {
nc = service.nc;
client = service.client;
}
function __resolve(methodName) {
if (_allowRes) {
var _local3 = function () {
if (this.client != null) {
arguments.unshift(new mx.remoting.NetServiceProxyResponder(this, methodName));
} else if (typeof(arguments[0].onResult) != "function") {
mx.remoting.NetServices.trace("NetServices", "warning", 3, "There is no defaultResponder, and no responder was given in call to " + methodName);
arguments.unshift(new mx.remoting.NetServiceProxyResponder(this, methodName));
}
if (typeof(this.serviceName) == "function") {
this.serviceName = this.servicename;
}
arguments.unshift((this.serviceName + ".") + methodName);
return(this.nc.call.apply(this.nc, arguments));
};
return(_local3);
}
return(null);
}
static function registerNetServiceProxy() {
Object.registerClass("NetServiceProxy", mx.remoting.NetServiceProxy);
return(true);
}
static var init = registerNetServiceProxy();
var _allowRes = false;
}
Symbol 105 MovieClip [__Packages.mx.remoting.NetServiceProxyResponder] Frame 0
class mx.remoting.NetServiceProxyResponder extends Object
{
var service, methodName;
function NetServiceProxyResponder (serv, method) {
super();
service = serv;
methodName = method;
}
function onResult(result) {
var _local2 = service.client;
if ((result instanceof mx.remoting.NetServiceProxy) || (result instanceof mx.remoting.RecordSet)) {
result._setParentService(service);
}
var _local4 = methodName + "_Result";
if (typeof(_local2[_local4]) == "function") {
_local2[_local4].apply(_local2, [result]);
} else if (typeof(_local2.onResult) == "function") {
_local2.onResult(result);
} else {
mx.remoting.NetServices.trace("NetServices", "info", 1, (_local4 + " was received from server: ") + result);
}
}
function onStatus(result) {
var _local4 = service.client;
var _local6 = methodName + "_Status";
if (typeof(_local4[_local6]) == "function") {
_local4[_local6].apply(_local4, [result]);
} else if (typeof(_local4.onStatus) == "function") {
_local4.onStatus(result);
} else if (typeof(_root.onStatus) == "function") {
_root.onStatus(result);
} else if (typeof(_global.System.onStatus) == "function") {
_global.System.onStatus(result);
} else {
mx.remoting.NetServices.trace("NetServices", "info", 2, (((_local6 + " was received from server: <") + result.level) + "> ") + result.description);
}
}
}
Symbol 106 MovieClip [__Packages.mx.data.PageableData] Frame 0
interface mx.data.PageableData
{
}
Symbol 107 MovieClip [__Packages.mx.data.DataRange] Frame 0
interface mx.data.DataRange
{
}
Symbol 108 MovieClip [__Packages.mx.data.PageableList] Frame 0
interface mx.data.PageableList extends mx.data.PageableData
{
}
Symbol 109 MovieClip [__Packages.mx.remoting.RecordSet] Frame 0
class mx.remoting.RecordSet extends Object implements mx.data.PageableList
{
var _items, uniqueID, mTitles, serverInfo, serverinfo, mRecordsAvailable, mRecordSetID, serviceName, mTotalCount, mDeliveryMode, mAllNotified, mOutstandingRecordCount, dispatchEvent, mPageSize, mNumPrefetchPages, mRecordSetService, gateway_conn, logger, mDataFetcher;
function RecordSet (columnNames) {
super();
mx.events.EventDispatcher.initialize(this);
_items = new Array();
uniqueID = 0;
if (mTitles != null) {
return;
}
if (serverInfo == null) {
if (serverinfo != null) {
serverInfo = serverinfo;
}
}
if (serverInfo == null) {
mTitles = columnNames;
return;
}
if (serverInfo.version != 1) {
mx.remoting.NetServices.trace("RecordSet", "warning", 100, "Received incompatible RecordSet version from server");
return;
}
mTitles = serverInfo.columnNames;
mRecordsAvailable = 0;
setData(((serverInfo.cursor == null) ? 0 : (serverInfo.cursor - 1)), serverInfo.initialData);
if (serverInfo.initialData.length != serverInfo.totalCount) {
mRecordSetID = serverInfo.id;
if (mRecordSetID != null) {
serviceName = ((serverInfo.serviceName == null) ? "RecordSet" : (serverInfo.serviceName));
mTotalCount = serverInfo.totalCount;
mDeliveryMode = "ondemand";
mAllNotified = false;
mOutstandingRecordCount = 0;
} else {
mx.remoting.NetServices.trace("RecordSet", "warning", 102, "Missing some records, but there's no RecordSet id");
}
}
serverInfo = null;
}
function addItem(item) {
addItemAt(length, item);
}
function addItemAt(index, item) {
var _local3 = true;
if ((index < length) && (index >= 0)) {
items.splice(index, 0, item);
} else if (index == length) {
items[index] = item;
} else {
_local3 = false;
mx.remoting.NetServices.trace("Cannot add an item outside the bounds of the RecordSet");
return(undefined);
}
if (_local3) {
item.__ID__ = uniqueID++;
}
updateViews("addItems", index, index);
}
function addEventListener(event, listener) {
}
function clear() {
if (checkLocal()) {
return(undefined);
}
var _local2 = items.length;
items.splice(0);
uniqueID = 0;
updateViews("removeItems", 0, _local2);
}
function contains(itmToCheck) {
if (isObjectEmpty(itmToCheck)) {
return(false);
}
var _local5;
var _local4;
var _local2 = 0;
while (_local2 < items.length) {
_local5 = items[_local2];
_local4 = true;
for (var _local6 in itmToCheck) {
if (itmToCheck[_local6] != _local5[_local6]) {
_local4 = false;
break;
}
}
if (_local4) {
return(true);
}
_local2++;
}
return(false);
}
function getColumnNames() {
return(mTitles);
}
function get columnNames() {
return(getColumnNames());
}
function getLocalLength() {
return(items.length);
}
function getLength() {
if (mRecordSetID != null) {
return(mTotalCount);
}
return(items.length);
}
function getIterator() {
var _local2 = new mx.remoting.RecordSetIterator(this);
return(_local2);
}
function get length() {
return(getLength());
}
function getItemAt(index) {
if ((index < 0) || (index >= length)) {
return(null);
}
if (mRecordSetID == null) {
return(items[index]);
}
requestRecord(index);
var _local3 = items[index];
if (_local3 == 1) {
return("in progress");
}
return(_local3);
}
function getItemID(index) {
return(items[index].__ID__);
}
function get items() {
return(_items);
}
function initialize(info) {
}
function filter(filterFunction, context) {
if (checkLocal()) {
return(undefined);
}
var _local4 = new mx.remoting.RecordSet(mTitles);
var _local5 = length;
var _local3 = 0;
while (_local3 < _local5) {
var _local2 = getItemAt(_local3);
if (((_local2 != null) && (_local2 != 1)) && (filterFunction(_local2, context))) {
_local4.addItem(_local2);
}
_local3++;
}
return(_local4);
}
function sortItems(compareFunc, optionFlags) {
if (checkLocal()) {
return(undefined);
}
items.sort(compareFunc, optionFlags);
updateViews("sort");
}
function sortItemsBy(fieldNames, order, optionFlags) {
if (checkLocal()) {
return(undefined);
}
if (typeof(order) == "string") {
items.sortOn(fieldNames);
if (order.toUpperCase() == "DESC") {
items.reverse();
}
} else {
items.sortOn(fieldNames, optionFlags);
}
updateViews("sort");
}
function sort(compareFunc) {
if (checkLocal()) {
return(undefined);
}
items.sort(compareFunc);
updateViews("sort");
}
function isEmpty() {
return(items.length == 0);
}
function isLocal() {
return(mRecordSetID == null);
}
function isFullyPopulated() {
return(isLocal());
}
function getRemoteLength() {
if (isLocal()) {
return(mRecordsAvailable);
}
return(mTotalCount);
}
function getNumberAvailable() {
if (isLocal()) {
return(getLength());
}
return(mRecordsAvailable);
}
function replaceItemAt(index, item) {
if ((index >= 0) && (index <= length)) {
var _local3 = getItemID(index);
items[index] = item;
items[index].__ID__ = _local3;
updateViews("updateItems", index, index);
}
}
function removeAll() {
clear();
}
function removeItemAt(index) {
var _local3 = _items[index];
_items.splice(index, 1);
var _local5 = [_items[index]];
var _local4 = [getItemID(index)];
dispatchEvent({type:"modelChanged", eventName:"removeItems", firstItem:index, lastItem:index, removedItems:_local5, removedIDs:_local4});
return(_local3);
}
function removeEventListener(event, listener) {
}
function requestRange(range) {
var _local2 = range.getStart();
var _local3 = range.getEnd();
return(internalRequestRange(_local2, _local3));
}
function setDeliveryMode(mode, pagesize, numPrefetchPages) {
mDeliveryMode = mode.toLowerCase();
stopFetchAll();
if ((pagesize == null) || (pagesize <= 0)) {
pagesize = 25;
}
switch (mDeliveryMode) {
case "ondemand" :
break;
case "page" :
if (numPrefetchPages == null) {
numPrefetchPages = 0;
}
mPageSize = pagesize;
mNumPrefetchPages = numPrefetchPages;
break;
case "fetchall" :
stopFetchAll();
startFetchAll(pagesize);
break;
default :
mx.remoting.NetServices.trace("RecordSet", "warning", 107, "SetDeliveryMode: unknown mode string");
}
}
function editField(index, fieldName, value) {
changeFieldValue(index, fieldName, value);
}
function getEditingData(index, fieldName) {
return(items[index][fieldName]);
}
function setField(index, fieldName, value) {
changeFieldValue(index, fieldName, value);
}
function changeFieldValue(index, fieldName, value) {
if (checkLocal()) {
return(undefined);
}
if ((index < 0) || (index >= getLength())) {
return(undefined);
}
items[index][fieldName] = value;
updateViews("updateItems", index, index);
}
function isObjectEmpty(objToCheck) {
var _local1 = true;
for (var _local3 in objToCheck) {
_local1 = false;
return(_local1);
}
return(_local1);
}
function arrayToObject(anArray) {
if (mTitles == null) {
mx.remoting.NetServices.trace("RecordSet", "warning", 105, "getItem: titles are not available");
return(null);
}
var _local4 = new Object();
var _local5 = anArray.length;
var _local3;
var _local2 = 0;
while (_local2 < _local5) {
_local3 = mTitles[_local2];
if (_local3 == null) {
_local3 = ("column" + _local2) + 1;
}
_local4[_local3] = anArray[_local2];
_local2++;
}
return(_local4);
}
function checkLocal() {
if (isLocal()) {
return(false);
}
mx.remoting.NetServices.trace("RecordSet", "warning", 108, "Operation not allowed on partial recordset");
return(true);
}
function getRecordSetService() {
if (mRecordSetService == null) {
if (gateway_conn == null) {
gateway_conn = mx.remoting.NetServices.createGatewayConnection();
} else if (_global.netDebugInstance != undefined) {
gateway_conn = gateway_conn.clone();
}
if (_global.netDebugInstance != undefined) {
gateway_conn.setupRecordSet();
gateway_conn.setDebugId("RecordSet " + mRecordSetID);
}
mRecordSetService = gateway_conn.getService(serviceName, this);
if (mRecordSetService == null) {
mx.remoting.NetServices.trace("RecordSet", "warning", 101, "Failed to create RecordSet service");
mRecordSetService = null;
}
}
return(mRecordSetService);
}
function internalRequestRange(index, lastIndex) {
var _local6 = -1;
if (index < 0) {
index = 0;
}
if (lastIndex >= getRemoteLength()) {
lastIndex = getRemoteLength() - 1;
}
var _local3;
var _local4;
while (index <= lastIndex) {
while ((index <= lastIndex) && (items[index] != null)) {
index++;
}
_local3 = index;
while ((index <= lastIndex) && (items[index] == null)) {
mOutstandingRecordCount++;
items[index] = 1;
index++;
}
_local4 = index - 1;
if (_local3 <= _local4) {
logger.logInfo((((" Fetching records from index [" + _local3) + "] to index [") + _local4) + "]");
getRecordSetService().getRecords(mRecordSetID, _local3 + 1, (_local4 - _local3) + 1);
_local6 = _local4;
updateViews("fetchRows", _local3, _local4);
}
}
return(_local6);
}
function removeItems(index, len) {
var _local3 = new Array();
var _local2 = 0;
while (_local2 < len) {
_local3.push(getItemID(index + _local2));
_local2++;
}
var _local6 = items.splice(index, len);
dispatchEvent({type:"modelChanged", eventName:"removeItems", firstItem:index, lastItem:(index + len) - 1, removedItems:_local6, removedIDs:_local3});
}
function getRecords_Result(info) {
setData(info.Cursor - 1, info.Page);
mOutstandingRecordCount = mOutstandingRecordCount - info.Page.length;
updateViews("updateItems", info.Cursor - 1, ((info.Cursor - 1) + info.Page.length) - 1);
if ((mRecordsAvailable == mTotalCount) && (!mAllNotified)) {
updateViews("allRows");
mRecordSetService.release();
mAllNotified = true;
mRecordSetID = null;
mRecordSetService = null;
}
}
function release_Result() {
}
function requestOneRecord(index) {
if (items[index] == null) {
if (mDeliveryMode == "ondemand") {
logger.logInfo((" INFO: Fetching Record [" + index) + "]");
}
getRecordSetService().getRecords(mRecordSetID, index + 1, 1);
mOutstandingRecordCount++;
items[index] = 1;
updateViews("fetchRows", index, index);
}
}
function requestRecord(index) {
if (mDeliveryMode != "page") {
requestOneRecord(index);
} else {
var _local2 = int(index / mPageSize) * mPageSize;
var _local3 = (_local2 + (mPageSize * (mNumPrefetchPages + 1))) - 1;
internalRequestRange(_local2, _local3);
}
}
function _setParentService(service) {
gateway_conn = service.nc;
}
function setData(start, dataArray) {
var _local5 = dataArray.length;
var _local3;
var _local4;
var _local2 = 0;
while (_local2 < _local5) {
_local3 = _local2 + start;
_local4 = items[_local3];
if ((_local4 != null) && (_local4 != 1)) {
mx.remoting.NetServices.trace("RecordSet", "warning", 106, "Already got record # " + _local3);
} else {
mRecordsAvailable = mRecordsAvailable + 1;
}
items[_local3] = arrayToObject(dataArray[_local2]);
items[_local3].__ID__ = uniqueID++;
_local2++;
}
}
function startFetchAll(pagesize) {
if (mDataFetcher != null) {
mDataFetcher.disable();
}
mDataFetcher = new mx.remoting.RsDataFetcher(this, pagesize);
}
function stopFetchAll() {
mDataFetcher.disable();
mDataFetcher = null;
}
function updateViews(event, first, last) {
dispatchEvent({type:"modelChanged", eventName:event, firstItem:first, lastItem:last});
}
static function registerRecordSet() {
Object.registerClass("RecordSet", mx.remoting.RecordSet);
return(true);
}
static var version = "1.2.0.124";
static var init = registerRecordSet();
}
Symbol 110 MovieClip [__Packages.mx.events.EventDispatcher] Frame 0
class mx.events.EventDispatcher
{
function EventDispatcher () {
}
static function _removeEventListener(queue, event, handler) {
if (queue != undefined) {
var _local4 = queue.length;
var _local1;
_local1 = 0;
while (_local1 < _local4) {
var _local2 = queue[_local1];
if (_local2 == handler) {
queue.splice(_local1, 1);
return(undefined);
}
_local1++;
}
}
}
static function initialize(object) {
if (_fEventDispatcher == undefined) {
_fEventDispatcher = new mx.events.EventDispatcher();
}
object.addEventListener = _fEventDispatcher.addEventListener;
object.removeEventListener = _fEventDispatcher.removeEventListener;
object.dispatchEvent = _fEventDispatcher.dispatchEvent;
object.dispatchQueue = _fEventDispatcher.dispatchQueue;
}
function dispatchQueue(queueObj, eventObj) {
var _local7 = "__q_" + eventObj.type;
var _local4 = queueObj[_local7];
if (_local4 != undefined) {
var _local5;
for (_local5 in _local4) {
var _local1 = _local4[_local5];
var _local3 = typeof(_local1);
if ((_local3 == "object") || (_local3 == "movieclip")) {
if (_local1.handleEvent != undefined) {
_local1.handleEvent(eventObj);
}
if (_local1[eventObj.type] != undefined) {
if (exceptions[eventObj.type] == undefined) {
_local1[eventObj.type](eventObj);
}
}
} else {
_local1.apply(queueObj, [eventObj]);
}
}
}
}
function dispatchEvent(eventObj) {
if (eventObj.target == undefined) {
eventObj.target = this;
}
this[eventObj.type + "Handler"](eventObj);
dispatchQueue(this, eventObj);
}
function addEventListener(event, handler) {
var _local3 = "__q_" + event;
if (this[_local3] == undefined) {
this[_local3] = new Array();
}
_global.ASSetPropFlags(this, _local3, 1);
_removeEventListener(this[_local3], event, handler);
this[_local3].push(handler);
}
function removeEventListener(event, handler) {
var _local2 = "__q_" + event;
_removeEventListener(this[_local2], event, handler);
}
static var _fEventDispatcher = undefined;
static var exceptions = {move:1, draw:1, load:1};
}
Symbol 111 MovieClip [__Packages.mx.remoting.NetServices] Frame 0
class mx.remoting.NetServices extends Object
{
static var defaultGatewayUrl, logger, traceNetServices;
function NetServices () {
super();
}
static function setDefaultGatewayUrl(url) {
defaultGatewayUrl = url;
}
static function setGatewayUrl(url) {
gatewayUrl = url;
}
static function createGatewayConnection(url, infoLogger) {
logger = infoLogger;
if (url == undefined) {
url = gatewayUrl;
if (url == undefined) {
url = defaultGatewayUrl;
}
}
if (url == undefined) {
trace("NetServices", "warning", 4, "createGatewayConnection - gatewayUrl is undefined");
logger.logInfo(("NetServices: createGatewayConnection - gateway url <" + url) + "> is undefined", mx.services.Log.DEBUG);
return(null);
}
var _local2 = new mx.remoting.Connection();
_local2.connect(url);
__sharedConnections[url] = _local2;
return(_local2);
}
static function getConnection(uri) {
return(__sharedConnections[uri]);
}
static function getHostUrl() {
if (!isHttpUrl(_root._url)) {
trace("NetServices", "warning", 4, "createGatewayConnection - gatewayUrl is invalid");
return(null);
}
var _local2 = _root._url.indexOf("/", 8);
if (_local2 < 0) {
trace("NetServices", "warning", 4, "createGatewayConnection - gatewayUrl is invalid");
return(null);
}
return(_root._url.substring(0, _local2));
}
static function isHttpUrl(url) {
return((url.indexOf("http://") == 0) || (url.indexOf("https://") == 0));
}
static function getHttpUrl(url) {
if (!isHttpUrl(url)) {
url = getHostUrl() + url;
}
return(url);
}
static function trace(who, severity, number, message) {
traceNetServices(who, severity, number, message);
}
static var version = "1.2.0.124";
static var gatewayUrl = _root.gatewayUrl;
static var __sharedConnections = new Array();
}
Symbol 112 MovieClip [__Packages.mx.utils.Iterator] Frame 0
interface mx.utils.Iterator
{
}
Symbol 113 MovieClip [__Packages.mx.remoting.RecordSetIterator] Frame 0
class mx.remoting.RecordSetIterator implements mx.utils.Iterator
{
var _recordSet, _cursor;
function RecordSetIterator (rec) {
_recordSet = rec;
_cursor = 0;
}
function hasNext() {
return(_cursor < _recordSet.getLength());
}
function next() {
return(_recordSet.getItemAt(_cursor++));
}
static var version = "1.2.0.124";
}
Symbol 114 MovieClip [__Packages.mx.remoting.RsDataFetcher] Frame 0
class mx.remoting.RsDataFetcher extends Object
{
var mRecordSet, mIncrement, mNextRecord, mEnabled, mHighestRequested;
function RsDataFetcher (pgRS, increment) {
super();
mRecordSet = pgRS;
mRecordSet.addEventListener("modelChanged", this);
mIncrement = increment;
mNextRecord = 0;
mEnabled = true;
doNext();
}
function disable() {
mEnabled = false;
}
function doNext() {
if (mEnabled) {
while (true) {
if (mNextRecord >= mRecordSet.getRemoteLength()) {
return(undefined);
}
var _local2 = new mx.remoting.RsDataRange(mNextRecord, (mNextRecord + mIncrement) - 1);
mHighestRequested = mRecordSet.requestRange(_local2);
mNextRecord = mNextRecord + mIncrement;
if (mHighestRequested > 0) {
return(undefined);
}
}
}
}
function modelChanged(eventObj) {
if (((eventObj.eventName == "updateItems") && (eventObj.firstItem <= mHighestRequested)) && (eventObj.lastItem >= mHighestRequested)) {
doNext();
}
if (eventObj.eventName == "allRows") {
disable();
}
}
}
Symbol 115 MovieClip [__Packages.mx.remoting.RsDataRange] Frame 0
class mx.remoting.RsDataRange extends Object implements mx.data.DataRange
{
var _start, _end;
function RsDataRange (s, e) {
super();
_start = s;
_end = e;
}
function getStart() {
return(_start);
}
function getEnd() {
return(_end);
}
function setEnd(e) {
_end = e;
}
function setStart(s) {
_start = s;
}
}
Symbol 116 MovieClip [__Packages.mx.rpc.Responder] Frame 0
interface mx.rpc.Responder
{
}
Symbol 117 MovieClip [__Packages.mx.rpc.ResultEvent] Frame 0
class mx.rpc.ResultEvent extends Object
{
var __result;
function ResultEvent (res) {
super();
__result = res;
}
function get result() {
return(__result);
}
}
Symbol 118 MovieClip [__Packages.mx.rpc.FaultEvent] Frame 0
class mx.rpc.FaultEvent extends Object
{
var __fault;
function FaultEvent (f) {
super();
__fault = f;
}
function get fault() {
return(__fault);
}
}
Symbol 119 MovieClip [__Packages.mx.rpc.Fault] Frame 0
class mx.rpc.Fault extends Object
{
var __faultcode, __faultstring, __detail, __type, __description;
function Fault (code, msg, detail, type) {
super();
__faultcode = code;
__faultstring = msg;
__detail = detail;
__type = type;
}
function get faultcode() {
return(__faultcode);
}
function get faultstring() {
return(__faultstring);
}
function get detail() {
return(__detail);
}
function get description() {
if (__description == null) {
if (__faultstring.indexOf(":") > -1) {
__description = __faultstring.substring(__faultstring.indexOf(":") + 1);
var _local2 = 0;
while (__description.indexOf(" ", _local2) == _local2) {
_local2++;
}
if (_local2 > 0) {
__description = __description.substring(_local2);
}
} else {
__description = __faultstring;
}
}
return(__description);
}
function get type() {
return(__type);
}
}
Symbol 120 MovieClip [__Packages.mx.remoting.Operation] Frame 0
class mx.remoting.Operation
{
var __service, __responder, __methodName, __invokationName, __request, __arguments;
function Operation (methodName, parent) {
__service = parent;
__responder = parent.responder;
__methodName = methodName;
__invokationName = (__service.__get__name() + ".") + methodName;
__request = new Object();
__arguments = new Array();
}
function createThenSend(Void) {
createArguments();
return(send());
}
function send(Void) {
__service.log.logInfo((("Invoking " + __methodName) + " on ") + __service.__get__name());
var _local3 = new mx.remoting.PendingCall(__service, __methodName);
_local3.__set__responder(__responder);
var _local2 = null;
if (__arguments == null) {
_local2 = new Array();
} else {
_local2 = __arguments.concat();
}
__invokationName = (__service.__get__name() + ".") + __methodName;
_local2.unshift(__invokationName, _local3);
__service.__get__connection().call.apply(__service.__get__connection(), _local2);
return(_local3);
}
function invoke(a) {
__arguments = a;
}
function get responder() {
return(__responder);
}
function set responder(r) {
__responder = r;
//return(responder);
}
function get request() {
return(__request);
}
function set request(r) {
__request = r;
//return(request);
}
function get name() {
return(__methodName);
}
function createArguments() {
if (__request != null) {
__arguments = new Array();
for (var _local2 in __request) {
if (_local2 != "arguments") {
__arguments.unshift(__request[_local2]);
}
}
}
}
}
Symbol 121 MovieClip [__Packages.mx.remoting.PendingCall] Frame 0
class mx.remoting.PendingCall extends Object
{
var __service, __methodName, __responder;
function PendingCall (srv, methodName) {
super();
__service = srv;
__methodName = methodName;
}
function get responder() {
return(__responder);
}
function set responder(res) {
__responder = res;
//return(responder);
}
function onResult(result) {
result.serviceName = result.serviceName;
if (result != null) {
if (result instanceof mx.remoting.NetServiceProxy) {
var _local4 = new mx.remoting.Service(null, null, result.serviceName, __service.__get__connection(), __service.__get__responder());
result = _local4;
} else if (result instanceof mx.remoting.RecordSet) {
var _local3 = new mx.remoting.NetServiceProxy(__service.__get__connection());
result._setParentService(_local3);
result.logger = __service.log;
}
}
if (__responder != null) {
__responder.onResult(new mx.rpc.ResultEvent(result));
}
if (__service.log != null) {
__service.log.logInfo((((__service.__get__name() + ".") + __methodName) + "() returned ") + mx.data.binding.ObjectDumper.toString(result));
}
}
function onStatus(status) {
if (__responder != null) {
__responder.onFault(new mx.rpc.FaultEvent(new mx.rpc.Fault(status.code, status.description, status.details, status.type)));
}
if (__service.log != null) {
__service.log.logDebug("Service invocation failed.");
__service.log.logDebug((((__service.__get__name() + ".") + __methodName) + "() returned ") + mx.data.binding.ObjectDumper.toString(status));
}
}
function get methodName() {
return(__methodName);
}
static var inited = mx.remoting.NetServiceProxy.registerNetServiceProxy();
}
Symbol 122 MovieClip [__Packages.mx.data.binding.ObjectDumper] Frame 0
class mx.data.binding.ObjectDumper
{
var inProgress;
function ObjectDumper () {
inProgress = new Array();
}
static function toString(obj, showFunctions, showUndefined, showXMLstructures, maxLineLength, indent) {
var _local3 = new mx.data.binding.ObjectDumper();
if (maxLineLength == undefined) {
maxLineLength = 100;
}
if (indent == undefined) {
indent = 0;
}
return(_local3.realToString(obj, showFunctions, showUndefined, showXMLstructures, maxLineLength, indent));
}
function realToString(obj, showFunctions, showUndefined, showXMLstructures, maxLineLength, indent) {
var _local8 = 0;
while (_local8 < inProgress.length) {
if (inProgress[_local8] == obj) {
return("***");
}
_local8++;
}
inProgress.push(obj);
indent++;
var _local16 = typeof(obj);
var _local5;
if ((obj instanceof XMLNode) && (showXMLstructures != true)) {
_local5 = obj.toString();
} else if (obj instanceof Date) {
_local5 = obj.toString();
} else if (_local16 == "object") {
var _local4 = new Array();
if (obj instanceof Array) {
_local5 = "[";
var _local15 = 0;
while (_local15 < obj.length) {
_local4.push(_local15);
_local15++;
}
} else {
_local5 = "{";
for (var _local15 in obj) {
_local4.push(_local15);
}
_local4.sort();
}
var _local9 = "";
var _local3 = 0;
while (_local3 < _local4.length) {
var _local6 = obj[_local4[_local3]];
var _local7 = true;
if (typeof(_local6) == "function") {
_local7 = showFunctions == true;
}
if (typeof(_local6) == "undefined") {
_local7 = showUndefined == true;
}
if (_local7) {
_local5 = _local5 + _local9;
if (!(obj instanceof Array)) {
_local5 = _local5 + (_local4[_local3] + ": ");
}
_local5 = _local5 + realToString(_local6, showFunctions, showUndefined, showXMLstructures, maxLineLength, indent);
_local9 = ", `";
}
_local3++;
}
if (obj instanceof Array) {
_local5 = _local5 + "]";
} else {
_local5 = _local5 + "}";
}
} else if (_local16 == "function") {
_local5 = "function";
} else if (_local16 == "string") {
_local5 = ("\"" + obj) + "\"";
} else {
_local5 = String(obj);
}
if (_local5 == "undefined") {
_local5 = "-";
}
inProgress.pop();
return(replaceAll(_local5, "`", ((_local5.length < maxLineLength) ? "" : (newline + doIndent(indent)))));
}
static function replaceAll(str, from, to) {
var _local3 = str.split(from);
var _local4 = "";
var _local2 = "";
var _local1 = 0;
while (_local1 < _local3.length) {
_local4 = _local4 + (_local2 + _local3[_local1]);
_local2 = to;
_local1++;
}
return(_local4);
}
function doIndent(indent) {
var _local2 = "";
var _local1 = 0;
while (_local1 < indent) {
_local2 = _local2 + " ";
_local1++;
}
return(_local2);
}
}
Symbol 123 MovieClip [__Packages.mx.rpc.RelayResponder] Frame 0
class mx.rpc.RelayResponder extends Object implements mx.rpc.Responder
{
var __obj, __onFault, __onResult;
function RelayResponder (resp, resultFunc, faultFunc) {
super();
__obj = resp;
__onFault = faultFunc;
__onResult = resultFunc;
}
function onFault(fault) {
__obj[__onFault](fault);
}
function onResult(result) {
__obj[__onResult](result);
}
}
Symbol 124 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function showPreloaderAd(options) {
var _local29 = {clip:_root, ad_msec:11000, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812};
options = _parseOptions(options, _local29);
var _local15 = options.clip;
var _local25 = options.ad_msec;
delete options.ad_msec;
var _local28 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
return(null);
}
_local15.stop();
var mc = _local15._mochiad;
mc.onUnload = function () {
this._parent.play();
};
var _local16 = _getRes(options);
var _local5 = _local16[0];
var _local14 = _local16[1];
mc._x = _local5 * 0.5;
mc._y = _local14 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local5 * -0.5;
chk._y = _local14 * -0.5;
var _local8 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local8._x = 10;
_local8._y = _local14 - 20;
var _local24 = options.color;
delete options.color;
var _local21 = options.background;
delete options.background;
var _local26 = options.outline;
delete options.outline;
var _local6 = _local8.createEmptyMovieClip("_outline", 1);
_local6.beginFill(_local21);
_local6.moveTo(0, 0);
_local6.lineTo(_local5 - 20, 0);
_local6.lineTo(_local5 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
_local6.endFill();
var _local4 = _local8.createEmptyMovieClip("_inside", 2);
_local4.beginFill(_local24);
_local4.moveTo(0, 0);
_local4.lineTo(_local5 - 20, 0);
_local4.lineTo(_local5 - 20, 10);
_local4.lineTo(0, 10);
_local4.lineTo(0, 0);
_local4.endFill();
_local4._xscale = 0;
var _local7 = _local8.createEmptyMovieClip("_outline", 3);
_local7.lineStyle(0, _local26, 100);
_local7.moveTo(0, 0);
_local7.lineTo(_local5 - 20, 0);
_local7.lineTo(_local5 - 20, 10);
_local7.lineTo(0, 10);
_local7.lineTo(0, 0);
chk.ad_msec = _local25;
chk.ad_timeout = _local28;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local12 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local10 = (100 * _local8) / _local4;
var _local11 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local2 = Math.min(100, Math.min(_local10 || 0, _local11));
_local2 = Math.max(this.last_pcnt, _local2);
this.last_pcnt = _local2;
_local9._xscale = _local2;
if (!chk.showing) {
var _local7 = _local12.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local5 > chk.ad_timeout) {
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showTimedAd(options) {
var _local15 = {clip:_root, ad_msec:11000, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd"};
options = _parseOptions(options, _local15);
var _local6 = options.clip;
var _local12 = options.ad_msec;
delete options.ad_msec;
var _local14 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
return(null);
}
_local6.stop();
var mc = _local6._mochiad;
mc.onUnload = function () {
this._parent.play();
};
var _local7 = _getRes(options);
var _local16 = _local7[0];
var _local13 = _local7[1];
mc._x = _local16 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local12;
chk.ad_timeout = _local14;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function load(options) {
var _local14 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local14);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = "1.3";
var _local7 = options.clip;
if (!_isNetworkAvailable()) {
return(false);
}
if (_local7._mochiad_loaded) {
return(false);
}
var _local13 = options.depth;
delete options.depth;
var _local6 = _local7.createEmptyMovieClip("_mochiad", _local13);
var _local12 = _getRes(options);
options.res = (_local12[0] + "x") + _local12[1];
options.server = options.server + options.id;
delete options.id;
_local7._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
if (_local7._url.indexOf("http") != 0) {
options.no_page = true;
}
var _local11 = _local4.server;
delete _local4.server;
var _local10 = _local11.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local10);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local10);
}
}
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local9 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local9;
_local5.hostname = _local10;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local9);
_local6.lc = _local5;
_local4.lc = _local9;
_local4.st = getTimer();
_local4.loadMovie(_local11 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local4);
}
}