Frame 1
com.lumoslabs.games.lostinmigration.LostInMigrationContainer.main();
Symbol 143 MovieClip [feedback_neg_mc] Frame 16
stop();
Symbol 158 MovieClip Frame 1
play();
Symbol 158 MovieClip Frame 21
stop();
Symbol 161 MovieClip Frame 1
stop();
Symbol 161 MovieClip Frame 2
stop();
Symbol 161 MovieClip Frame 3
play();
Symbol 178 MovieClip Frame 16
stop();
Symbol 254 MovieClip [__Packages.com.lumoslabs.framework.ManagedGame] Frame 0
interface com.lumoslabs.framework.ManagedGame
{
}
Symbol 255 MovieClip [__Packages.com.lumoslabs.framework.GameManager] Frame 0
interface com.lumoslabs.framework.GameManager
{
}
Symbol 256 MovieClip [__Packages.com.lumoslabs.games.GameContainer] Frame 0
class com.lumoslabs.games.GameContainer implements com.lumoslabs.framework.ManagedGame
{
var target_mc, depth, xLoc, yLoc, container_mc, settings, game, manager;
function GameContainer (target_mc, depth, x, y) {
Stage.align = "TL";
Stage.scaleMode = "noScale";
this.target_mc = target_mc;
this.depth = depth;
xLoc = x;
yLoc = y;
setupContainerClip();
setDefaults();
com.lumoslabs.framework.GameRegistrar.registerGame(this);
}
function setupContainerClip() {
container_mc.onEnterFrame = undefined;
delete container_mc.onEnterFrame;
container_mc.removeMovieClip();
container_mc = target_mc.createEmptyMovieClip("container_mc", depth);
container_mc._x = xLoc;
container_mc._y = yLoc;
}
function setDefaults() {
}
function init(obj) {
initGame(obj);
}
function initGame(obj) {
}
function update(o, infoObj) {
if (infoObj instanceof com.lumoslabs.games.PlayEvent) {
reportPlay();
} else if (infoObj instanceof com.lumoslabs.games.HelpEvent) {
reportReset();
} else if (infoObj instanceof com.lumoslabs.games.FinalFinish) {
reportQuit();
} else if (infoObj instanceof com.lumoslabs.games.PromoEvent) {
reportPromo();
}
}
function fetchData(obj) {
}
function finish(obj, str) {
trace("GameContainer: Passing data");
reportData(obj);
}
function addSettings(gameSettings) {
trace("GameContainer: Adding settings");
settings = gameSettings;
}
function start() {
initGame(settings);
}
function help() {
game.help();
}
function mute() {
game.toggleMute();
}
function pause() {
game.togglePause();
}
function registerManager(newManager) {
manager = newManager;
}
function removeManager() {
delete manager;
}
function isPausable() {
return(_isPausable);
}
function isFullScreen() {
return(_isFullScreen);
}
function destroy() {
}
function reportPlay() {
manager.onPlay(this);
}
function reportData(gameData) {
manager.onData(this, gameData);
}
function reportReset() {
manager.onReset(this);
}
function reportQuit() {
trace("GameContainer: Calling report quit");
manager.onQuit(this);
}
function reportPromo() {
manager.onPromo(this);
}
var _isPausable = false;
var _isFullScreen = false;
var result = new Object();
}
Symbol 257 MovieClip [__Packages.com.lumoslabs.util.Observable] Frame 0
class com.lumoslabs.util.Observable
{
var observers;
function Observable () {
observers = new Array();
}
function addObserver(o) {
if (o == null) {
return(false);
}
var _local2 = 0;
while (_local2 < observers.length) {
if (observers[_local2] == o) {
return(false);
}
_local2++;
}
observers.push(o);
return(true);
}
function removeObserver(o) {
var _local3 = observers.length;
var _local2 = 0;
while (_local2 < _local3) {
if (observers[_local2] == o) {
observers.splice(_local2, 1);
return(true);
}
_local2++;
}
return(false);
}
function notifyObservers(infoObj) {
if (infoObj == undefined) {
infoObj = null;
}
if (!changed) {
return(undefined);
}
var _local3 = observers.slice(0);
clearChanged();
var _local2 = _local3.length - 1;
while (_local2 >= 0) {
_local3[_local2].update(this, infoObj);
_local2--;
}
}
function clearObservers() {
observers = new Array();
}
function setChanged() {
changed = true;
}
function clearChanged() {
changed = false;
}
function hasChanged() {
return(changed);
}
function countObservers() {
return(observers.length);
}
function getObservers() {
return(observers.slice(0));
}
var changed = false;
}
Symbol 258 MovieClip [__Packages.com.lumoslabs.util.Observer] Frame 0
interface com.lumoslabs.util.Observer
{
}
Symbol 259 MovieClip [__Packages.com.lumoslabs.games.Game] Frame 0
class com.lumoslabs.games.Game extends com.lumoslabs.util.Observable
{
var score, level, running, levelChanged, setChanged, bestScore, finalScoresArray, lives, trialsRemaining, startTime, notifyObservers, soundEffects;
function Game () {
super();
score = 0;
level = 0;
running = false;
levelChanged = false;
}
function addPoints(points) {
newPoints = points;
score = score + newPoints;
if (score < 0) {
score = 0;
}
setChanged();
doUpdate();
}
function getLevel() {
return(level);
}
function getLevelChanged() {
return(levelChanged);
}
function getScore() {
return(score);
}
function updateBestScore() {
if ((score > bestScore) || (isNaN(bestScore))) {
bestScore = score;
}
}
function getBestScore() {
return(bestScore);
}
function pushFinalScore() {
if (finalScoresArray == null) {
finalScoresArray = new Array();
}
finalScoresArray.push(score);
}
function getFinalScoresArray() {
return(finalScoresArray);
}
function isRunning() {
return(running);
}
function levelUp() {
level = level + 1;
setLevel(level);
}
function onClick(x, y) {
}
function setLevel(newLevel) {
level = newLevel;
levelChanged = true;
setChanged();
doUpdate();
clearChanged();
}
function setScore(newScore) {
score = newScore;
setChanged();
doUpdate();
}
function setLives(lives) {
this.lives = lives;
}
function getLives() {
return(lives);
}
function changeLives(change) {
lives = lives + change;
}
function setTrialsRemaining(trialsRemaining) {
this.trialsRemaining = trialsRemaining;
if (trialsRemaining == 0) {
}
setChanged();
doUpdate();
}
function start() {
startTime = getTimer();
running = true;
setChanged();
doUpdate();
run();
}
function stop() {
running = false;
}
function restart() {
reset();
start();
}
function sendResults(resultObj) {
var _local3 = new com.lumoslabs.util.ResultSet(resultObj);
debug("results are:");
debug(_local3.toString());
var _local2 = new XML();
_local2.onLoad = com.lumoslabs.util.Delegate.create(this, resultsSent);
debug("sending data to " + save_url);
_local3.send(save_url, _local2);
}
function resultsSent(success) {
if (success) {
debug("transfer was successful");
} else {
debug("transfer failed");
}
}
function debug(str) {
setChanged();
notifyObservers(new com.lumoslabs.games.DebugOutput(str));
}
function reset() {
stop();
score = 0;
newPoints = 0;
level = 0;
running = false;
levelChanged = false;
finalScoresArray = [];
setChanged();
notifyObservers(new com.lumoslabs.games.ResetEvent());
}
function clearChanged() {
super.clearChanged();
levelChanged = false;
}
function doUpdate() {
notifyObservers(new com.lumoslabs.games.GameState(score, level, running, levelChanged, newPoints, trialsRemaining));
}
function run() {
}
function init(obj) {
}
function finish() {
}
function finalFinish() {
trace("firing final event");
setChanged();
notifyObservers(new com.lumoslabs.games.FinalFinish());
}
function help() {
setChanged();
notifyObservers(new com.lumoslabs.games.HelpEvent());
}
function getSounds() {
return(soundEffects);
}
function toggleMute() {
return(soundEffects.toggleMute());
}
function togglePause() {
return(false);
}
static var LEVEL_INCREMENT = 1000;
var newPoints = 0;
var save_url = "http://localhost/foo/";
static var EASY = 0;
static var MEDIUM = 1;
static var HARD = 2;
static var TEST = 3;
}
Symbol 260 MovieClip [__Packages.com.lumoslabs.games.SoundEffects] Frame 0
class com.lumoslabs.games.SoundEffects
{
static var firstLoadedTarget;
var all_sounds, context_mc, mute, pause, positiveFeedback, negativeFeedback, tier1Sound, tier2Sound, tier3Sound, tier4Sound, ambientSound;
function SoundEffects (target) {
if (firstLoadedTarget == undefined) {
firstLoadedTarget = target;
}
all_sounds = [];
firstLoadedTarget.createEmptyMovieClip("context_mc", firstLoadedTarget.getNextHighestDepth());
context_mc = firstLoadedTarget.context_mc;
mute = false;
pause = false;
}
function addSound(id) {
var _local2 = new com.lumoslabs.games.GameSound(context_mc);
_local2.attachSound(id);
_local2.setVolume(volume);
_local2.setMute(mute);
_local2.setPause(pause);
all_sounds.push(_local2);
return(_local2);
}
function playFeedbackSound(isPositive) {
if (isPositive) {
positiveFeedback.start(0, 1);
} else {
negativeFeedback.start(0, 1);
}
}
function playTieredFeedbackSound(tier) {
if (tier == 1) {
tier1Sound.start(0, 1);
} else if (tier == 2) {
tier2Sound.start(0, 1);
} else if (tier == 3) {
tier3Sound.start(0, 1);
} else if (tier == 4) {
tier4Sound.start(0, 1);
} else {
negativeFeedback.start(0, 1);
}
}
function setAmbientSound(newSound) {
ambientSound = newSound;
ambientSound.loop = true;
}
function setTieredSounds(sound1, sound2, sound3, sound4) {
tier1Sound = sound1;
tier2Sound = sound2;
tier3Sound = sound3;
tier4Sound = sound4;
}
function setPositiveFeedbackSound(newSound) {
positiveFeedback = newSound;
}
function setNegativeFeedbackSound(newSound) {
negativeFeedback = newSound;
}
function startAmbientSound() {
ambientSound.start(0, 1);
}
function stopAmbientSound() {
ambientSound.stop();
}
function stopAllSounds() {
for (var _local2 in all_sounds) {
com.lumoslabs.games.GameSound(all_sounds[_local2]).stop();
}
}
function setMute(mute) {
this.mute = mute;
for (var _local3 in all_sounds) {
com.lumoslabs.games.GameSound(all_sounds[_local3]).setMute(mute);
}
}
function toggleMute() {
setMute(!mute);
return(mute);
}
function destroy() {
stopAllSounds();
if (ambientSound) {
stopAmbientSound();
}
context_mc.removeMovieClip();
}
function setPause(pause) {
this.pause = pause;
for (var _local3 in all_sounds) {
com.lumoslabs.games.GameSound(all_sounds[_local3]).setPause(pause);
}
}
function togglePause() {
setPause(!pause);
return(pause);
}
var volume = 40;
}
Symbol 261 MovieClip [__Packages.com.lumoslabs.games.GameSound] Frame 0
class com.lumoslabs.games.GameSound extends Sound
{
var play, pause, mute, volume, loop, position;
function GameSound () {
if (arguments.length > 0) {
super(arguments[0]);
} else {
super();
}
play = false;
pause = false;
mute = false;
volume = super.getVolume();
loop = false;
}
function start() {
switch (arguments.length) {
case 0 :
super.start();
break;
case 1 :
super.start(arguments[0]);
break;
default :
super.start(arguments[0], arguments[1]);
}
if (pause) {
super.stop();
}
play = true;
}
function stop() {
if (arguments.length > 0) {
super.stop(arguments[0]);
} else {
super.stop();
}
play = false;
pause = false;
}
function getVolume() {
return(volume);
}
function setVolume(value) {
super.setVolume(value);
volume = super.getVolume();
if (mute) {
super.setVolume(0);
}
}
function getPlay() {
return(play);
}
function setPause(pause) {
if (pause) {
doPause();
} else {
unPause();
}
}
function setMute(mute) {
this.mute = mute;
if (mute) {
super.setVolume(0);
} else {
super.setVolume(volume);
}
}
function doPause() {
if (!pause) {
pause = true;
if (play) {
super.stop();
}
}
}
function unPause() {
if (pause) {
pause = false;
if (play) {
super.start(position / 1000);
}
}
}
function onSoundComplete() {
if (loop) {
start();
} else {
play = false;
pause = false;
}
}
}
Symbol 262 MovieClip [__Packages.com.lumoslabs.util.ResultSet] Frame 0
class com.lumoslabs.util.ResultSet
{
var resultXML;
function ResultSet (resultObj) {
buildXML(resultObj);
}
function buildXML(resultObj) {
resultXML = new XML();
var _local9 = resultObj.session_id;
if (!(delete resultObj.session_id)) {
_local9 = _root.session_id;
if (_local9 == undefined) {
return(undefined);
}
}
var _local8 = resultXML.createElement("session");
resultXML.appendChild(_local8);
var _local10 = resultXML.createElement("id");
_local8.appendChild(_local10);
_local10.appendChild(resultXML.createTextNode(_local9));
var _local6 = resultXML.createElement("game");
_local8.appendChild(_local6);
var _local4;
var _local5;
for (var _local7 in resultObj) {
trace((("adding node: " + _local7) + " value: ") + resultObj.prop);
_local4 = resultXML.createElement(_local7);
_local5 = resultXML.createTextNode(resultObj[_local7]);
_local6.appendChild(_local4);
_local4.appendChild(_local5);
}
trace(resultXML);
}
function toString() {
return(resultXML.toString());
}
function send(url, response) {
resultXML.contentType = "text/xml";
}
}
Symbol 263 MovieClip [__Packages.com.lumoslabs.util.Delegate] Frame 0
class com.lumoslabs.util.Delegate
{
function Delegate () {
}
static function create(scope, method) {
var parameters_arr = arguments.slice(2);
var _local2 = function () {
method.apply(scope, arguments.concat(parameters_arr));
};
return(_local2);
}
}
Symbol 264 MovieClip [__Packages.com.lumoslabs.games.DebugOutput] Frame 0
class com.lumoslabs.games.DebugOutput
{
var text;
function DebugOutput (output) {
text = output;
}
}
Symbol 265 MovieClip [__Packages.com.lumoslabs.games.ResetEvent] Frame 0
class com.lumoslabs.games.ResetEvent
{
function ResetEvent () {
}
}
Symbol 266 MovieClip [__Packages.com.lumoslabs.games.GameState] Frame 0
class com.lumoslabs.games.GameState
{
var score, level, isRunning, levelUp, newPoints, trialCount;
function GameState (s, l, r, lu, np, tc) {
score = s;
level = l;
isRunning = r;
levelUp = lu;
newPoints = np;
trialCount = tc;
}
}
Symbol 267 MovieClip [__Packages.com.lumoslabs.games.FinalFinish] Frame 0
class com.lumoslabs.games.FinalFinish
{
function FinalFinish () {
}
}
Symbol 268 MovieClip [__Packages.com.lumoslabs.games.HelpEvent] Frame 0
class com.lumoslabs.games.HelpEvent
{
function HelpEvent () {
}
}
Symbol 269 MovieClip [__Packages.com.lumoslabs.framework.GameRegistrar] Frame 0
class com.lumoslabs.framework.GameRegistrar
{
static var currentManager;
function GameRegistrar () {
}
static function registerGameManager(manager) {
currentManager = manager;
}
static function registerGame(game) {
if (currentManager != undefined) {
currentManager.registerGame(game);
} else {
var _local1 = new com.lumoslabs.framework.ManagedGameAS3Proxy();
if (_local1.useGameManager()) {
_local1.registerGame(game);
} else {
game.start();
}
}
}
static function getGameManager() {
return(currentManager);
}
static function waitingForGameRegistration() {
return(currentManager != undefined);
}
}
Symbol 270 MovieClip [__Packages.com.lumoslabs.framework.ManagedGameAS3Proxy] Frame 0
class com.lumoslabs.framework.ManagedGameAS3Proxy implements com.lumoslabs.framework.GameManager
{
var muteCalled, _game;
function ManagedGameAS3Proxy () {
System.security.allowDomain("*");
muteCalled = false;
_root.flashId = "ManagedGame";
_root.as3Proxy = this;
flx.external.FlashInterface.publish(_root, true);
}
function setResourcePath(resourcePath) {
trace("ManagedGameAS3Proxy, setResourcePath\n");
com.lumoslabs.framework.ResourceHelper.setResourcePath(resourcePath);
}
function useGameManager() {
var _local1 = flx.external.FlashInterface.call(AS2_PROXY_ID + ".useGameManager");
if ((_local1 != null) && (_local1.status == "success")) {
trace("ManagedGameAS3Proxy, FlashInterface manager found");
return(_local1.result);
}
trace("ManagedGameAS3Proxy, no FlashInterface manager found");
return(false);
}
function addSettings(settingsHash) {
trace("ManagedGameAS3Proxy, addSettings");
_game.addSettings(settingsHash);
}
function start() {
_game.start();
if (muteCalled) {
_game.mute();
muteCalled = false;
}
}
function onPauseClick() {
_game.pause();
}
function onHelpClick() {
_game.help();
}
function onMuteClick() {
muteCalled = true;
_game.mute();
}
function registerGame(game) {
trace(("ManagedGameAS3Proxy, registerGame, game: " + game) + newline);
_game = game;
game.registerManager(this);
flx.external.FlashInterface.call(AS2_PROXY_ID + ".registerGame");
}
function getContainerClip() {
return(_root);
}
function onPlay(game) {
flx.external.FlashInterface.call(AS2_PROXY_ID + ".reportPlay");
}
function onData(game, gameData) {
flx.external.FlashInterface.call(AS2_PROXY_ID + ".reportData", gameData);
}
function onReset(game) {
}
function onQuit(game) {
muteCalled = false;
flx.external.FlashInterface.call(AS2_PROXY_ID + ".quit");
flx.external.FlashInterface.call(AS2_PROXY_ID + ".reportQuit");
}
function onPromo(game) {
flx.external.FlashInterface.call(AS2_PROXY_ID + ".reportPromo");
}
function isPausable() {
return(_game.isPausable());
}
function isFullScreen() {
return(_game.isFullScreen());
}
function destroy() {
_game.destroy();
}
static var AS2_PROXY_ID = "root.as2Proxy";
}
Symbol 271 MovieClip [__Packages.flx.external.FlashInterface] Frame 0
class flx.external.FlashInterface extends Object
{
function FlashInterface () {
super();
}
static function addEventListener(event, listener) {
var _local2 = getId(_root);
setup(_local2);
flashIdList[_local2].registry.addEventListener(event, listener);
flash.external.ExternalInterface.call("addAVMListener", __swfID, _local2, event);
}
static function removeEventListener(event, listener) {
var _local2 = getId(_root);
setup(_local2);
flashIdList[_local2].registry.removeEventListener(event, listener);
flash.external.ExternalInterface.call("removeAVMListener", __swfID, _local2, event);
}
static function dispatchEvent(eventObject) {
flash.external.ExternalInterface.call("dispatchAVMEvent", eventObject);
}
static function dispatchHandler(flashId, eventObject) {
flashIdList[flashId].registry.dispatchEvent(eventObject);
}
static function register(id, target, overwrite) {
var _local1 = getId(target);
setup(_local1);
if (overwrite) {
flashIdList[_local1].registry[id] = target;
return(true);
}
if (flashIdList[_local1].registry[id] == null) {
flashIdList[_local1].registry[id] = target;
return(true);
}
return(false);
}
static function unregister(flashId, id) {
setup(flashId);
if (flashIdList[flashId].registry[id]) {
delete flashIdList[flashId].registry[id];
return(true);
}
return(false);
}
static function call(path) {
var _local7 = path.split(".");
var _local6 = _local7.shift().toString();
var _local5;
var _local4;
if (_local6 == "root") {
_local4 = __swfID;
_local5 = __swfID;
} else {
var _local3 = getSWFIds();
for (var _local8 in _local3) {
if (_local3[_local8] == _local6) {
_local4 = __swfID;
_local5 = _local7.shift().toString();
break;
}
}
if ((_local4 == null) || (_local5 == null)) {
_local4 = _local6;
_local5 = _local6;
}
}
path = _local7.join(".");
var _local2 = arguments.slice(1);
for (var _local8 in _local2) {
if (_local2[_local8] == "") {
_local2[_local8] = "$empty";
}
}
return(flash.external.ExternalInterface.call((("getSWF('" + _local4) + "').callFlash_") + _local5, _local4, path, _local2));
}
static function callHandler(flashId, path, args) {
var _local6 = new Object();
_local6.target = target;
_local6.type = type;
_local6.status = "error";
if (!flashIdList[flashId].swf) {
_local6.message = "SWF has not been made public.";
return(_local6);
}
var _local4 = path.split(".");
var target = _local4[0].toString();
var type = _local4.pop().toString();
var _local2 = flashIdList[flashId].registry[target];
if (_local2 == null) {
var _local5 = flashIdList[flashId].swf;
var _local7 = _local4.length;
var _local1 = 0;
while (_local1 < _local7) {
_local5 = _local5[_local4[_local1]];
_local1++;
}
if (_local5 == null) {
_local6.message = "Target does not exist";
alert(1, flashId);
return(_local6);
}
_local2 = _local5;
} else {
_local4.shift();
var _local7 = _local4.length;
var _local1 = 0;
while (_local1 < _local7) {
_local2 = _local2[_local4[_local1]];
_local1++;
}
if (_local2 == null) {
_local6.message = "Target does not exist";
return(_local6);
}
}
for (var _local8 in args) {
if (args[_local8] == "$empty") {
args[_local8] = "";
}
}
if (typeof(_local2[type]) == "function") {
_local6.result = _local2[type].apply(_local2, args);
} else if (args.length < 1) {
_local6.result = _local2[type];
} else {
_local6.result = (_local2[type] = args[0]);
}
_local6.status = "success";
return(_local6);
}
static function alert() {
trace(arguments.join(" : "));
flash.external.ExternalInterface.call("alert", arguments.join(" : "));
}
static function getId(control) {
var _local1 = control;
if (_local1.flashId == null) {
_local1.flashId = __swfID;
if (_local1.flashId == null) {
_local1.flashId = getSWFName(_local1);
}
}
return(_local1.flashId);
}
static function getSWFIds() {
return(Array(flash.external.ExternalInterface.call("getSWFIds")));
}
static function getSWFName(control) {
var _local1 = control._root._url.split("/").join("|").split("\\").join("|").split("|").pop();
if (_local1.indexOf("?") != -1) {
_local1 = _local1.split("?").shift();
}
_local1 = _local1.split(".swf").join("").split("#").shift();
return(unescape(_local1));
}
static function getSWFId() {
var _local2 = "swf" + (Math.random() * 999999);
flash.external.ExternalInterface.addCallback(_local2, null, function () {
});
var _local1 = flash.external.ExternalInterface.call("SWFInfo.locateSWF", _local2);
if (!_local1) {
_local1 = flash.external.ExternalInterface.call("eval", ((((("(window.SWFInfo = {locateSWF:function(swfUID) {var embedtags = document.getElementsByTagName('embed');var objecttags = document.getElementsByTagName('object');var swfobjects = new Array();for(var j=0; j<embedtags.length; j++)swfobjects.push(embedtags[j]);for(var k=0; k<objecttags.length; k++)swfobjects.push(objecttags[k]);for(var i=0; i<swfobjects.length; i++) {var name = swfobjects[i].name ? swfobjects[i].name : swfobjects[i].id;if(document[name] && document[name][swfUID]) {return name;}" + "}") + "return null;") + "}") + "}).locateSWF('") + _local2) + "');");
}
trace("AS2 LOCATION: " + _local1);
trace("AS2 swfUID:: " + _local2);
var _local3 = (_local1 ? (String(_local1)) : null);
return(_local3);
}
static function publish(root, makePublic) {
var _local1 = getId(root);
setup(_local1);
if (makePublic) {
flashIdList[_local1].swf = root;
} else {
delete flashIdList[_local1].swf;
}
}
static function setupEIFunctions() {
if (!staticInit) {
staticInit = true;
if (flash.external.ExternalInterface.call("eval", "$avms")) {
return(undefined);
}
var _local1 = "";
_local1 = _local1 + "function getSWF(swfId)";
_local1 = _local1 + "{";
_local1 = _local1 + "\tif (navigator.appName.indexOf('Microsoft') != -1)";
_local1 = _local1 + "\t\treturn window[swfId];";
_local1 = _local1 + "\treturn document[swfId];";
_local1 = _local1 + "};";
_local1 = _local1 + "function getSWFIds()";
_local1 = _local1 + "{";
_local1 = _local1 + "\tvar list = new Array();";
_local1 = _local1 + "\tvar swfobjects = document.getElementsByTagName('embed');";
_local1 = _local1 + "\tfor(var i=0; i<swfobjects.length; i++)";
_local1 = _local1 + "\t\tlist.push(swfobjects[i].name ? swfobjects[i].name : swfobjects[i].id);";
_local1 = _local1 + "\tswfobjects = document.getElementsByTagName('object');";
_local1 = _local1 + "\tfor(i=0; i<swfobjects.length; i++)";
_local1 = _local1 + "\t\tlist.push(swfobjects[i].name ? swfobjects[i].name : swfobjects[i].id);";
_local1 = _local1 + "\treturn list;";
_local1 = _local1 + "};";
_local1 = _local1 + "var $avms = new Object();";
_local1 = _local1 + "function addAVMListener(swfId, flashId, event)";
_local1 = _local1 + "{";
_local1 = _local1 + "\tif($avms[event] == null)";
_local1 = _local1 + "\t\t$avms[event] = new Object();";
_local1 = _local1 + "\tif($avms[event][swfId] == null)";
_local1 = _local1 + "\t\t$avms[event][swfId] = new Object();";
_local1 = _local1 + "\t$avms[event][swfId][flashId] = event;";
_local1 = _local1 + "};";
_local1 = _local1 + "function removeAVMListener(swfId, flashId, event)";
_local1 = _local1 + "{";
_local1 = _local1 + "\tdelete $avms[event][swfId][flashId];";
_local1 = _local1 + "};";
_local1 = _local1 + "function dispatchAVMEvent(evt)";
_local1 = _local1 + "{";
_local1 = _local1 + "\tvar type = evt.type;";
_local1 = _local1 + "\tvar swfList = $avms[type];";
_local1 = _local1 + "\tfor(var e in swfList)";
_local1 = _local1 + "\t{";
_local1 = _local1 + "\t\tvar flashList = swfList[e];";
_local1 = _local1 + "\t\tfor(var f in flashList)";
_local1 = _local1 + "\t\t{";
_local1 = _local1 + "\t\t\tgetSWF(e)['dispatchFlash_' + f](f, evt);";
_local1 = _local1 + " \t\t}";
_local1 = _local1 + "\t}";
_local1 = _local1 + "};";
flash.external.ExternalInterface.call("eval", _local1);
}
}
static function setup(id) {
setupEIFunctions();
if (id == null) {
return(false);
}
if (flashIdList[id] == null) {
flashIdList[id] = new Object();
flashIdList[id].dispatchHandler = dispatchHandler;
flashIdList[id].callHandler = callHandler;
flashIdList[id].registry = new Object();
mx.events.EventDispatcher.initialize(flashIdList[id].registry);
flash.external.ExternalInterface.addCallback("dispatchFlash_" + id, flashIdList[id], flashIdList[id].dispatchHandler);
flash.external.ExternalInterface.addCallback("callFlash_" + id, flashIdList[id], flashIdList[id].callHandler);
}
return(true);
}
static var flashIdList = new Object();
static var staticInit = false;
static var __swfID = getSWFId();
}
Symbol 272 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 273 MovieClip [__Packages.com.lumoslabs.framework.ResourceHelper] Frame 0
class com.lumoslabs.framework.ResourceHelper
{
static var resourcePath;
function ResourceHelper () {
}
static function pathURL(path) {
return(rootPath() + path);
}
static function setResourcePath(resourcePath) {
com.lumoslabs.framework.ResourceHelper.resourcePath = resourcePath;
}
static function getResourcePath(path) {
if (resourcePath == undefined) {
resourcePath = getDefaultResourcePath();
}
return((resourcePath + "/") + path);
}
static function getDefaultResourcePath() {
var _local1;
if ((System.capabilities.playerType == "External") || (System.capabilities.playerType == "StandAlone")) {
_local1 = "../resources/";
} else {
_local1 = pathURL("flash/resources/");
}
return(_local1);
}
static function rootPath() {
var _local2;
if (System.security.sandboxType == "remote") {
var _local3 = _root._url.indexOf("flash/");
return(_root._url.substr(0, _local3));
}
_local2 = "";
return(_local2);
}
}
Symbol 274 MovieClip [__Packages.com.lumoslabs.games.PlayEvent] Frame 0
class com.lumoslabs.games.PlayEvent
{
function PlayEvent () {
}
}
Symbol 275 MovieClip [__Packages.com.lumoslabs.games.PromoEvent] Frame 0
class com.lumoslabs.games.PromoEvent
{
function PromoEvent () {
}
}
Symbol 276 MovieClip [__Packages.com.lumoslabs.games.lostinmigration.LostInMigrationContainer] Frame 0
class com.lumoslabs.games.lostinmigration.LostInMigrationContainer extends com.lumoslabs.games.GameContainer implements com.lumoslabs.util.Observer
{
var _isPausable, game, setupContainerClip, container_mc, finish;
function LostInMigrationContainer (target, depth, x, y, stageWidth, stageHeight) {
super(target, depth, x, y);
}
function setDefaults() {
_isPausable = true;
}
function initGame(params) {
var _local2 = 45;
var _local3 = false;
if (params.promo != undefined) {
_local3 = params.promo == true.toString();
} else {
trace("LostInMigrationContainer, no promo passed, default used: " + _local3);
}
if (params.time != undefined) {
_local2 = Number(params.time);
} else {
trace("LostInMigrationContainer, no time passed, default used: " + _local2);
}
com.lumoslabs.games.lostinmigration.LostInMigrationGame(game).clearAll();
setupContainerClip();
game.clearObservers();
container_mc.onEnterFrame = undefined;
delete container_mc.onEnterFrame;
game = new com.lumoslabs.games.lostinmigration.LostInMigrationGame(container_mc, this, _local2, _local3);
game.addObserver(this);
var myGame = com.lumoslabs.games.lostinmigration.LostInMigrationGame(game);
myGame.init();
container_mc.onEnterFrame = function () {
myGame.update();
};
}
function handleResults(score, num_correct, num_tries, time, num_tries_inhibition, num_correct_inhibition, time_inhibition, response_time_correct, response_time_incorrect, response_time_inhibition, response_time_no_inhibition) {
var _local2 = new Object();
_local2.score = score;
_local2.num_correct = num_correct;
_local2.num_tries = num_tries;
_local2.time = time;
_local2.num_tries_inhibition = num_tries_inhibition;
_local2.num_correct_inhibition = num_correct_inhibition;
_local2.time_inhibition = time_inhibition;
_local2.response_time_correct = response_time_correct;
_local2.response_time_incorrect = response_time_incorrect;
_local2.response_time_inhibition = response_time_inhibition;
_local2.response_time_no_inhibition = response_time_no_inhibition;
finish(_local2);
}
static function main() {
var _local2 = new com.lumoslabs.games.lostinmigration.LostInMigrationContainer(_root, 0, 0, 0, Stage.width, Stage.height);
}
}
Symbol 277 MovieClip [__Packages.com.lumoslabs.games.lostinmigration.LostInMigrationGame] Frame 0
class com.lumoslabs.games.lostinmigration.LostInMigrationGame extends com.lumoslabs.games.Game
{
var MC, gameContainer, trialTime, responseTime, released, newResponse, correctResponse, updateFinished, pause, soundEffects, bonusFormat, formNum, promo, gameWidth, gameState, skyNum, countIntID, gameTime, timeLeft, score, responses, rights, totals, correctTotals, times, level, consRights, bonusEnd, skyRect, form, response, trial, lastTrialTime, pauseStart;
function LostInMigrationGame (container_mc, gameContainer, trialTime, promo) {
super();
MC = container_mc;
this.gameContainer = gameContainer;
this.trialTime = trialTime;
responseTime = getTimer();
released = true;
newResponse = false;
correctResponse = false;
updateFinished = true;
pause = false;
soundEffects = new com.lumoslabs.games.lostinmigration.LostInMigrationSounds(MC);
Key.addListener(this);
bonusFormat = new TextFormat("Trebuchet MS", 17, 10027008, true);
formNum = 1;
this.promo = promo;
if (Stage.width < WIDTH) {
gameWidth = HEIGHT;
} else {
gameWidth = WIDTH;
}
}
function getSounds() {
return(com.lumoslabs.games.lostinmigration.LostInMigrationSounds(soundEffects));
}
function clearAll() {
MC.myTrialLayer.removeMovieClip();
MC.myScreenLayer.removeMovieClip();
getSounds().stopAllSounds();
Key.removeListener(this);
}
function init() {
MC.myTrialLayer.removeMovieClip();
MC.myScreenLayer.removeMovieClip();
MC.createEmptyMovieClip("myScreenLayer", MC.getNextHighestDepth());
MC.myScreenLayer._x = gameWidth / 2;
MC.myScreenLayer._y = HEIGHT / 2;
MC.attachMovie("trialLayer", "myTrialLayer", MC.getNextHighestDepth(), {_x:gameWidth / 2, _y:HEIGHT / 2});
initTrialLayerButtons();
MC.myTrialLayer._visible = false;
initStart();
}
function initStart() {
gameState = "start";
if (promo) {
MC.myScreenLayer.attachMovie("promoStartScreen", "myScreen", 0);
} else {
MC.myScreenLayer.attachMovie("startScreen", "myScreen", 0);
}
var owner = this;
MC.myScreenLayer.myScreen.myHowToButton.onPress = function () {
owner.help();
};
MC.myScreenLayer.myScreen.myStartButton.onPress = function () {
owner.clearStart();
owner.initCount();
};
}
function clearStart() {
MC.myScreenLayer.myScreen.removeMovieClip();
}
function initCount() {
gameState = "count";
MC.myScreenLayer.attachMovie("countScreen", "myScreen", 0);
skyNum = Math.ceil(MC.myScreenLayer.myScreen.sky._totalframes * Math.random());
MC.myScreenLayer.myScreen.sky.gotoAndStop(skyNum);
MC.myScreenLayer.myScreen.myTimeBox.myTime.text = "0:" + trialTime;
MC.myScreenLayer.myScreen.myScoreBox.myScore.text = 0;
MC.myScreenLayer.myScreen.count.text = "3";
countIntID = setInterval(this, "countdown", 1000, 3);
gameContainer.reportPlay();
}
function countdown(secondsLeft) {
clearInterval(countIntID);
if (secondsLeft > 1) {
MC.myScreenLayer.myScreen.count.text = secondsLeft - 1;
countIntID = setInterval(this, "countdown", 1000, secondsLeft - 1);
} else {
clearCount();
initTrials(getTimer());
}
}
function clearCount() {
clearInterval(countIntID);
MC.myScreenLayer.myScreen.removeMovieClip();
}
function initInstruct() {
gameState = "instruct";
MC.myTrialLayer._visible = false;
MC.myScreenLayer.attachMovie("helpScreen", "myScreen", 0);
var owner = this;
MC.myScreenLayer.myScreen.playButton.onRelease = function () {
owner.clearStart();
owner.initCount();
};
}
function clearInstruct() {
MC.myScreenLayer.myScreen.removeMovieClip();
}
function initTrials(initTime) {
gameState = "trials";
gameTime = initTime;
timeLeft = trialTime;
score = 0;
responses = 0;
rights = 0;
totals = {congruent:0, incongruent:0};
correctTotals = {congruent:0, incongruent:0};
times = {congruent:[], incongruent:[], right:[], wrong:[]};
level = 0;
consRights = 0;
bonusEnd = initTime;
MC.myScreenLayer.attachMovie("trialScreen", "myScreen", 0);
skyRect = MC.myScreenLayer.myScreen.windowBorder1.getRect(MC.myTrialLayer);
MC.myScreenLayer.myScreen.sky.gotoAndStop(skyNum);
MC.myTrialLayer.myBonusBox.gotoAndStop(2);
MC.myTrialLayer._visible = true;
initTrialLayer();
nextTrial(new com.lumoslabs.games.lostinmigration.LostInMigrationTrial());
}
function initTrialLayer() {
initForm(MC.myTrialLayer.form1);
MC.myTrialLayer.form1.setMask(MC.myScreenLayer.myScreen.windowBorder1);
initForm(MC.myTrialLayer.form2);
MC.myTrialLayer.form2.setMask(MC.myScreenLayer.myScreen.windowBorder2);
form = MC.myTrialLayer["form" + formNum];
MC.myTrialLayer.myTimeBox.myTime.text = "0:" + timeLeft;
MC.myTrialLayer.myScoreBox.myScore.text = score;
MC.myTrialLayer.myPointsBox._visible = false;
MC.myTrialLayer.myPointsBox.glow._visible = false;
MC.myTrialLayer.myBonusBox.glow._visible = false;
MC.myTrialLayer.myBonusBox._visible = false;
MC.myTrialLayer.myBonusBox._alpha = 80;
MC.myTrialLayer.myNegFeedback.stop();
MC.myTrialLayer.myNegFeedback._visible = false;
MC.myTrialLayer.myPointsBox.glow.stop();
showBonusBorder(false);
pauseTrialLayer(pause);
}
function initForm(aForm) {
aForm.stop();
aForm.arrows.stop();
aForm.arrows.center.stop();
aForm.arrows.flankers.stop();
}
function resetFormFly() {
form.arrows.center.arrow.gotoAndStop(2);
for (var _local2 in form.arrows.flankers) {
if (form.arrows.flankers[_local2] instanceof MovieClip) {
form.arrows.flankers[_local2].gotoAndStop(2);
}
}
}
function initTrialLayerButtons() {
var owner = this;
MC.myTrialLayer.myUpButton.onPress = function () {
owner.buttonPress("up", getTimer());
};
MC.myTrialLayer.myRightButton.onPress = function () {
owner.buttonPress("right", getTimer());
};
MC.myTrialLayer.myDownButton.onPress = function () {
owner.buttonPress("down", getTimer());
};
MC.myTrialLayer.myLeftButton.onPress = function () {
owner.buttonPress("left", getTimer());
};
pauseTrialLayer(pause);
}
function buttonPress(button, buttonTime) {
if (updateFinished) {
updateFinished = false;
responseTime = buttonTime;
response = button;
newResponse = true;
trialResponse();
}
}
function nextTrial(trial) {
this.trial = trial;
var _local5 = trial.getForm();
form.gotoAndStop(_local5);
if (_local5 == "VForm") {
form.arrows.gotoAndStop(trial.getVDir());
}
form.arrows.center.gotoAndStop(trial.getCenterDir());
form.arrows.flankers.gotoAndStop(trial.getFlankerDir());
resetFormFly();
lastTrialTime = getTimer();
var _local3 = (form.arrows._width / 2) + XMARGIN;
var _local2 = (form.arrows._height / 2) + YMARGIN;
moveFormRandom(_local3, _local2);
while (form.hitTest(otherForm())) {
moveFormRandom(_local3, _local2);
}
}
function moveFormRandom(xOffset, yOffset) {
form._x = randomBetween(skyRect.xMin + xOffset, skyRect.xMax - xOffset);
form._y = randomBetween(skyRect.yMin + yOffset, skyRect.yMax - yOffset);
}
function randomBetween(min, max) {
return(min + ((max - min) * Math.random()));
}
function otherForm() {
return(MC.myTrialLayer["form" + ((formNum % 2) + 1)]);
}
function switchForms() {
formNum = (formNum % 2) + 1;
form = MC.myTrialLayer["form" + formNum];
}
function clearTrials() {
MC.myTrialLayer._visible = false;
MC.myScreenLayer.myScreen.removeMovieClip();
getSounds().stopAllSounds();
}
function saveResults(score, num_correct, num_tries, time, num_tries_inhibition, num_correct_inhibition, time_inhibition, response_time_correct, response_time_incorrect, response_time_inhibition, response_time_no_inhibition) {
gameContainer.handleResults(score, num_correct, num_tries, time, num_tries_inhibition, num_correct_inhibition, time_inhibition, response_time_correct, response_time_incorrect, response_time_inhibition, response_time_no_inhibition);
}
function initResults() {
gameState = "results";
var _local7 = new TextFormat("Trebuchet MS", 16, 39423, true);
var _local19 = new TextFormat("Trebuchet MS", 44, 39423, true);
var _local8;
var _local11;
if (responses == 0) {
_local8 = 0;
_local11 = trialTime;
} else {
_local8 = rights / responses;
_local11 = trialTime / responses;
}
var _local9;
if (totals.congruent == 0) {
_local9 = 1;
} else {
_local9 = totals.congruent;
}
var _local17 = correctTotals.congruent / _local9;
var _local4 = 0;
var _local2 = 0;
while (_local2 < times.congruent.length) {
_local4 = _local4 + times.congruent[_local2];
_local2++;
}
var _local15 = _local4 / _local9;
var _local10;
if (totals.incongruent == 0) {
_local10 = 1;
} else {
_local10 = totals.incongruent;
}
var _local3 = 0;
_local2 = 0;
while (_local2 < times.incongruent.length) {
_local3 = _local3 + times.incongruent[_local2];
_local2++;
}
var _local16 = _local3 / _local10;
var _local5 = 0;
_local2 = 0;
while (_local2 < times.right.length) {
_local5 = _local5 + times.right[_local2];
_local2++;
}
var _local6 = 0;
_local2 = 0;
while (_local2 < times.wrong.length) {
_local6 = _local6 + times.wrong[_local2];
_local2++;
}
if (promo) {
MC.myScreenLayer.attachMovie("promoResultsScreen", "myScreen", 0);
} else {
MC.myScreenLayer.attachMovie("resultsScreen", "myScreen", 0);
}
MC.myScreenLayer.myScreen.myReaction.text = Math.round(1000 * _local11) + "ms";
MC.myScreenLayer.myScreen.myReaction.setTextFormat(_local7);
MC.myScreenLayer.myScreen.myHesitation.text = Math.round(_local15 - _local16) + "ms";
MC.myScreenLayer.myScreen.myHesitation.setTextFormat(_local7);
MC.myScreenLayer.myScreen.myAccuracy.text = Math.round(100 * _local8) + "%";
MC.myScreenLayer.myScreen.myAccuracy.setTextFormat(_local7);
MC.myScreenLayer.myScreen.myError.text = Math.round(100 * (_local17 - _local8)) + "%";
MC.myScreenLayer.myScreen.myError.setTextFormat(_local7);
MC.myScreenLayer.myScreen.myRights.text = rights;
MC.myScreenLayer.myScreen.myRights.setTextFormat(_local7);
MC.myScreenLayer.myScreen.myScore.text = score + " points!";
var _local13 = Math.round(_local5 / rights);
var _local18 = Math.round(_local6 / (responses - rights));
var _local14 = Math.round(_local3 / totals.incongruent);
var _local12 = Math.round(_local4 / totals.congruent);
saveResults(score, rights, responses, trialTime * 1000, totals.incongruent, correctTotals.incongruent, _local3, _local13, _local18, _local14, _local12);
var owner = this;
MC.myScreenLayer.myScreen.myDoneButton.onPress = function () {
owner.finalFinish();
};
MC.myScreenLayer.myScreen.myPromoButton.onPress = function () {
owner.onPromo();
};
}
function onPromo() {
gameContainer.reportPromo();
}
function clearResults() {
MC.myScreenLayer.myScreen.removeMovieClip();
}
function update() {
if ((!pause) && (gameState == "trials")) {
if (timeLeft < 1) {
clearTrials();
initResults();
} else {
updateTimeLeft(getTimer());
}
updateBonus(getTimer());
updateTrials(getTimer(), true);
}
}
function updateTimeLeft(updateTime) {
if ((updateTime - gameTime) > 1000) {
gameTime = updateTime;
timeLeft--;
}
if ((timeLeft < 8) && (!getSounds().getTimerSoundIsPlaying())) {
getSounds().playTimerSound();
}
if (timeLeft < 10) {
MC.myTrialLayer.myTimeBox.myTime.text = "0:0" + timeLeft;
} else {
MC.myTrialLayer.myTimeBox.myTime.text = "0:" + timeLeft;
}
}
function updateBonus(updateTime) {
if ((level > 0) && (updateTime >= bonusEnd)) {
level = 0;
showBonusBorder(false);
}
}
function showBonusBorder(show) {
MC.myTrialLayer.myBonusBox._visible = show;
}
function updateTrials(updateTime, trialState) {
if (!newResponse) {
return(undefined);
}
var _local2 = updateTime - responseTime;
if (_local2 > DELAY) {
switchForms();
nextTrial(new com.lumoslabs.games.lostinmigration.LostInMigrationTrial());
newResponse = false;
correctResponse = false;
updateFinished = true;
}
}
function onKeyUp() {
released = true;
}
function onKeyDown() {
if ((updateFinished && (released)) && (gameState == "trials")) {
updateFinished = false;
responseTime = getTimer();
switch (Key.getCode()) {
case 38 :
response = "up";
newResponse = true;
break;
case 39 :
response = "right";
newResponse = true;
break;
case 40 :
response = "down";
newResponse = true;
break;
case 37 :
response = "left";
newResponse = true;
break;
default :
newResponse = false;
updateFinished = true;
}
if (newResponse) {
trialResponse();
released = false;
}
}
}
function trialResponse() {
responses++;
totals[trial.getType()]++;
var _local2 = responseTime - lastTrialTime;
times[trial.getType()].push(_local2);
if (response == trial.getCenterDir()) {
rights++;
correctTotals[trial.getType()]++;
times.right.push(_local2);
rightTrialResponse();
} else {
times.wrong.push(_local2);
wrongTrialResponse();
}
formFlyAway();
}
function formFlyAway() {
form.arrows.center.arrow.gotoAndPlay(2);
for (var _local2 in form.arrows.flankers) {
if (form.arrows.flankers[_local2] instanceof MovieClip) {
form.arrows.flankers[_local2].gotoAndPlay(2);
}
}
}
function rightTrialResponse() {
correctResponse = true;
doBonusRight();
doScore(MULT[level] * CSCORE);
}
function wrongTrialResponse() {
doBonusWrong();
doNegFeedback();
}
function doBonusRight() {
consRights++;
if (consRights == CONSBONUS) {
getSounds().playBonusSound();
consRights = 0;
showBonusBorder(true);
if (level == 0) {
bonusEnd = responseTime + BONUSTIME;
} else {
bonusEnd = bonusEnd + BONUSTIME;
}
if (level < (MULT.length - 1)) {
level++;
showBonusText("BONUS X" + MULT[level]);
}
} else {
getSounds().playFeedbackSound(true);
}
}
function doBonusWrong() {
getSounds().playFeedbackSound(false);
consRights = 0;
var _local2 = bonusEnd - responseTime;
if (_local2 > HIGHTIME) {
bonusEnd = responseTime + (_local2 * 0.5);
} else {
bonusEnd = bonusEnd + PENALTIME;
if (responseTime >= bonusEnd) {
bonusEnd = responseTime;
level = 0;
showBonusBorder(false);
}
}
}
function showBonusText(text) {
MC.myTrialLayer.myBonusBox.myBonus.field.text = text;
}
function doScore(points) {
score = score + points;
MC.myTrialLayer.myScoreBox.myScore.text = score;
if (points > 0) {
MC.myTrialLayer.myPointsBox.myPoints.field.text = "+" + points;
} else {
MC.myTrialLayer.myPointsBox.myPoints.field.text = points;
}
MC.myTrialLayer.myPointsBox._x = form._x;
MC.myTrialLayer.myPointsBox._y = form._y;
MC.myTrialLayer.myPointsBox._visible = true;
MC.myTrialLayer.myPointsBox.gotoAndPlay(1);
}
function doNegFeedback() {
MC.myTrialLayer.myNegFeedback._x = form._x;
MC.myTrialLayer.myNegFeedback._y = form._y;
MC.myTrialLayer.myNegFeedback._visible = true;
MC.myTrialLayer.myNegFeedback.gotoAndPlay(1);
}
function togglePause() {
getSounds().togglePause();
setPause(!pause);
return(pause);
}
function setPause(pause) {
this.pause = pause;
if (pause) {
pauseStart = getTimer();
Key.removeListener(this);
} else {
bonusEnd = bonusEnd + (getTimer() - pauseStart);
lastTrialTime = lastTrialTime + (getTimer() - pauseStart);
Key.addListener(this);
}
pauseTrialLayer(pause);
}
function pauseTrialLayer(pause) {
MC.myTrialLayer.myUpButton.enabled = !pause;
MC.myTrialLayer.myRightButton.enabled = !pause;
MC.myTrialLayer.myDownButton.enabled = !pause;
MC.myTrialLayer.myLeftButton.enabled = !pause;
form._visible = !pause;
}
function help() {
super.help();
clearAny();
if (pause) {
togglePause();
}
initInstruct(getTimer());
}
function clearAny() {
switch (gameState) {
case "start" :
clearStart();
break;
case "instruct" :
clearInstruct();
break;
case "count" :
clearCount();
break;
case "trials" :
clearTrials();
break;
default :
clearResults();
}
}
static var WIDTH = 640;
static var HEIGHT = 480;
static var CSCORE = 25;
static var DELAY = 0;
static var XMARGIN = 30;
static var YMARGIN = 30;
static var MULT = [1, 2, 3, 4];
static var CONSBONUS = 5;
static var BONUSTIME = 5000;
static var PENALTIME = -5000;
static var HIGHTIME = 10000;
}
Symbol 278 MovieClip [__Packages.com.lumoslabs.games.lostinmigration.LostInMigrationTrial] Frame 0
class com.lumoslabs.games.lostinmigration.LostInMigrationTrial
{
var centerIndex, flankerIndex, trialType, form, VIndex;
function LostInMigrationTrial () {
init();
}
function init() {
centerIndex = randomIndex();
if (Math.random() < 0.5) {
flankerIndex = centerIndex;
trialType = "congruent";
} else {
flankerIndex = randomOtherIndex(centerIndex);
trialType = "incongruent";
}
var _local2 = Math.floor(forms.length * Math.random());
form = forms[_local2];
if (form == "VForm") {
VIndex = randomIndex();
}
}
function getForm() {
return(form);
}
function getCenterDir() {
return(directions[centerIndex]);
}
function getFlankerDir() {
return(directions[flankerIndex]);
}
function getVDir() {
return(directions[VIndex]);
}
function getType() {
return(trialType);
}
function randomIndex() {
return(Math.floor(Math.random() * directions.length));
}
function randomOtherIndex(index) {
var _local2 = index;
while (_local2 == index) {
_local2 = randomIndex();
}
return(_local2);
}
static var directions = ["up", "right", "down", "left"];
static var forms = ["-Form", "|Form", "+Form", "VForm"];
}
Symbol 279 MovieClip [__Packages.com.lumoslabs.games.lostinmigration.LostInMigrationSounds] Frame 0
class com.lumoslabs.games.lostinmigration.LostInMigrationSounds extends com.lumoslabs.games.SoundEffects
{
var ticker_mc, setPositiveFeedbackSound, addSound, setNegativeFeedbackSound, timerSound, bonusSound, volume, all_sounds;
function LostInMigrationSounds (target) {
super(target);
com.lumoslabs.games.SoundEffects.firstLoadedTarget.createEmptyMovieClip("ticker_mc", com.lumoslabs.games.SoundEffects.firstLoadedTarget.getNextHighestDepth());
ticker_mc = com.lumoslabs.games.SoundEffects.firstLoadedTarget.ticker_mc;
attachSounds();
}
function attachSounds() {
setPositiveFeedbackSound(addSound("right.mp3"));
setNegativeFeedbackSound(addSound("miss.wav"));
timerSound = addTicker("metronome.mp3");
bonusSound = addSound("bonus.mp3");
}
function addTicker(id) {
var _local2 = new com.lumoslabs.games.GameSound(ticker_mc);
_local2.attachSound(id);
_local2.setVolume(volume);
all_sounds.push(_local2);
return(_local2);
}
function playBonusSound() {
if (bonusSound.getPlay() == true) {
return(undefined);
}
bonusSound.start();
}
function stopBonusSound() {
bonusSound.stop();
}
function playTimerSound() {
timerSound.start(5, 1);
}
function stopTimerSound() {
timerSound.stop();
}
function getTimerSoundIsPlaying() {
return(timerSound.getPlay());
}
function getBonusIsPlaying() {
return(bonusSound.getPlay());
}
}