8 Replies - 390 Views - Last Post: 25 September 2013 - 11:25 AM Rate Topic: -----

#1 GForGreat  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 25-September 13

Can You Crack My .Swf Game?

Posted 25 September 2013 - 09:47 AM

Here is the situation, I am a full time student and work full time. I wrote this game for my CIS class. It is a peg game where you drop the ball/token in the top slot and it bounces off of pins on the way down, landing on your score at the bottom. So, the game is complete and my main goal is to make each "token" worth approximately eight points, with the feeling of equal odds of winning. I would post the game here for you all to play but I have it coded to pull the 'token' value from a web page where you earn tokes through answering questions correctly(I have not made it live at this point). What I would like to ask of all of you is to see if you can crack the pattern from looking at the code, can you tell me where you can drop the token to win every time/win in a discernible pattern. I've got a $10 dollar Starbucks gift-card(Got it as a gift from someone who doesn't know i loath coffee) for the first one to pm me the correct way(/s (I only know of one way myself)).

Here comes the code.

// Action script...

// [onClipEvent of sprite 48 in frame 1]
on (release) {
    _root.setUpChooser();
}

// [Action in Frame 1]
function debuggerVisible(whichWay) {
    _root.debugger._visible = whichWay;
    _root.debugger.debuggerBG.label.text = _global.gVersion;
}
function debugButtonStyle(whatTextfield, whatText, bgColor) {
    defaultFieldStyle(whatTextfield);
    whatTextfield.text = whatText;
    whatTextfield.backgroundColor = bgColor;
    var _loc1 = new TextFormat();
    _loc1.size = 12;
    whatTextfield.setTextFormat(_loc1);
}
function defaultFieldStyle(whatTextFieldRef) {
    whatTextFieldRef.border = true;
    whatTextFieldRef.background = true;
    whatTextFieldRef.wordWrap = true;
    whatTextFieldRef.multiline = true;
}
function debug(theString) {
    db(".. debug " + debug, "0");
    if (theString == "soundToggle") {
        soundToggle();
    }
    else if (theString == "helpToggle") {
    }
    else if (theString == "Call_getposs") {
        aspRequest("getposs", _global.gGameID);
    }
    else if (theString == "Call_getinfo") {
        aspRequest("getinfo", _global.gGameID);
    }
    else if (theString == "Call_playtokens") {
        var _loc3 = new Object();
        _loc3.plays = _root.frameworkMC.connectionMC.input_plays.text;
        _loc3.tokens = _root.frameworkMC.connectionMC.input_tokens.text;
        _loc3.points = _root.frameworkMC.connectionMC.input_points.text;
        aspRequest("playtokens", _global.gGameID, _loc3);
    }
}
function mainGame() {
    _root.startScreen._visible = false;
    _root.designer_mainGame();
}
function addToPlays(whatAmount) {
    plays.text = Number(plays.text) + whatAmount;
    if (Number(plays.text) > Number(tokens.text)) {
        plays.text = tokens.text;
    }
    _root.designer_addToPlays();
}
function tryAgain() {
    setUp();
}
function callAction(actionString, plays, tokens, points) {
    db(".. callAction " + callAction, "0");
    if (actionString == "soundToggle") {
        soundToggle();
    }
    else if (actionString == "helpToggle") {
        getURL(_root.HelpPath, "_blank");
    }
    else if (actionString == "getPoss") {
        aspRequest("getposs", _global.gGameID);
    }
    else if (actionString == "getInfo") {
        aspRequest("getinfo", _global.gGameID);
    }
    else if (actionString == "playTokens") {
        var _loc3 = new Object();
        _loc3.plays = _root.plays.text;
        _loc3.tokens = _root.tokens.text;
        _loc3.points = _root.points.text;
        aspRequest("playtokens", _global.gGameID, _loc3);
    }
}
function idle() {
}
function initMainVariables() {
    db(".. initMainVariables " + initMainVariables, "0");
    fm = _root.frameworkMC;
    fm.source_gameID.text = _global.gGameID;
    gGameStatus = "StartUp";
    var _loc3 = "";
    fm.gameid.text = _global.gGameID;
    aspRequest("getinfo", _global.gGameID);
}
function initMainButtons() {
    for (var i in _root.arrayOfPrimaryButtons) {
        var b = eval(_root.arrayOfPrimaryButtons[i]);
        b.onRelease = function () {
            _root.masterButtonRelease(this);
        };
    }
    for (var i in _root.arrayOfSpecialButtons) {
        var b = eval(_root.arrayOfSpecialButtons[i]);
        b.onRelease = function () {
            _root.masterButtonRelease(this);
        };
    }
}
function masterButtonRelease(whatButton) {
    var _loc2 = whatButton._name;
    if (_root.gLockedArray.length == 0) {
        switch (_loc2) {
            case "startButton": {
                mainGame();
                break;
            }
            case "add1": {
                _root.addToPlays(1);
                break;
            }
            case "add10": {
                _root.addToPlays(10);
                break;
            }
            case "add100": {
                _root.addToPlays(100);
                break;
            }
            case "add250": {
                _root.addToPlays(250);
                break;
            }
            case "actionButton": {
                if (Number(_root.plays.text) > 0) {
                    setHighlightMC("Highlight Play of", _root.plays.text + " plays");
                    _root.locked("animation");
                    _root.callAction("playTokens", _root.plays.text, _root.totalTokens.text, _root.totalPoints.text);
                }
                else {
                    alert("You must choose one or more plays to start. Click on any of the star buttons to add plays");
                }
                break;
            }
            case "exitButton": {
                setUp();
                break;
            }
            case "helpButton": {
                getURL(_root.HelpPath, "_blank");
                break;
            }
            case "soundButton": {
                _root.soundToggle();
                break;
            }
            default: {
                _root.alert("No button assigned");
            }
        }
    }
    switch (_loc2) {
        case "alertCloseButton": {
            _root.alert();
            break;
        }
        case "tryAgain": {
            _root.tryAgain();
            _root.alert();
            break;
        }
        case :
    }
}
function setHighlightMC(text1, text2) {
    if (text1 != undefined) {
        _root.highlightMC._visible = true;
        _root.highlightMC.plays1.text = text1;
        _root.highlightMC.plays2.text = text2;
    }
    else {
        _root.highlightMC._visible = false;
    }
}
function startGame() {
    trace ("THE LOGO PATH:" + LogoPath);
    if (System.capabilities.playerType == "External") {
        _global.gAuth = true;
    }
    else {
        _global.gAuth = false;
    }
    logomc.loadMovie(LogoPath);
    logomc2.loadMovie(LogoPath);
    startScreen.logoholder.logomc.loadMovie(LogoPath);
    startScreen.logoholder.logomc2.loadMovie(LogoPath);
    db(".. startGame " + startGame, "0");
    _global.gGameID = _root.GameID;
    if (_global.gGameID == undefined) {
        _global.gGameID = "10001";
    }
    db(" **** " + _global.gGameID);
    setUp();
    initMainVariables();
    initMainButtons();
    _root.frameworkMC.connectionMC.source_version.text = version;
    fm.defaultTrack = new Sound();
    fm.defaultTrack.attachSound("defaultTrack");
    fm.defaultTrack.start();
    trace (" >****>>> " + fm + " --- " + fm.defaultTrack);
    helpToggle();
    if (_root.SoundControl == "1" || _root.SoundControl == "2") {
        soundToggle(true);
    }
    else {
        soundToggle(false);
    }
    _root.alertMC._visible = false;
    _root.loaderMC._visible = false;
    _root.winScreen._visible = false;
    var _loc4 = setInterval(this, "idle", 1);
    gdbAudit(arrayOfSpecialButtons);
    gdbAudit(arrayOfPrimaryButtons);
    gdbAudit(arrayOfObjects);
}
function showCurrentResults() {
    db(".. showCurrentResults " + showCurrentResults, "0");
    var _loc3 = _global.gLastPlayTokensResultObject;
    for (var _loc4 in _loc3) {
        _root[_loc4].text = _loc3[_loc4];
        _root.winScreen[_loc4].text = _loc3[_loc4];
        if (typeof(_loc3[_loc4]) == "string") {
            trace (" xxxx " + _loc4 + " = " + _loc3[_loc4]);
            continue;
        }
        trace (" xxxx " + _loc4 + " = " + typeof(_loc3[_loc4]));
    }
    _root.winScreen.plays.text = _root.plays.text;
}
function playTokensDone() {
    _root.setHighlightMC();
    _root.designer_playTokensDone();
}
function successFalseError(errorText) {
    highlightMC._visible = false;
    _root.gStartUpAspRequestStage = "error";
    alert(unescape(errorText));
    locked("error");
    startScreen._visible = true;
}
function aspRequestParse(result_lv) {
    if (result_lv.success != "true") {
        successFalseError(result_lv.ErrorText);
    }
    else {
        _root.frameworkMC.debugDataMC.debugData.text = _root.frameworkMC.debugDataMC.debugData.text + "\r-----------------\r";
        var _loc5 = _root.gCurrentRequest;
        _root.frameworkMC.connectionMC.debugData.text = _root.frameworkMC.connectionMC.debugData.text + ("----> " + _loc5 + " " + result_lv.tokens);
        System.setClipboard(fm.debugDataMC.debugData.text);
        gInfo = result_lv;
        for (var _loc4 in gInfo) {
            if (typeof(gInfo[_loc4]) == "string") {
                continue;
            }
        }
        if (_loc5 == "getposs") {
            _root.frameworkMC.connectionMC.result_getposs.text = _root.frameworkMC.connectionMC.result_getposs.text + ("possdata = " + result_lv.possdata + "\n" + "success = " + result_lv.success + "\n");
            parsePossibilityString(result_lv.possdata);
            _root.frameworkMC.connectionMC.result_getposs.text = _root.frameworkMC.connectionMC.result_getposs.text + " =aspRequestEnd= \r";
        }
        else if (_loc5 == "getinfo") {
            gInfo = result_lv;
            db(" >>>> " + gInfo.length);
            for (var _loc6 in gInfo) {
                db(" i " + _loc6 + " = " + gInfo[_loc6]);
                _root.frameworkMC[_loc6].text = gInfo[_loc6];
                _root[_loc6].text = gInfo[_loc6];
            }
        }
        else if (_loc5 == "playtokens") {
            _global.gPlayResult = result_lv;
            _global.gLastPlayTokensResultObject = result_lv;
            for (var _loc6 in result_lv) {
                _root.frameworkMC["result_" + _loc6].text = result_lv[_loc6];
                db(_loc6 + " " + result_lv[_loc6]);
            }
            _root.playTokensDone();
        }
        _root.frameworkMC.debugDataMC.debugData.text = _root.frameworkMC.debugDataMC.debugData.text + " =aspRequestEnd= \r";
        System.setClipboard(_root.frameworkMC.debugDataMC.debugData.text);
    }
}
function aspRequest(theAction, theGameID, requestObject) {
    db(".. aspRequest " + aspRequest, "0");
    db(" ASP REQUEST " + theAction + " / " + theGameID + " / " + requestObject);
    _root.loaderMC._visible = true;
    gCurrentRequest = theAction;
    if (gAuth == false) {
        var result_lv = new LoadVars();
        result_lv.onload = function (success) {
            _root.loaderMC._visible = false;
            if (success) {
                aspRequestParse(result_lv);
            }
            else {
                _root.frameworkMC.debugDataMC.debugData.text = "Error connecting to server.";
                successFalseError("There was a problem. Please try again later.");
            }
            gCurrentRequest = "";
            if (_root.gStartUpAspRequestStage == "begin") {
                _root.gStartUpAspRequestStage = "done";
                _root.aspRequest("getposs", _global.gGameID);
            }
        };
        var _loc3 = new LoadVars();
        _loc3.action = theAction;
        _loc3.gameid = theGameID;
        if (theAction == "playtokens") {
            _loc3.plays = requestObject.plays;
            _loc3.tokens = requestObject.tokens;
            _loc3.points = requestObject.points;
        }
        _loc3.sendAndLoad(_root.actionURL, result_lv, "POST");
    }
    else {
        db(" DEBUG " + gCurrentRequest);
        if (gCurrentRequest == "getposs") {
        }
        else if (gCurrentRequest == "getinfo") {
            var result_lv = new Object();
            result_lv.success = "true";
            result_lv.count = "1";
            result_lv.UserLevel = "10";
            result_lv.points = "43845";
            result_lv.tokens = "96370";
            aspRequestParse(result_lv);
        }
        else if (gCurrentRequest == "playtokens") {
            var result_lv = new Object();
            result_lv.success = "true";
            result_lv.displaypoints = "5000";
            result_lv.displayid = "1000102";
            result_lv.newpoints = "5000";
            result_lv.tokens = "102";
            result_lv.points = "1345";
            aspRequestParse(result_lv);
        }
        if (_root.gStartUpAspRequestStage == "begin") {
            _root.gStartUpAspRequestStage = "done";
            _root.aspRequest("getposs", _global.gGameID);
        }
    }
}
function parsePossibilityString(theString) {
    db(".. parsePossibilityString " + parsePossibilityString, "0");
    var _loc3 = theString.split("---");
    for (var _loc2 = 0; _loc2 < _loc3.length; ++_loc2) {
        _root.gPossibilityArray[_loc2] = _loc3[_loc2].split("_");
        _root.frameworkMC.connectionMC.result_getposs.text = _root.frameworkMC.connectionMC.result_getposs.text + (_root.gPossibilityArray[_loc2] + "\n");
    }
}
function primaryButtonsAlpha(whatAlpha) {
    for (var i in arrayOfPrimaryButtons) {
        eval(arrayOfPrimaryButtons[i])._alpha = whatAlpha;
    }
}
function soundToggle(whichWay) {
    db(".. soundToggle " + soundToggle, "0");
    if (whichWay == undefined) {
        whichWay = !gSoundOn;
    }
    gSoundOn = whichWay;
    if (gSoundOn == true) {
        if (_root.SoundControl != "0") {
            fm.defaultTrack.setVolume(100);
            _root.soundButton.gotoAndStop("true");
            db("soundToggle VALUE= " + whichWay + " " + fm.defaultTrack.getVolume(), "0");
        }
    }
    else if (_root.SoundControl != "1") {
        fm.defaultTrack.setVolume(0);
        _root.soundButton.gotoAndStop("false");
        db("soundToggle VALUE= " + whichWay + " " + fm.defaultTrack.getVolume(), "0");
    }
}
function helpToggle(whichWay) {
    db(".. helpToggle " + helpToggle, "0");
    var _loc3 = _root.helpMC._visible;
    if (whichWay == undefined) {
        whichWay = !_loc3;
    }
    _root.helpMC._visible = whichWay;
}
function debugToggle(whichWay) {
    db(".. debugToggle " + debugToggle, "0");
    var _loc2 = fm._visible;
    if (whichWay == undefined) {
        whichWay = !_loc2;
    }
    fm._visible = whichWay;
}
function randomFromRange() {
    var _loc3 = random(gRange);
    for (var _loc4 in gPossibilityArray) {
        var _loc2 = gPossibilityArray[_loc4][4];
        var _loc1 = gPossibilityArray[_loc4 + 1][4];
        if (_loc3 >= _loc2 && _loc3 < _loc1) {
        }
    }
    db(_loc3);
}
function setUp() {
    startScreen._visible = true;
    winScreen._visible = false;
    winScreen.stop();
    highlightMC._visible = false;
    designer_setUp();
}
function endScene() {
    locked("animation", false);
    _root.winScreen._visible = true;
    winScreen.play();
    showCurrentResults();
    designer_endScene();
}
function dbOLD(whatText, whatStage) {
    _global.dbTrace(whatText);
}
function randomize(whatArray) {
    var _loc3 = new Array();
    for (var _loc4 in whatArray) {
        var _loc2 = random(whatArray.length);
        _loc3.push(whatArray.splice(_loc2, 1));
    }
    return (_loc3);
}
function alert(whatText) {
    if (whatText != undefined) {
        _root.alertMC.alertText.text = whatText;
        _root.alertMC._visible = true;
        _root.locked("alert");
    }
    else {
        locked("alert", false);
        _root.alertMC._visible = false;
    }
}
function locked(whatReason, isTrue) {
    if (isTrue != false) {
        _root.gLockedArray.push(whatReason);
        primaryButtonsAlpha(50);
    }
    else {
        for (var _loc2 = 0; _loc2 < gLockedArray.length; ++_loc2) {
            if (gLockedArray[_loc2] == whatReason) {
                gLockedArray.splice(_loc2, 1);
                break;
            }
        }
        if (gLockedArray.length < 1) {
            primaryButtonsAlpha(100);
        }
    }
}
function designer_mainGame() {
    _global.gHavePlayed = true;
    _root.startScreen.bigAni.stop();
    _root.board.chooser._visible = false;
    _root.board.disc._visible = false;
    _root.chooser2._visible = true;
    _root.chooser3._visible = false;
}
function setUpChooser() {
    _root.chooser2._visible = false;
    _root.chooser3._visible = false;
    _root.board.chooser._visible = true;
    _root.board.disc._visible = true;
}
function designer_addToPlays() {
    _root.chooser2._visible = false;
    _root.chooser3._visible = true;
}
function designer_endScene() {
    _root.crowdSound.play();
    _root.winScreen.show;
    _root.winScreen.gotoAndStop("victory3");
}
function designer_setUp() {
    _root.crowdSound.gotoAndStop(1);
    stopAllSounds ();
    _root.gotoAndStop(2);
    _root.board.bonus._x = -103.900000;
    _root.board.disc._x = _root.board.disc.myX;
    _root.board.disc._y = _root.board.disc.myY;
    _root.boardBonus.bonus._x = -103.900000;
    _root.boardBonus.disc._x = _root.boardBonus.disc.myX;
    _root.boardBonus.disc._y = _root.boardBonus.disc.myY;
    _root.startScreen.bigAni.play();
    scoreboard.score_txt.text = "0";
    plays.text = "0";
    winScreen._visible = false;
    _root.winScreen.gotoAndStop(1);
    _root.crowdSound.gotoAndStop(1);
    _root.chooser2._visible = false;
    _root.chooser3._visible = false;
    trace (" vvvvv " + _global.gHavePlayed);
    if (_global.gHavePlayed == true) {
        trace (" vvvvv222 " + _root.startScreen.startButton);
        _root.mainGame();
    }
}
function designer_playTokensDone() {
    trace (" bbbbbb " + storedChoice);
    chooseStart2(storedChoice);
}
_global.gdbUtilitiesVersion = "1.2.7";
_global.gdbLastClocked = 0;
_global.db = function (whatText, whatStage, whatTarget) {
    trace ("u] " + whatText);
    _root.debugger.traceModule.traceOutput.label.text = _root.debugger.traceModule.traceOutput.label.text + (whatText + "\n");
};
_global.gdbClock = function (whatText) {
    var _loc1 = getTimer() - gdbLastClocked;
    trace ("***] " + whatText + " : " + _loc1);
    gdbLastClocked = getTimer();
};
_global.gdbCreateDebugger = function (visibleToStart, arrayOfButtons) {
    var _loc10 = _root.createEmptyMovieClip("versionMC", _root.getNextHighestDepth());
    var _loc12 = new flash.display.BitmapData(10, 10, false, 13421772);
    _loc10.attachBitmap(_loc12, this.getNextHighestDepth());
    var theVersion = _loc10.createTextField("theVersion", 1, 0, 0, 30, 16);
    debugButtonStyle(theVersion, "0", 65535);
    _loc10.onRelease = function () {
        trace (this._alpha);
        if (Key.isDown(16)) {
            if (this._alpha == 0) {
                this.theVersion.text = _global.gVersion;
                this._alpha = 100;
                this.theVersion._visible = true;
            }
            else {
                this._alpha = 0;
                this.theVersion._visible = false;
            }
        }
    };
    _loc10._alpha = 0;
    _loc10.theVersion._visible = false;
    var _loc8 = 15;
    var _loc6 = 15;
    var _loc7 = 300;
    if (_root.debugger != undefined) {
        debugger.removeMovieClip();
    }
    var debugger = _root.createEmptyMovieClip("debugger", _root.getNextHighestDepth());
    var _loc11 = debugger.createEmptyMovieClip("debuggerBG", debugger.getNextHighestDepth());
    var label = _loc11.createTextField("label", 1, 0, 0, _loc7, 35);
    debugButtonStyle(label, _global.gVersion, 16777164);
    _loc11.onPress = function () {
        startDrag (this._parent, false);
    };
    _loc11.onRelease = function () {
        stopDrag ();
    };
    for (var _loc4 = 0; _loc4 < arrayOfButtons.length; ++_loc4) {
        theY = _loc8 + _loc6 * _loc4;
        _loc10 = debugger.createEmptyMovieClip(arrayOfButtons[_loc4], debugger.getNextHighestDepth());
        _loc10._y = theY;
        var label = _loc10.createTextField("label", 1, 0, 0, _loc7, _loc6);
        debugButtonStyle(label, arrayOfButtons[_loc4], 16776960);
        _loc10.onRelease = function () {
            trace (this.label);
        };
    }
    var _loc9 = debugger.createEmptyMovieClip("traceModule", debugger.getNextHighestDepth());
    _loc9._y = _loc8;
    _loc10 = _loc9.createEmptyMovieClip("traceMainButton", _loc9.getNextHighestDepth());
    _loc10._y = 0;
    var label = _loc10.createTextField("label", 1, 0, 0, _loc7, _loc6);
    debugButtonStyle(label, "Close this window", 16711680);
    _loc10.onRelease = function () {
        debuggerVisible(false);
    };
    _loc10 = _loc9.createEmptyMovieClip("traceOutput", _loc9.getNextHighestDepth());
    _loc10._y = _loc6;
    var label = _loc10.createTextField("label", 1, 0, 0, _loc7, 300);
    debugButtonStyle(label, "traceOutput", 16777215);
    _loc10.label.text = "";
    debuggerVisible(visibleToStart);
};
_global.gdbSetUp = function () {
    _global.keyListener = new Object();
    var passCodeArray = new Array(81, 81, 81);
    var passCodeInt = 0;
    keyListener.onkeyup = function () {
        if (passCodeArray[passCodeInt] == Key.getCode() && Key.isDown(16)) {
            ++passCodeInt;
            if (passCodeInt >= passCodeArray.length) {
                trace ("UNLOCKED");
                debuggerVisible(true);
                // Jump to 14167
            }
        }
        else {
            passCodeInt = 0;
        }
        trace (Key.getCode());
    };
    Key.addListener(keyListener);
};
_global.gdbAudit = function (listToCheck) {
    var errorsArray = new Array();
    for (var i in listToCheck) {
        var obj = eval(listToCheck[i]);
        if (obj == undefined) {
            errorsArray.push(listToCheck[i]);
        }
    }
    if (errorsArray.length > 0) {
        var errorText = "The following errors occurred:\r\r";
        errorText = errorText + ("These objects were expected but not found= " + errorsArray);
        gdbError(errorText);
    }
};
_global.gdbIsInArray = function (whatValue, whatArray) {
    for (var _loc3 in whatArray) {
        if (whatValue == whatArray[_loc3]) {
            do {
            } while (null != null)
            return (true);
        }
    }
    return (false);
};
_global.gdbRemoveFromArray = function (whatValue, whatArray) {
    for (var _loc3 in whatArray) {
        if (whatValue == whatArray[_loc3]) {
            whatArray.splice(_loc3, 1);
            do {
            } while (null != null)
            return (true);
        }
    }
    return (false);
};
_global.gdbSetBlock = function (whatMC) {
    whatMC.onRelease = function () {
    };
    whatMC.useHandCursor = false;
};
_global.gdbSet = function (whatMC, whatSetting) {
    whatMC.pToggle = whatSetting;
    whatMC.gotoAndStop(whatMC.pToggle);
};
_global.gdbToggle = function (whatMC, whatDefault) {
    if (whatMC.pToggle == undefined) {
        whatMC.pToggle = whatDefault;
    }
    if (whatMC.pToggle == "off") {
        whatMC.pToggle = "on";
    }
    else {
        whatMC.pToggle = "off";
    }
    whatMC.gotoAndStop(whatMC.pToggle);
};
_global.dbObject = function (whatObj) {
    db(" --- dbObject trace: ----");
    for (var _loc2 in whatObj) {
        db(whatObj[_loc2] + " = " + _loc2);
    }
    db(" ------------------------");
};
_global.gdbError = function (whatText) {
    if (_root.errorText == undefined) {
        var _loc2 = _root.createTextField("errorText", 1, 0, 0, 400, 300);
        _root.defaultFieldStyle(_loc2);
    }
    _loc2.text = whatText;
};
gdbSetUp();
gdbCreateDebugger(false, ["trace", "bTest2", "fTest3", "fTest4"]);
var version = "1.1";
var actionURL = "action.asp";
var arrayOfObjects = new Array();
var arrayOfPrimaryButtons = new Array();
var arrayOfSpecialButtons = new Array();
arrayOfObjects.push("_root.startScreen");
arrayOfPrimaryButtons.push("_root.startScreen.startButton");
arrayOfObjects.push("_root.plays");
arrayOfObjects.push("_root.points");
arrayOfObjects.push("_root.tokens");
arrayOfObjects.push("_root.winScreen");
arrayOfObjects.push("_root.winScreen.displaypoints");
arrayOfObjects.push("_root.winScreen.newpoints");
arrayOfObjects.push("_root.highlightMC");
arrayOfObjects.push("_root.highlightMC.plays1");
arrayOfObjects.push("_root.highlightMC.plays2");
arrayOfObjects.push("_root.alertMC");
arrayOfObjects.push("_root.alertMC.alertText");
arrayOfSpecialButtons.push("_root.alertMC.alertCloseButton");
arrayOfObjects.push("_root.helpMC");
arrayOfPrimaryButtons.push("_root.add1");
arrayOfPrimaryButtons.push("_root.add10");
arrayOfPrimaryButtons.push("_root.add100");
arrayOfPrimaryButtons.push("_root.add250");
arrayOfPrimaryButtons.push("_root.actionButton");
arrayOfPrimaryButtons.push("_root.exitButton");
arrayOfPrimaryButtons.push("_root.soundButton");
arrayOfPrimaryButtons.push("_root.helpButton");
arrayOfPrimaryButtons.push("_root.winScreen.tryAgain");
var fm;
var gGameStatus = "None";
var gCurrentRequest = "";
var gPossibilityArray = new Array(4, 3, 2);
var gSoundOn = false;
var gSoundOption = true;
var gTokenMax = 400;
var gRange = -1;
var gInfo = new Object();
var gPlayResult = new Object();
var gLog;
var gLastPlayTokensResultObject = new Object();
var gStartUpAspRequestStage = "begin";
var gLockedArray = new Array();
db(" oooo " + System.capabilities.playerType);
_global.gVersion = "3.25";
startGame();
designer_setUp();
_global.shiftLeft = function () {
    gBoard.disc._x = gBoard.disc._x - 20;
    gBoard.disc._y = gBoard.disc._y + 20;
    --currSlot;
    nextRoll();
};
_global.shiftRight = function () {
    gBoard.disc._x = gBoard.disc._x + 20;
    gBoard.disc._y = gBoard.disc._y + 20;
    ++currSlot;
    nextRoll();
};
_global.rollRight = function () {
    gBoard.disc.gotoAndPlay("rollRight");
};
_global.rollLeft = function () {
    gBoard.disc.gotoAndPlay("rollLeft");
};
_global.nextRoll = function () {
    if (currLevel >= totalLevels) {
        gBoard.disc.gotoAndStop(1);
        if (gBoard == _root.board && _root.stopOnFirstBoard == false) {
            _root.play();
        }
        else {
            setBonus();
        }
    }
    else {
        ++currLevel;
        var _loc2 = Math.abs(totalLevels - currLevel);
        var _loc3 = Math.abs(currSlot - goalSlot);
        if (_loc3 >= _loc2) {
            if (currSlot - goalSlot < 0) {
                rollRight();
            }
            else {
                rollLeft();
            }
        }
        else if (currSlot == 1) {
            rollRight();
        }
        else if (currSlot == totalSlots) {
            rollLeft();
        }
        else if (random(2) == 1) {
            rollLeft();
        }
        else {
            rollRight();
        }
    }
};
_global.setValues = function () {
    trace (" ............" + _global.gFinalGoalSlot);
    _root.goalSlot = _global.gFinalGoalSlot;
    if (gBoard == _root.board && _root.stopOnFirstBoard == false) {
        trace ("OVERRIDE- force to 8");
        goalSlot = 8;
    }
    currSlot = 8;
    currLevel = 0;
    totalSlots = 15;
    totalLevels = 14;
    discBaseX = 82.500000;
    board.disc._x = board.disc.myX;
    board.disc._y = board.disc.myY;
    boardBonus.disc._x = boardBonus.disc.myX;
    boardBonus.disc._y = boardBonus.disc.myY;
};
_global.chooseStart = function (whichChoice) {
    _global.storedChoice = whichChoice;
    _root.masterButtonRelease(_root.actionButton);
};
_global.chooseStart2 = function (whichChoice) {
    trace (" yyy " + _global.gPlayResult.displayid);
    trace (" yyy " + Number(_global.gPlayResult.displayid.substr(-2, 2)));
    var _loc3 = Number(_global.gPlayResult.displayid.substr(-2, 2));
    if (_loc3 > 7) {
        _root.stopOnFirstBoard = true;
    }
    else {
        _root.stopOnFirstBoard = false;
    }
    var _loc4 = [0, 8, 4, 12, 14, 2, 6, 10, 4, 12, 14, 2, 6, 10];
    _global.gFinalGoalSlot = _loc4[_loc3];
    _global.setValues();
    currSlot = whichChoice * 2 + 1;
    gBoard.disc._x = discBaseX + currSlot * 20;
    gBoard.chooser._visible = false;
    nextRoll();
};
_global.randomGo = function (whatMC) {
    if (random(2) == 1) {
        whatMC.gotoAndPlay("rightSide" + random(2));
    }
    else {
        whatMC.gotoAndPlay("leftSide" + random(2));
    }
};
_global.setBonus = function (whichSlot) {
    var _loc4 = [8, 50, 3, 0, 2, 20, 14];
    var _loc3 = [230, 900, 100, 5000, 75, 600, 400];
    whichSlot = goalSlot / 2 - 1;
    var _loc5 = [67, 117, 169, 222, 276, 328, 378];
    gBoard.bonus.gotoAndPlay(2);
    gBoard.bonus._x = _loc5[whichSlot];
    if (gBoard == _root.board) {
        gBoard.bonus.bonusText.text = String(_loc4[whichSlot]);
    }
    else {
        gBoard.bonus.bonusText.text = String(_loc3[whichSlot]);
    }
    stop ();
    _root.base.showCurrentResults();
    _root.endScene();
};
_global.gFinalGoalSlot = -1;
_global.gHavePlayed = false;

// [Action in Frame 2]
_global.goalSlot = 6;
_global.currSlot = 8;
_global.currLevel = 0;
_global.totalSlots = 15;
_global.totalLevels = 4;
_global.stopOnFirstBoard = false;
boardBonus.gotoAndStop("bonus");
_global.gBoard = _root.board;
setValues();
stop ();

// [Action in Frame 18]
_global.gBoard = _root.boardBonus;
setValues();
nextRoll();

// [Action in Frame 20]
stop ();


Is This A Good Question/Topic? 0
  • +

Replies To: Can You Crack My .Swf Game?

#2 shivam dixit  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 24-September 13

Re: Can You Crack My .Swf Game?

Posted 25 September 2013 - 09:53 AM

View PostGForGreat, on 25 September 2013 - 09:47 AM, said:

Here is the situation, I am a full time student and work full time. I wrote this game for my CIS class. It is a peg game where you drop the ball/token in the top slot and it bounces off of pins on the way down, landing on your score at the bottom. So, the game is complete and my main goal is to make each "token" worth approximately eight points, with the feeling of equal odds of winning. I would post the game here for you all to play but I have it coded to pull the 'token' value from a web page where you earn tokes through answering questions correctly(I have not made it live at this point). What I would like to ask of all of you is to see if you can crack the pattern from looking at the code, can you tell me where you can drop the token to win every time/win in a discernible pattern. I've got a $10 dollar Starbucks gift-card(Got it as a gift from someone who doesn't know i loath coffee) for the first one to pm me the correct way(/s (I only know of one way myself)).

Here comes the code.

// Action script...

// [onClipEvent of sprite 48 in frame 1]
on (release) {
    _root.setUpChooser();
}

// [Action in Frame 1]
function debuggerVisible(whichWay) {
    _root.debugger._visible = whichWay;
    _root.debugger.debuggerBG.label.text = _global.gVersion;
}
function debugButtonStyle(whatTextfield, whatText, bgColor) {
    defaultFieldStyle(whatTextfield);
    whatTextfield.text = whatText;
    whatTextfield.backgroundColor = bgColor;
    var _loc1 = new TextFormat();
    _loc1.size = 12;
    whatTextfield.setTextFormat(_loc1);
}
function defaultFieldStyle(whatTextFieldRef) {
    whatTextFieldRef.border = true;
    whatTextFieldRef.background = true;
    whatTextFieldRef.wordWrap = true;
    whatTextFieldRef.multiline = true;
}
function debug(theString) {
    db(".. debug " + debug, "0");
    if (theString == "soundToggle") {
        soundToggle();
    }
    else if (theString == "helpToggle") {
    }
    else if (theString == "Call_getposs") {
        aspRequest("getposs", _global.gGameID);
    }
    else if (theString == "Call_getinfo") {
        aspRequest("getinfo", _global.gGameID);
    }
    else if (theString == "Call_playtokens") {
        var _loc3 = new Object();
        _loc3.plays = _root.frameworkMC.connectionMC.input_plays.text;
        _loc3.tokens = _root.frameworkMC.connectionMC.input_tokens.text;
        _loc3.points = _root.frameworkMC.connectionMC.input_points.text;
        aspRequest("playtokens", _global.gGameID, _loc3);
    }
}
function mainGame() {
    _root.startScreen._visible = false;
    _root.designer_mainGame();
}
function addToPlays(whatAmount) {
    plays.text = Number(plays.text) + whatAmount;
    if (Number(plays.text) > Number(tokens.text)) {
        plays.text = tokens.text;
    }
    _root.designer_addToPlays();
}
function tryAgain() {
    setUp();
}
function callAction(actionString, plays, tokens, points) {
    db(".. callAction " + callAction, "0");
    if (actionString == "soundToggle") {
        soundToggle();
    }
    else if (actionString == "helpToggle") {
        getURL(_root.HelpPath, "_blank");
    }
    else if (actionString == "getPoss") {
        aspRequest("getposs", _global.gGameID);
    }
    else if (actionString == "getInfo") {
        aspRequest("getinfo", _global.gGameID);
    }
    else if (actionString == "playTokens") {
        var _loc3 = new Object();
        _loc3.plays = _root.plays.text;
        _loc3.tokens = _root.tokens.text;
        _loc3.points = _root.points.text;
        aspRequest("playtokens", _global.gGameID, _loc3);
    }
}
function idle() {
}
function initMainVariables() {
    db(".. initMainVariables " + initMainVariables, "0");
    fm = _root.frameworkMC;
    fm.source_gameID.text = _global.gGameID;
    gGameStatus = "StartUp";
    var _loc3 = "";
    fm.gameid.text = _global.gGameID;
    aspRequest("getinfo", _global.gGameID);
}
function initMainButtons() {
    for (var i in _root.arrayOfPrimaryButtons) {
        var b = eval(_root.arrayOfPrimaryButtons[i]);
        b.onRelease = function () {
            _root.masterButtonRelease(this);
        };
    }
    for (var i in _root.arrayOfSpecialButtons) {
        var b = eval(_root.arrayOfSpecialButtons[i]);
        b.onRelease = function () {
            _root.masterButtonRelease(this);
        };
    }
}
function masterButtonRelease(whatButton) {
    var _loc2 = whatButton._name;
    if (_root.gLockedArray.length == 0) {
        switch (_loc2) {
            case "startButton": {
                mainGame();
                break;
            }
            case "add1": {
                _root.addToPlays(1);
                break;
            }
            case "add10": {
                _root.addToPlays(10);
                break;
            }
            case "add100": {
                _root.addToPlays(100);
                break;
            }
            case "add250": {
                _root.addToPlays(250);
                break;
            }
            case "actionButton": {
                if (Number(_root.plays.text) > 0) {
                    setHighlightMC("Highlight Play of", _root.plays.text + " plays");
                    _root.locked("animation");
                    _root.callAction("playTokens", _root.plays.text, _root.totalTokens.text, _root.totalPoints.text);
                }
                else {
                    alert("You must choose one or more plays to start. Click on any of the star buttons to add plays");
                }
                break;
            }
            case "exitButton": {
                setUp();
                break;
            }
            case "helpButton": {
                getURL(_root.HelpPath, "_blank");
                break;
            }
            case "soundButton": {
                _root.soundToggle();
                break;
            }
            default: {
                _root.alert("No button assigned");
            }
        }
    }
    switch (_loc2) {
        case "alertCloseButton": {
            _root.alert();
            break;
        }
        case "tryAgain": {
            _root.tryAgain();
            _root.alert();
            break;
        }
        case :
    }
}
function setHighlightMC(text1, text2) {
    if (text1 != undefined) {
        _root.highlightMC._visible = true;
        _root.highlightMC.plays1.text = text1;
        _root.highlightMC.plays2.text = text2;
    }
    else {
        _root.highlightMC._visible = false;
    }
}
function startGame() {
    trace ("THE LOGO PATH:" + LogoPath);
    if (System.capabilities.playerType == "External") {
        _global.gAuth = true;
    }
    else {
        _global.gAuth = false;
    }
    logomc.loadMovie(LogoPath);
    logomc2.loadMovie(LogoPath);
    startScreen.logoholder.logomc.loadMovie(LogoPath);
    startScreen.logoholder.logomc2.loadMovie(LogoPath);
    db(".. startGame " + startGame, "0");
    _global.gGameID = _root.GameID;
    if (_global.gGameID == undefined) {
        _global.gGameID = "10001";
    }
    db(" **** " + _global.gGameID);
    setUp();
    initMainVariables();
    initMainButtons();
    _root.frameworkMC.connectionMC.source_version.text = version;
    fm.defaultTrack = new Sound();
    fm.defaultTrack.attachSound("defaultTrack");
    fm.defaultTrack.start();
    trace (" >****>>> " + fm + " --- " + fm.defaultTrack);
    helpToggle();
    if (_root.SoundControl == "1" || _root.SoundControl == "2") {
        soundToggle(true);
    }
    else {
        soundToggle(false);
    }
    _root.alertMC._visible = false;
    _root.loaderMC._visible = false;
    _root.winScreen._visible = false;
    var _loc4 = setInterval(this, "idle", 1);
    gdbAudit(arrayOfSpecialButtons);
    gdbAudit(arrayOfPrimaryButtons);
    gdbAudit(arrayOfObjects);
}
function showCurrentResults() {
    db(".. showCurrentResults " + showCurrentResults, "0");
    var _loc3 = _global.gLastPlayTokensResultObject;
    for (var _loc4 in _loc3) {
        _root[_loc4].text = _loc3[_loc4];
        _root.winScreen[_loc4].text = _loc3[_loc4];
        if (typeof(_loc3[_loc4]) == "string") {
            trace (" xxxx " + _loc4 + " = " + _loc3[_loc4]);
            continue;
        }
        trace (" xxxx " + _loc4 + " = " + typeof(_loc3[_loc4]));
    }
    _root.winScreen.plays.text = _root.plays.text;
}
function playTokensDone() {
    _root.setHighlightMC();
    _root.designer_playTokensDone();
}
function successFalseError(errorText) {
    highlightMC._visible = false;
    _root.gStartUpAspRequestStage = "error";
    alert(unescape(errorText));
    locked("error");
    startScreen._visible = true;
}
function aspRequestParse(result_lv) {
    if (result_lv.success != "true") {
        successFalseError(result_lv.ErrorText);
    }
    else {
        _root.frameworkMC.debugDataMC.debugData.text = _root.frameworkMC.debugDataMC.debugData.text + "\r-----------------\r";
        var _loc5 = _root.gCurrentRequest;
        _root.frameworkMC.connectionMC.debugData.text = _root.frameworkMC.connectionMC.debugData.text + ("----> " + _loc5 + " " + result_lv.tokens);
        System.setClipboard(fm.debugDataMC.debugData.text);
        gInfo = result_lv;
        for (var _loc4 in gInfo) {
            if (typeof(gInfo[_loc4]) == "string") {
                continue;
            }
        }
        if (_loc5 == "getposs") {
            _root.frameworkMC.connectionMC.result_getposs.text = _root.frameworkMC.connectionMC.result_getposs.text + ("possdata = " + result_lv.possdata + "\n" + "success = " + result_lv.success + "\n");
            parsePossibilityString(result_lv.possdata);
            _root.frameworkMC.connectionMC.result_getposs.text = _root.frameworkMC.connectionMC.result_getposs.text + " =aspRequestEnd= \r";
        }
        else if (_loc5 == "getinfo") {
            gInfo = result_lv;
            db(" >>>> " + gInfo.length);
            for (var _loc6 in gInfo) {
                db(" i " + _loc6 + " = " + gInfo[_loc6]);
                _root.frameworkMC[_loc6].text = gInfo[_loc6];
                _root[_loc6].text = gInfo[_loc6];
            }
        }
        else if (_loc5 == "playtokens") {
            _global.gPlayResult = result_lv;
            _global.gLastPlayTokensResultObject = result_lv;
            for (var _loc6 in result_lv) {
                _root.frameworkMC["result_" + _loc6].text = result_lv[_loc6];
                db(_loc6 + " " + result_lv[_loc6]);
            }
            _root.playTokensDone();
        }
        _root.frameworkMC.debugDataMC.debugData.text = _root.frameworkMC.debugDataMC.debugData.text + " =aspRequestEnd= \r";
        System.setClipboard(_root.frameworkMC.debugDataMC.debugData.text);
    }
}
function aspRequest(theAction, theGameID, requestObject) {
    db(".. aspRequest " + aspRequest, "0");
    db(" ASP REQUEST " + theAction + " / " + theGameID + " / " + requestObject);
    _root.loaderMC._visible = true;
    gCurrentRequest = theAction;
    if (gAuth == false) {
        var result_lv = new LoadVars();
        result_lv.onload = function (success) {
            _root.loaderMC._visible = false;
            if (success) {
                aspRequestParse(result_lv);
            }
            else {
                _root.frameworkMC.debugDataMC.debugData.text = "Error connecting to server.";
                successFalseError("There was a problem. Please try again later.");
            }
            gCurrentRequest = "";
            if (_root.gStartUpAspRequestStage == "begin") {
                _root.gStartUpAspRequestStage = "done";
                _root.aspRequest("getposs", _global.gGameID);
            }
        };
        var _loc3 = new LoadVars();
        _loc3.action = theAction;
        _loc3.gameid = theGameID;
        if (theAction == "playtokens") {
            _loc3.plays = requestObject.plays;
            _loc3.tokens = requestObject.tokens;
            _loc3.points = requestObject.points;
        }
        _loc3.sendAndLoad(_root.actionURL, result_lv, "POST");
    }
    else {
        db(" DEBUG " + gCurrentRequest);
        if (gCurrentRequest == "getposs") {
        }
        else if (gCurrentRequest == "getinfo") {
            var result_lv = new Object();
            result_lv.success = "true";
            result_lv.count = "1";
            result_lv.UserLevel = "10";
            result_lv.points = "43845";
            result_lv.tokens = "96370";
            aspRequestParse(result_lv);
        }
        else if (gCurrentRequest == "playtokens") {
            var result_lv = new Object();
            result_lv.success = "true";
            result_lv.displaypoints = "5000";
            result_lv.displayid = "1000102";
            result_lv.newpoints = "5000";
            result_lv.tokens = "102";
            result_lv.points = "1345";
            aspRequestParse(result_lv);
        }
        if (_root.gStartUpAspRequestStage == "begin") {
            _root.gStartUpAspRequestStage = "done";
            _root.aspRequest("getposs", _global.gGameID);
        }
    }
}
function parsePossibilityString(theString) {
    db(".. parsePossibilityString " + parsePossibilityString, "0");
    var _loc3 = theString.split("---");
    for (var _loc2 = 0; _loc2 < _loc3.length; ++_loc2) {
        _root.gPossibilityArray[_loc2] = _loc3[_loc2].split("_");
        _root.frameworkMC.connectionMC.result_getposs.text = _root.frameworkMC.connectionMC.result_getposs.text + (_root.gPossibilityArray[_loc2] + "\n");
    }
}
function primaryButtonsAlpha(whatAlpha) {
    for (var i in arrayOfPrimaryButtons) {
        eval(arrayOfPrimaryButtons[i])._alpha = whatAlpha;
    }
}
function soundToggle(whichWay) {
    db(".. soundToggle " + soundToggle, "0");
    if (whichWay == undefined) {
        whichWay = !gSoundOn;
    }
    gSoundOn = whichWay;
    if (gSoundOn == true) {
        if (_root.SoundControl != "0") {
            fm.defaultTrack.setVolume(100);
            _root.soundButton.gotoAndStop("true");
            db("soundToggle VALUE= " + whichWay + " " + fm.defaultTrack.getVolume(), "0");
        }
    }
    else if (_root.SoundControl != "1") {
        fm.defaultTrack.setVolume(0);
        _root.soundButton.gotoAndStop("false");
        db("soundToggle VALUE= " + whichWay + " " + fm.defaultTrack.getVolume(), "0");
    }
}
function helpToggle(whichWay) {
    db(".. helpToggle " + helpToggle, "0");
    var _loc3 = _root.helpMC._visible;
    if (whichWay == undefined) {
        whichWay = !_loc3;
    }
    _root.helpMC._visible = whichWay;
}
function debugToggle(whichWay) {
    db(".. debugToggle " + debugToggle, "0");
    var _loc2 = fm._visible;
    if (whichWay == undefined) {
        whichWay = !_loc2;
    }
    fm._visible = whichWay;
}
function randomFromRange() {
    var _loc3 = random(gRange);
    for (var _loc4 in gPossibilityArray) {
        var _loc2 = gPossibilityArray[_loc4][4];
        var _loc1 = gPossibilityArray[_loc4 + 1][4];
        if (_loc3 >= _loc2 && _loc3 < _loc1) {
        }
    }
    db(_loc3);
}
function setUp() {
    startScreen._visible = true;
    winScreen._visible = false;
    winScreen.stop();
    highlightMC._visible = false;
    designer_setUp();
}
function endScene() {
    locked("animation", false);
    _root.winScreen._visible = true;
    winScreen.play();
    showCurrentResults();
    designer_endScene();
}
function dbOLD(whatText, whatStage) {
    _global.dbTrace(whatText);
}
function randomize(whatArray) {
    var _loc3 = new Array();
    for (var _loc4 in whatArray) {
        var _loc2 = random(whatArray.length);
        _loc3.push(whatArray.splice(_loc2, 1));
    }
    return (_loc3);
}
function alert(whatText) {
    if (whatText != undefined) {
        _root.alertMC.alertText.text = whatText;
        _root.alertMC._visible = true;
        _root.locked("alert");
    }
    else {
        locked("alert", false);
        _root.alertMC._visible = false;
    }
}
function locked(whatReason, isTrue) {
    if (isTrue != false) {
        _root.gLockedArray.push(whatReason);
        primaryButtonsAlpha(50);
    }
    else {
        for (var _loc2 = 0; _loc2 < gLockedArray.length; ++_loc2) {
            if (gLockedArray[_loc2] == whatReason) {
                gLockedArray.splice(_loc2, 1);
                break;
            }
        }
        if (gLockedArray.length < 1) {
            primaryButtonsAlpha(100);
        }
    }
}
function designer_mainGame() {
    _global.gHavePlayed = true;
    _root.startScreen.bigAni.stop();
    _root.board.chooser._visible = false;
    _root.board.disc._visible = false;
    _root.chooser2._visible = true;
    _root.chooser3._visible = false;
}
function setUpChooser() {
    _root.chooser2._visible = false;
    _root.chooser3._visible = false;
    _root.board.chooser._visible = true;
    _root.board.disc._visible = true;
}
function designer_addToPlays() {
    _root.chooser2._visible = false;
    _root.chooser3._visible = true;
}
function designer_endScene() {
    _root.crowdSound.play();
    _root.winScreen.show;
    _root.winScreen.gotoAndStop("victory3");
}
function designer_setUp() {
    _root.crowdSound.gotoAndStop(1);
    stopAllSounds ();
    _root.gotoAndStop(2);
    _root.board.bonus._x = -103.900000;
    _root.board.disc._x = _root.board.disc.myX;
    _root.board.disc._y = _root.board.disc.myY;
    _root.boardBonus.bonus._x = -103.900000;
    _root.boardBonus.disc._x = _root.boardBonus.disc.myX;
    _root.boardBonus.disc._y = _root.boardBonus.disc.myY;
    _root.startScreen.bigAni.play();
    scoreboard.score_txt.text = "0";
    plays.text = "0";
    winScreen._visible = false;
    _root.winScreen.gotoAndStop(1);
    _root.crowdSound.gotoAndStop(1);
    _root.chooser2._visible = false;
    _root.chooser3._visible = false;
    trace (" vvvvv " + _global.gHavePlayed);
    if (_global.gHavePlayed == true) {
        trace (" vvvvv222 " + _root.startScreen.startButton);
        _root.mainGame();
    }
}
function designer_playTokensDone() {
    trace (" bbbbbb " + storedChoice);
    chooseStart2(storedChoice);
}
_global.gdbUtilitiesVersion = "1.2.7";
_global.gdbLastClocked = 0;
_global.db = function (whatText, whatStage, whatTarget) {
    trace ("u] " + whatText);
    _root.debugger.traceModule.traceOutput.label.text = _root.debugger.traceModule.traceOutput.label.text + (whatText + "\n");
};
_global.gdbClock = function (whatText) {
    var _loc1 = getTimer() - gdbLastClocked;
    trace ("***] " + whatText + " : " + _loc1);
    gdbLastClocked = getTimer();
};
_global.gdbCreateDebugger = function (visibleToStart, arrayOfButtons) {
    var _loc10 = _root.createEmptyMovieClip("versionMC", _root.getNextHighestDepth());
    var _loc12 = new flash.display.BitmapData(10, 10, false, 13421772);
    _loc10.attachBitmap(_loc12, this.getNextHighestDepth());
    var theVersion = _loc10.createTextField("theVersion", 1, 0, 0, 30, 16);
    debugButtonStyle(theVersion, "0", 65535);
    _loc10.onRelease = function () {
        trace (this._alpha);
        if (Key.isDown(16)) {
            if (this._alpha == 0) {
                this.theVersion.text = _global.gVersion;
                this._alpha = 100;
                this.theVersion._visible = true;
            }
            else {
                this._alpha = 0;
                this.theVersion._visible = false;
            }
        }
    };
    _loc10._alpha = 0;
    _loc10.theVersion._visible = false;
    var _loc8 = 15;
    var _loc6 = 15;
    var _loc7 = 300;
    if (_root.debugger != undefined) {
        debugger.removeMovieClip();
    }
    var debugger = _root.createEmptyMovieClip("debugger", _root.getNextHighestDepth());
    var _loc11 = debugger.createEmptyMovieClip("debuggerBG", debugger.getNextHighestDepth());
    var label = _loc11.createTextField("label", 1, 0, 0, _loc7, 35);
    debugButtonStyle(label, _global.gVersion, 16777164);
    _loc11.onPress = function () {
        startDrag (this._parent, false);
    };
    _loc11.onRelease = function () {
        stopDrag ();
    };
    for (var _loc4 = 0; _loc4 < arrayOfButtons.length; ++_loc4) {
        theY = _loc8 + _loc6 * _loc4;
        _loc10 = debugger.createEmptyMovieClip(arrayOfButtons[_loc4], debugger.getNextHighestDepth());
        _loc10._y = theY;
        var label = _loc10.createTextField("label", 1, 0, 0, _loc7, _loc6);
        debugButtonStyle(label, arrayOfButtons[_loc4], 16776960);
        _loc10.onRelease = function () {
            trace (this.label);
        };
    }
    var _loc9 = debugger.createEmptyMovieClip("traceModule", debugger.getNextHighestDepth());
    _loc9._y = _loc8;
    _loc10 = _loc9.createEmptyMovieClip("traceMainButton", _loc9.getNextHighestDepth());
    _loc10._y = 0;
    var label = _loc10.createTextField("label", 1, 0, 0, _loc7, _loc6);
    debugButtonStyle(label, "Close this window", 16711680);
    _loc10.onRelease = function () {
        debuggerVisible(false);
    };
    _loc10 = _loc9.createEmptyMovieClip("traceOutput", _loc9.getNextHighestDepth());
    _loc10._y = _loc6;
    var label = _loc10.createTextField("label", 1, 0, 0, _loc7, 300);
    debugButtonStyle(label, "traceOutput", 16777215);
    _loc10.label.text = "";
    debuggerVisible(visibleToStart);
};
_global.gdbSetUp = function () {
    _global.keyListener = new Object();
    var passCodeArray = new Array(81, 81, 81);
    var passCodeInt = 0;
    keyListener.onkeyup = function () {
        if (passCodeArray[passCodeInt] == Key.getCode() && Key.isDown(16)) {
            ++passCodeInt;
            if (passCodeInt >= passCodeArray.length) {
                trace ("UNLOCKED");
                debuggerVisible(true);
                // Jump to 14167
            }
        }
        else {
            passCodeInt = 0;
        }
        trace (Key.getCode());
    };
    Key.addListener(keyListener);
};
_global.gdbAudit = function (listToCheck) {
    var errorsArray = new Array();
    for (var i in listToCheck) {
        var obj = eval(listToCheck[i]);
        if (obj == undefined) {
            errorsArray.push(listToCheck[i]);
        }
    }
    if (errorsArray.length > 0) {
        var errorText = "The following errors occurred:\r\r";
        errorText = errorText + ("These objects were expected but not found= " + errorsArray);
        gdbError(errorText);
    }
};
_global.gdbIsInArray = function (whatValue, whatArray) {
    for (var _loc3 in whatArray) {
        if (whatValue == whatArray[_loc3]) {
            do {
            } while (null != null)
            return (true);
        }
    }
    return (false);
};
_global.gdbRemoveFromArray = function (whatValue, whatArray) {
    for (var _loc3 in whatArray) {
        if (whatValue == whatArray[_loc3]) {
            whatArray.splice(_loc3, 1);
            do {
            } while (null != null)
            return (true);
        }
    }
    return (false);
};
_global.gdbSetBlock = function (whatMC) {
    whatMC.onRelease = function () {
    };
    whatMC.useHandCursor = false;
};
_global.gdbSet = function (whatMC, whatSetting) {
    whatMC.pToggle = whatSetting;
    whatMC.gotoAndStop(whatMC.pToggle);
};
_global.gdbToggle = function (whatMC, whatDefault) {
    if (whatMC.pToggle == undefined) {
        whatMC.pToggle = whatDefault;
    }
    if (whatMC.pToggle == "off") {
        whatMC.pToggle = "on";
    }
    else {
        whatMC.pToggle = "off";
    }
    whatMC.gotoAndStop(whatMC.pToggle);
};
_global.dbObject = function (whatObj) {
    db(" --- dbObject trace: ----");
    for (var _loc2 in whatObj) {
        db(whatObj[_loc2] + " = " + _loc2);
    }
    db(" ------------------------");
};
_global.gdbError = function (whatText) {
    if (_root.errorText == undefined) {
        var _loc2 = _root.createTextField("errorText", 1, 0, 0, 400, 300);
        _root.defaultFieldStyle(_loc2);
    }
    _loc2.text = whatText;
};
gdbSetUp();
gdbCreateDebugger(false, ["trace", "bTest2", "fTest3", "fTest4"]);
var version = "1.1";
var actionURL = "action.asp";
var arrayOfObjects = new Array();
var arrayOfPrimaryButtons = new Array();
var arrayOfSpecialButtons = new Array();
arrayOfObjects.push("_root.startScreen");
arrayOfPrimaryButtons.push("_root.startScreen.startButton");
arrayOfObjects.push("_root.plays");
arrayOfObjects.push("_root.points");
arrayOfObjects.push("_root.tokens");
arrayOfObjects.push("_root.winScreen");
arrayOfObjects.push("_root.winScreen.displaypoints");
arrayOfObjects.push("_root.winScreen.newpoints");
arrayOfObjects.push("_root.highlightMC");
arrayOfObjects.push("_root.highlightMC.plays1");
arrayOfObjects.push("_root.highlightMC.plays2");
arrayOfObjects.push("_root.alertMC");
arrayOfObjects.push("_root.alertMC.alertText");
arrayOfSpecialButtons.push("_root.alertMC.alertCloseButton");
arrayOfObjects.push("_root.helpMC");
arrayOfPrimaryButtons.push("_root.add1");
arrayOfPrimaryButtons.push("_root.add10");
arrayOfPrimaryButtons.push("_root.add100");
arrayOfPrimaryButtons.push("_root.add250");
arrayOfPrimaryButtons.push("_root.actionButton");
arrayOfPrimaryButtons.push("_root.exitButton");
arrayOfPrimaryButtons.push("_root.soundButton");
arrayOfPrimaryButtons.push("_root.helpButton");
arrayOfPrimaryButtons.push("_root.winScreen.tryAgain");
var fm;
var gGameStatus = "None";
var gCurrentRequest = "";
var gPossibilityArray = new Array(4, 3, 2);
var gSoundOn = false;
var gSoundOption = true;
var gTokenMax = 400;
var gRange = -1;
var gInfo = new Object();
var gPlayResult = new Object();
var gLog;
var gLastPlayTokensResultObject = new Object();
var gStartUpAspRequestStage = "begin";
var gLockedArray = new Array();
db(" oooo " + System.capabilities.playerType);
_global.gVersion = "3.25";
startGame();
designer_setUp();
_global.shiftLeft = function () {
    gBoard.disc._x = gBoard.disc._x - 20;
    gBoard.disc._y = gBoard.disc._y + 20;
    --currSlot;
    nextRoll();
};
_global.shiftRight = function () {
    gBoard.disc._x = gBoard.disc._x + 20;
    gBoard.disc._y = gBoard.disc._y + 20;
    ++currSlot;
    nextRoll();
};
_global.rollRight = function () {
    gBoard.disc.gotoAndPlay("rollRight");
};
_global.rollLeft = function () {
    gBoard.disc.gotoAndPlay("rollLeft");
};
_global.nextRoll = function () {
    if (currLevel >= totalLevels) {
        gBoard.disc.gotoAndStop(1);
        if (gBoard == _root.board && _root.stopOnFirstBoard == false) {
            _root.play();
        }
        else {
            setBonus();
        }
    }
    else {
        ++currLevel;
        var _loc2 = Math.abs(totalLevels - currLevel);
        var _loc3 = Math.abs(currSlot - goalSlot);
        if (_loc3 >= _loc2) {
            if (currSlot - goalSlot < 0) {
                rollRight();
            }
            else {
                rollLeft();
            }
        }
        else if (currSlot == 1) {
            rollRight();
        }
        else if (currSlot == totalSlots) {
            rollLeft();
        }
        else if (random(2) == 1) {
            rollLeft();
        }
        else {
            rollRight();
        }
    }
};
_global.setValues = function () {
    trace (" ............" + _global.gFinalGoalSlot);
    _root.goalSlot = _global.gFinalGoalSlot;
    if (gBoard == _root.board && _root.stopOnFirstBoard == false) {
        trace ("OVERRIDE- force to 8");
        goalSlot = 8;
    }
    currSlot = 8;
    currLevel = 0;
    totalSlots = 15;
    totalLevels = 14;
    discBaseX = 82.500000;
    board.disc._x = board.disc.myX;
    board.disc._y = board.disc.myY;
    boardBonus.disc._x = boardBonus.disc.myX;
    boardBonus.disc._y = boardBonus.disc.myY;
};
_global.chooseStart = function (whichChoice) {
    _global.storedChoice = whichChoice;
    _root.masterButtonRelease(_root.actionButton);
};
_global.chooseStart2 = function (whichChoice) {
    trace (" yyy " + _global.gPlayResult.displayid);
    trace (" yyy " + Number(_global.gPlayResult.displayid.substr(-2, 2)));
    var _loc3 = Number(_global.gPlayResult.displayid.substr(-2, 2));
    if (_loc3 > 7) {
        _root.stopOnFirstBoard = true;
    }
    else {
        _root.stopOnFirstBoard = false;
    }
    var _loc4 = [0, 8, 4, 12, 14, 2, 6, 10, 4, 12, 14, 2, 6, 10];
    _global.gFinalGoalSlot = _loc4[_loc3];
    _global.setValues();
    currSlot = whichChoice * 2 + 1;
    gBoard.disc._x = discBaseX + currSlot * 20;
    gBoard.chooser._visible = false;
    nextRoll();
};
_global.randomGo = function (whatMC) {
    if (random(2) == 1) {
        whatMC.gotoAndPlay("rightSide" + random(2));
    }
    else {
        whatMC.gotoAndPlay("leftSide" + random(2));
    }
};
_global.setBonus = function (whichSlot) {
    var _loc4 = [8, 50, 3, 0, 2, 20, 14];
    var _loc3 = [230, 900, 100, 5000, 75, 600, 400];
    whichSlot = goalSlot / 2 - 1;
    var _loc5 = [67, 117, 169, 222, 276, 328, 378];
    gBoard.bonus.gotoAndPlay(2);
    gBoard.bonus._x = _loc5[whichSlot];
    if (gBoard == _root.board) {
        gBoard.bonus.bonusText.text = String(_loc4[whichSlot]);
    }
    else {
        gBoard.bonus.bonusText.text = String(_loc3[whichSlot]);
    }
    stop ();
    _root.base.showCurrentResults();
    _root.endScene();
};
_global.gFinalGoalSlot = -1;
_global.gHavePlayed = false;

// [Action in Frame 2]
_global.goalSlot = 6;
_global.currSlot = 8;
_global.currLevel = 0;
_global.totalSlots = 15;
_global.totalLevels = 4;
_global.stopOnFirstBoard = false;
boardBonus.gotoAndStop("bonus");
_global.gBoard = _root.board;
setValues();
stop ();

// [Action in Frame 18]
_global.gBoard = _root.boardBonus;
setValues();
nextRoll();

// [Action in Frame 20]
stop ();


Weel I dont about so much but can easily say that ur work is just awesum..!!
Was This Post Helpful? 0
  • +
  • -

#3 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8399
  • View blog
  • Posts: 31,251
  • Joined: 12-June 08

Re: Can You Crack My .Swf Game?

Posted 25 September 2013 - 10:03 AM

Wouldn't this be a simpler job (since you wrote the game) to gut your logic and just brute text each position over a number of iterations?
Was This Post Helpful? 0
  • +
  • -

#4 GForGreat  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 25-September 13

Re: Can You Crack My .Swf Game?

Posted 25 September 2013 - 10:21 AM

Simpler in which sense? Would it be a better idea, as far as making a more secure game? Yes, I do agree with you, but as far as work on my end, I don't want to waste anymore time on this program. I honestly would rather send the gift card I have lying around then do the brute forcing myself. If you want to brute force my code and send me the results I would take those as a solution. Honestly I want to just move onto another game/program. I'm sure, as a fellow programer, you know exactly how I feel right now.
Was This Post Helpful? 0
  • +
  • -

#5 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8399
  • View blog
  • Posts: 31,251
  • Joined: 12-June 08

Re: Can You Crack My .Swf Game?

Posted 25 September 2013 - 10:29 AM

Simpler in the sense that you the entire project layout in your head so pulling out the 'drop method' (or what ever your routine is called) shouldn't be that hard versus having people try and sift through nine hundred lines of undocumented code taking wild stabs at what may or may not be important to just that bit versus the cruft of the rest of the app.

As an aside:

Quote

as far as making a more secure game?
...
I don't want to waste anymore time on this program

I am getting mixed messages.. is security important for this school project or not?

Quote

I want to just move onto another game/program.

What is stopping you?

Quote

I'm sure, as a fellow programer, you know exactly how I feel right now.

No.. I do not know what you are feeling, but right now I am a bit perplexed.
Was This Post Helpful? 0
  • +
  • -

#6 GForGreat  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 25-September 13

Re: Can You Crack My .Swf Game?

Posted 25 September 2013 - 10:45 AM

Sure, I could pull out my pseudo-randomization method but as far as reverse engineering, I don't doubt that I could find a new way if a spent a few more hours on it. The few hours is the problem for me though, I'm pretty busy and I'm trying to fins the 'good enough' point.

To answer your questions, Yes, security is important. If someone on this forum could reverse engineer the program then I assume my CIS instructor could probably do the same. Which would not be a good thing(if he could do it fairly quickly).
This program is stopping me, I have to finish this program before moving onto the next assignment/challenge.

I don't know, I suppose to put it simply, I am being lazy(or have too many other things going on in my life, take your pick), and don't want to sift through this particular code anymore. I am hoping someone is up to the challenge, that I am not, maybe the Starbucks gift-card will persuade someone on this forum.
Was This Post Helpful? 0
  • +
  • -

#7 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8399
  • View blog
  • Posts: 31,251
  • Joined: 12-June 08

Re: Can You Crack My .Swf Game?

Posted 25 September 2013 - 11:04 AM

I guess lazy is as good as any excuse for not finishing up the last of a project's requirements (a project blocking further new projects) in testing the distribution of the 'random' function. So it goes.

Side note - 'reverse engineering' would be more along the lines of disassembling and not just testing your math's distribution.

Good luck with it.
Was This Post Helpful? 0
  • +
  • -

#8 GForGreat  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 25-September 13

Re: Can You Crack My .Swf Game?

Posted 25 September 2013 - 11:23 AM

Yeah, I suppose so. I'll just upload the whole game. It wont work unless you have it on a web page with specific variable input, specifically for tokens and previous points.

Attached File(s)


Was This Post Helpful? 0
  • +
  • -

#9 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8399
  • View blog
  • Posts: 31,251
  • Joined: 12-June 08

Re: Can You Crack My .Swf Game?

Posted 25 September 2013 - 11:25 AM

You know.. you could comment out the section that need those and say hard code a few values and put it out. (Not like I haven't done industrial grade testing before anything ;)/> )
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1