Section 1
//App (classy.App)
package classy {
import flash.events.*;
import flash.display.*;
import com.kongregate.as3.client.*;
import flash.media.*;
import flash.ui.*;
import mochi.as3.*;
public dynamic class App extends MovieClip {
private var puzMenu:PuzzleMenu;
private var puzzle:PuzzleBoard;
private var intro:Intro;
private var myWorld:World;
private var music1:Sound;
private var music2:Sound;
private var noMenu:ContextMenu;
private var mainMenu:MainMenu;
private var kongregate:KongregateAPI;
public static var trans:SoundTransform;
public static var channel:SoundChannel;
public function App(){
noMenu = new ContextMenu();
super();
addFrameScript(0, frame1);
init();
stage.scaleMode = StageScaleMode.NO_BORDER;
noMenu.hideBuiltInItems();
this.contextMenu = noMenu;
stage.stageFocusRect = false;
}
private function checkDomain():Boolean{
var _local1:String;
var _local2:Number;
var _local3:Number;
var _local4:String;
var _local5:Number;
var _local6:Number;
_local1 = stage.loaderInfo.url;
_local2 = (_local1.indexOf("://") + 3);
_local3 = _local1.indexOf("/", _local2);
_local4 = _local1.substring(_local2, _local3);
_local5 = (_local4.lastIndexOf(".") - 1);
_local6 = (_local4.lastIndexOf(".", _local5) + 1);
_local4 = _local4.substring(_local6, _local4.length);
if (_local4 != "kongregate.com"){
return (false);
};
return (true);
}
private function newPuzzle(_arg1:Event):void{
puzzle = new PuzzleBoard();
puzzle.addEventListener("levelcomplete", puzzleComplete);
puzzle.addEventListener("puzDone", removePuzzle);
puzzle.addEventListener("restartMe", restartPuzzle);
myWorld.addChild(puzzle);
}
private function init():void{
var _local1:Boolean;
_local1 = checkDomain();
introFunc();
}
private function startMusic():void{
var _local1:Number;
music1 = new Music();
_local1 = 0;
trans = new SoundTransform(0.001, 0);
channel = music1.play(0, 99, trans);
channel.soundTransform = trans;
stage.addEventListener(Event.ENTER_FRAME, soundFadeIn);
}
private function startIntroMusic():void{
var _local1:Number;
music2 = new IntroMusic();
_local1 = 0;
trans = new SoundTransform(0.7, 0);
channel = music2.play(0, 99, trans);
channel.soundTransform = trans;
}
private function restartPuzzle(_arg1:Event):void{
if (MainMenu.currentLevel < 21){
removePuzzle(_arg1);
newPuzzle(_arg1);
} else {
removePuzzle(_arg1);
puzzle = null;
mainMenu.revealMe(2);
};
stage.focus = puzMenu;
}
private function changeQuality(_arg1:Event):void{
switch (stage.quality){
case "HIGH":
stage.quality = StageQuality.LOW;
break;
case "MEDIUM":
stage.quality = StageQuality.HIGH;
break;
case "LOW":
stage.quality = StageQuality.MEDIUM;
break;
};
if (mainMenu.currentFrame == 3){
mainMenu.adjustQualCover();
};
}
private function introFunc():void{
stage.frameRate = 12;
intro = new Intro();
intro.x = 350;
intro.y = 250;
intro.addEventListener("readyPlay", readyPlay);
intro.addEventListener("muteTheIntro", muteIntro);
addChild(intro);
startIntroMusic();
kongregate = new KongregateAPI();
addChild(kongregate);
}
private function undoPiece(_arg1:Event):void{
if (puzzle != null){
puzzle.undoPlacement();
};
}
function frame1(){
MochiBot.track(this, "02c742ec");
}
private function submitKong(_arg1:Event):void{
kongregate.stats.submit("HighestLevel", MainMenu.checkList);
}
private function muteSound(_arg1:Event):void{
if (trans.volume > 0){
removeFader();
trans.volume = 0;
channel.soundTransform = trans;
if (mainMenu.currentFrame == 3){
mainMenu.volumeKnob.x = 265;
};
} else {
fullSound(_arg1);
};
}
private function readyPlay(_arg1:Event):void{
intro.removeEventListener("readyPlay", readyPlay);
intro.removeEventListener("muteTheIntro", muteIntro);
removeChild(intro);
channel.stop();
stage.frameRate = 40;
newWorld();
startMusic();
}
private function puzzleComplete(_arg1:Event):void{
MainMenu.checkList = MainMenu.currentLevel;
submitKong(_arg1);
}
private function removeFader():void{
stage.removeEventListener(Event.ENTER_FRAME, soundFadeIn);
}
private function switchSong(_arg1:Event):void{
channel.stop();
switch (MainMenu.currentSong){
case 1:
channel = music2.play(0, 99, trans);
MainMenu.currentSong = 2;
break;
case 2:
channel = music1.play(0, 99, trans);
MainMenu.currentSong = 1;
break;
};
}
private function soundFadeIn(_arg1:Event):void{
if (trans.volume < 1){
trans.volume = (trans.volume + 0.001);
channel.soundTransform = trans;
} else {
removeFader();
};
}
private function newWorld():void{
myWorld = new World();
this.addChild(myWorld);
puzMenu = new PuzzleMenu();
puzMenu.addEventListener("showMenu", showMainMenu);
puzMenu.addEventListener("mMute", muteSound);
puzMenu.addEventListener("changeQuality", changeQuality);
puzMenu.addEventListener("restartThePuzzle", restartPuzzle);
puzMenu.addEventListener("undoPiece", undoPiece);
puzMenu.x = 600;
myWorld.addChild(puzMenu);
mainMenu = new MainMenu();
mainMenu.addEventListener("muteIt", muteSound);
mainMenu.addEventListener("fullIt", fullSound);
mainMenu.addEventListener("adjustIt", adjustSound);
mainMenu.addEventListener("newPuzzle", newPuzzle);
mainMenu.addEventListener("switchIt", switchSong);
mainMenu.addEventListener("submitScore", submitKong);
myWorld.addChild(mainMenu);
stage.focus = puzMenu;
}
private function muteIntro(_arg1:Event):void{
if (trans.volume > 0){
trans.volume = 0;
} else {
trans.volume = 0.7;
};
channel.soundTransform = trans;
}
private function showMainMenu(_arg1:Event):void{
var _local2:*;
if (puzzle != null){
removePuzzle(_arg1);
puzzle = null;
};
_local2 = PuzzleMenu.mainMenuOption;
mainMenu.revealMe(_local2);
}
private function removePuzzle(_arg1:Event):void{
PuzzleBoard.rory.walking = false;
while (puzzle.numChildren) {
puzzle.removeChildAt(0);
};
myWorld.removeChild(puzzle);
}
private function fullSound(_arg1:Event):void{
if (mainMenu.currentFrame == 3){
mainMenu.volumeKnob.x = 365;
};
removeFader();
trans.volume = 1;
channel.soundTransform = trans;
}
private function adjustSound(_arg1:Event):void{
removeFader();
trans.volume = MainMenu.thisVolume;
channel.soundTransform = trans;
}
private function testRory():void{
var _local1:*;
_local1 = new PBrory();
_local1.walking = true;
_local1.x = 25;
_local1.y = 25;
_local1.headed = "right";
_local1.scaleX = -1;
this.addChild(_local1);
}
}
}//package classy
Section 2
//MainMenu (classy.MainMenu)
package classy {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.filters.*;
import flash.geom.*;
public class MainMenu extends MovieClip {
public var music2Credit:MovieClip;
public var instructionsMC:MovieClip;
public var fakeRory:PBrory;
public var leftArrow:MovieClip;
public var completed:Array;
public var maxBtn:MovieClip;
public var so:SharedObject;
public var bfilter:BevelFilter;
public var roryTrack:MovieClip;
public var i;
private var firstVisit:Boolean;
public var gfilter:GlowFilter;
public var checkMC:MovieClip;
public var roryTrack2:MovieClip;
public var volumeKnob:MovieClip;
public var music1Credit:MovieClip;
public var seeCredits:MovieClip;
public var testRory:PBrory;
public var mutedBtn:MovieClip;
public var highQuality:MovieClip;
public var lowQuality:MovieClip;
public var returnBtn:MovieClip;
public var dragRect:Rectangle;
public var rightArrow:MovieClip;
public var SongMC:MovieClip;
public var congrats:MovieClip;
public var seeInstructions:MovieClip;
public var medQuality:MovieClip;
public var coverMC:MovieClip;
public var qualCover:MovieClip;
public var filterArray:Array;
public var testRory2:PBrory;
public static var thisVolume:Number;
public static var currentLevel:int = 0;
public static var checkList:int = 0;
public static var currentSong;
public function MainMenu():void{
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5);
addEventListener(Event.ADDED_TO_STAGE, init);
}
public function moveInstructions(_arg1:MouseEvent):void{
switch (_arg1.target.name){
case "leftArrow":
instructionsMC.gotoAndStop((instructionsMC.currentFrame - 1));
break;
case "rightArrow":
instructionsMC.gotoAndStop((instructionsMC.currentFrame + 1));
break;
};
}
private function removeGlow():void{
filterArray = new Array();
filterArray.push(bfilter);
getChildAt((currentLevel + 4)).filters = filterArray;
}
public function viewCredits(_arg1:MouseEvent):void{
gotoAndStop(5);
}
public function revealMe(_arg1):void{
gotoAndStop(1);
gotoAndStop(_arg1);
this.visible = true;
}
private function changeKnob(_arg1:Event):void{
volumeKnob.x = (265 + (App.trans.volume * 100));
}
function frame3(){
SongMC.buttonMode = true;
SongMC.addEventListener(MouseEvent.CLICK, switchSong);
SongMC.gotoAndStop(currentSong);
mutedBtn.gotoAndStop(2);
medQuality.gotoAndStop(2);
highQuality.gotoAndStop(3);
qualCover.gotoAndStop(4);
returnBtn.gotoAndStop(6);
if (MainMenu.currentLevel == 0){
returnBtn.visible = false;
};
switch (stage.quality){
case "MEDIUM":
qualCover.x = 315.1;
break;
case "LOW":
qualCover.x = 265.1;
break;
};
mutedBtn.buttonMode = true;
maxBtn.buttonMode = true;
returnBtn.buttonMode = true;
dragRect = new Rectangle(265, 135, 100, 0);
mutedBtn.addEventListener(MouseEvent.CLICK, muteSound);
maxBtn.addEventListener(MouseEvent.CLICK, fullSound);
returnBtn.addEventListener(MouseEvent.CLICK, newLevel);
if (firstVisit == true){
volumeKnob.addEventListener(Event.ENTER_FRAME, changeKnob);
firstVisit = false;
} else {
volumeKnob.removeEventListener(Event.ENTER_FRAME, changeKnob);
};
volumeKnob.x = (265 + (App.trans.volume * 100));
volumeKnob.addEventListener(MouseEvent.MOUSE_DOWN, dragIt);
lowQuality.buttonMode = true;
medQuality.buttonMode = true;
highQuality.buttonMode = true;
lowQuality.addEventListener(MouseEvent.CLICK, changeQuality);
medQuality.addEventListener(MouseEvent.CLICK, changeQuality);
highQuality.addEventListener(MouseEvent.CLICK, changeQuality);
}
function frame5(){
music1Credit.buttonMode = true;
music1Credit.addEventListener(MouseEvent.CLICK, visitMusic1Credit);
music2Credit.buttonMode = true;
music2Credit.addEventListener(MouseEvent.CLICK, visitMusic2Credit);
}
function frame1(){
stop();
fakeRory.gotoAndPlay(24);
seeInstructions.buttonMode = true;
seeInstructions.addEventListener(MouseEvent.CLICK, viewInstructions);
seeCredits.buttonMode = true;
seeCredits.addEventListener(MouseEvent.CLICK, viewCredits);
testRory = new PBrory();
testRory.x = ((Math.floor((Math.random() * 10)) * 50) + 75);
testRory.y = 0;
testRory.walking = true;
testRory.headed = "left";
roryTrack.addChild(testRory);
testRory2 = new PBrory();
testRory2.x = ((Math.floor((Math.random() * 10)) * 50) + 75);
testRory2.y = 0;
testRory2.walking = true;
testRory2.headed = "right";
testRory2.scaleX = -1;
roryTrack2.addChild(testRory2);
currentLevel = 0;
}
function frame4(){
leftArrow.buttonMode = true;
rightArrow.buttonMode = true;
leftArrow.addEventListener(MouseEvent.CLICK, moveInstructions);
rightArrow.addEventListener(MouseEvent.CLICK, moveInstructions);
}
function frame2(){
gfilter = new GlowFilter();
bfilter = new BevelFilter(2);
filterArray = new Array();
completed = new Array(20);
checkMC.mouseEnabled = false;
getCompleted();
i = 5;
while (i < 25) {
MovieClip(getChildAt(i)).buttonMode = true;
MovieClip(getChildAt(i)).addEventListener(MouseEvent.CLICK, pickLevel);
MovieClip(getChildAt(i)).levelNum = (i - 4);
i++;
};
currentLevel = 0;
}
private function muteSound(_arg1:MouseEvent):void{
dispatchEvent(new Event("muteIt"));
volumeKnob.x = 265;
}
public function muteSound2():void{
dispatchEvent(new Event("muteIt"));
volumeKnob.x = 265;
}
private function noDrag(_arg1:MouseEvent):void{
volumeKnob.addEventListener(MouseEvent.MOUSE_DOWN, dragIt);
volumeKnob.removeEventListener(Event.ENTER_FRAME, adjustVolume);
stage.removeEventListener(MouseEvent.MOUSE_UP, noDrag);
volumeKnob.stopDrag();
}
private function switchSong(_arg1:Event):void{
currentSong = SongMC.currentFrame;
dispatchEvent(new Event("switchIt"));
SongMC.gotoAndStop(currentSong);
}
public function adjustQualCover():void{
switch (stage.quality){
case "HIGH":
qualCover.x = 365.1;
break;
case "MEDIUM":
qualCover.x = 315.1;
break;
case "LOW":
qualCover.x = 265.1;
break;
};
}
public function viewInstructions(_arg1:MouseEvent):void{
gotoAndStop(4);
}
public function visitMusic2Credit(_arg1:MouseEvent):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://wilidacious.newgrounds.com/");
navigateToURL(_local2, "_blank");
}
private function init(_arg1:Event):void{
firstVisit = true;
removeEventListener(Event.ADDED_TO_STAGE, init);
}
public function changeQuality(_arg1:MouseEvent):void{
switch (_arg1.target.name){
case "lowQuality":
stage.quality = StageQuality.LOW;
qualCover.x = 265.1;
break;
case "medQuality":
stage.quality = StageQuality.MEDIUM;
qualCover.x = 315.1;
break;
case "highQuality":
stage.quality = StageQuality.HIGH;
qualCover.x = 365.1;
break;
};
}
public function createCheckMarks():void{
var _local1:*;
var _local2:*;
checkList = 0;
_local1 = 0;
while (_local1 < completed.length) {
if (completed[_local1] == true){
checkList = (checkList + 1);
_local2 = new Checkmark();
_local2.mouseEnabled = false;
_local2.y = (Math.floor((_local1 / 5)) * 105);
_local2.x = ((_local1 % 5) * 110);
checkMC.addChild(_local2);
};
_local1++;
};
if (checkList == 20){
congrats.gotoAndStop(2);
};
if (checkList > 0){
dispatchEvent(new Event("submitScore"));
};
}
private function dragIt(_arg1:MouseEvent):void{
volumeKnob.removeEventListener(Event.ENTER_FRAME, changeKnob);
volumeKnob.removeEventListener(MouseEvent.MOUSE_DOWN, dragIt);
volumeKnob.addEventListener(Event.ENTER_FRAME, adjustVolume);
stage.addEventListener(MouseEvent.MOUSE_UP, noDrag);
volumeKnob.startDrag(false, dragRect);
}
private function adjustVolume(_arg1:Event):void{
thisVolume = ((volumeKnob.x - 265) / 100);
dispatchEvent(new Event("adjustIt"));
}
public function getCompleted(){
so = SharedObject.getLocal("PillbugData");
if (so.data.levelscomplete != null){
completed = so.data.levelscomplete;
createCheckMarks();
while (completed.length < 20) {
completed.push(null);
};
};
createCovers();
}
public function visitMusic1Credit(_arg1:MouseEvent):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://ailad.newgrounds.com/");
navigateToURL(_local2, "_blank");
}
private function fullSound(_arg1:MouseEvent):void{
dispatchEvent(new Event("fullIt"));
}
public function createCovers():void{
var _local1:*;
var _local2:LevelCover;
_local1 = 0;
while (_local1 < (completed.length - 1)) {
if (completed[_local1] != true){
_local2 = new LevelCover();
_local2.y = (Math.floor(((_local1 + 1) / 5)) * 105);
_local2.x = (((_local1 + 1) % 5) * 110);
coverMC.addChild(_local2);
};
_local1++;
};
}
private function newLevel(_arg1:MouseEvent):void{
if (currentLevel > 0){
this.visible = false;
dispatchEvent(new Event("newPuzzle"));
};
}
private function pickLevel(_arg1:MouseEvent):void{
currentLevel = _arg1.target.parent.levelNum;
this.visible = false;
dispatchEvent(new Event("newPuzzle"));
}
}
}//package classy
Section 3
//MochiBot (classy.MochiBot)
package classy {
import flash.display.*;
import flash.system.*;
import flash.net.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
var _local3:MochiBot;
var _local4:String;
var _local5:URLVariables;
var _local6:String;
var _local7:URLRequest;
var _local8:Loader;
if (Security.sandboxType == "localWithFile"){
return (null);
};
_local3 = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
_local4 = "http://core.mochibot.com/my/core.swf";
_local5 = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
_local6 = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
_local7 = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
_local8 = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package classy
Section 4
//PBrory (classy.PBrory)
package classy {
import flash.events.*;
import flash.display.*;
public class PBrory extends MovieClip {
public var trueRory:Boolean;// = false
public var lastDir;
public var firstSteps;// = false
public var headed;
public var walking:Boolean;
public var movement:int;// = 0
public var forward;
public function PBrory():void{
movement = 0;
trueRory = false;
firstSteps = false;
super();
addFrameScript(0, frame1, 1, frame2, 8, frame9, 17, frame18, 18, frame19, 27, frame28, 53, frame54, 68, frame69, 91, frame92, 109, frame110, 127, frame128, 151, frame152, 155, frame156, 164, frame165, 173, frame174, 179, frame180, 204, frame205);
addEventListener(Event.ADDED_TO_STAGE, init);
}
function frame152(){
gotoAndStop("normal");
this.headed = lastDir;
this.y = (this.y + 2);
}
private function init(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, init);
if (trueRory == false){
addEventListener(Event.ENTER_FRAME, frameHandlerFake);
} else {
addEventListener(Event.ENTER_FRAME, frameHandlerReal);
};
}
private function frameHandlerFake(_arg1:Event):void{
if (this.walking == true){
switch (this.headed){
case "left":
this.x = (this.x - 2);
movement = (movement + 1);
break;
case "right":
this.x = (this.x + 2);
movement = (movement + 1);
break;
};
if (movement == 25){
movement = 0;
switch (this.headed){
case "left":
if (this.x == 25){
gotoAndPlay("bumping");
this.headed = "right";
};
break;
case "right":
if (this.x == 575){
gotoAndPlay("bumping");
this.headed = "left";
};
break;
};
};
};
}
function frame165(){
gotoAndStop(54);
obstacles();
}
function frame205(){
this.headed = lastDir;
gotoAndStop(54);
obstacles();
}
function frame156(){
gotoAndPlay(59);
}
function frame174(){
stop();
this.walking = true;
obstacles();
}
private function frameHandlerReal(_arg1:Event):void{
if (firstSteps == true){
firstSteps = false;
obstacles();
} else {
if (this.walking == true){
movement = (movement + 1);
switch (this.headed){
case "left":
this.x = (this.x - 2);
break;
case "right":
this.x = (this.x + 2);
break;
case "switchleft":
this.x = (this.x - 2);
break;
case "switchright":
this.x = (this.x + 2);
break;
case "down":
this.y = (this.y + 2);
break;
case "upright":
this.x = (this.x + 2);
this.y = (this.y - 2);
break;
case "upleft":
this.x = (this.x - 2);
this.y = (this.y - 2);
break;
case "downleft":
this.x = (this.x - 2);
this.y = (this.y + 2);
break;
case "downright":
this.x = (this.x + 2);
this.y = (this.y + 2);
break;
};
if (movement == 25){
obstacles();
};
};
};
}
function frame18(){
this.walking = true;
if (this.trueRory == true){
obstacles();
};
}
function frame1(){
stop();
}
function frame19(){
gotoAndStop(1);
}
function frame9(){
if (this.headed == "right"){
this.scaleX = -1;
} else {
this.scaleX = 1;
};
}
function frame110(){
this.walking = true;
obstacles();
stop();
}
function frame2(){
this.walking = false;
}
function frame28(){
gotoAndPlay(24);
}
function frame92(){
gotoAndStop("normal");
}
function frame180(){
switch (PuzzleBoard.puzArray[((this.x - 25) / 50)][((this.y + 25) / 50)].pieceType){
case 2:
if (lastDir == "left"){
gotoAndPlay("fallonup");
this.headed = "upleft";
} else {
gotoAndPlay("fallondown");
this.headed = "downright";
};
break;
case 3:
if (lastDir == "right"){
gotoAndPlay("fallonup");
this.headed = "upright";
} else {
gotoAndPlay("fallondown");
this.headed = "downleft";
};
break;
};
}
function frame128(){
this.walking = true;
obstacles();
stop();
}
function frame54(){
stop();
}
private function obstacles():void{
movement = 0;
switch (this.headed){
case "downleft":
if (this.x == 25){
this.scaleX = -1;
this.walking = false;
gotoAndPlay("backup");
this.headed = "upright";
} else {
if (PuzzleBoard.puzArray[((this.x - 75) / 50)][((this.y + 25) / 50)].pieceType != 0){
switch (PuzzleBoard.puzArray[((this.x - 75) / 50)][((this.y + 25) / 50)].pieceType){
case 1:
case 3:
case 4:
this.scaleX = -1;
this.walking = false;
gotoAndPlay("backup");
this.headed = "upright";
break;
case 2:
this.scaleX = 1;
gotoAndPlay("switchunder");
this.headed = "switchleft";
lastDir = "upleft";
break;
case 5:
if (this.y == 425){
gotoAndPlay("unfurl");
this.scaleX = 1;
this.lastDir = "left";
PuzzleBoard.puzArray[((this.x - 75) / 50)][((this.y + 25) / 50)].gotoAndPlay(2);
} else {
if (PuzzleBoard.puzArray[((this.x - 75) / 50)][((this.y + 75) / 50)].pieceType != 0){
switch (PuzzleBoard.puzArray[((this.x - 75) / 50)][((this.y + 75) / 50)].pieceType){
case 1:
case 2:
case 4:
case 5:
gotoAndPlay("unfurl");
this.scaleX = 1;
this.lastDir = "left";
PuzzleBoard.puzArray[((this.x - 75) / 50)][((this.y + 25) / 50)].gotoAndPlay(2);
break;
case 3:
break;
};
} else {
gotoAndPlay("unfurl");
this.scaleX = 1;
this.lastDir = "left";
PuzzleBoard.puzArray[((this.x - 75) / 50)][((this.y + 25) / 50)].gotoAndPlay(2);
};
};
break;
};
} else {
if (this.y == 425){
gotoAndPlay("unfurl");
this.scaleX = 1;
this.lastDir = "left";
} else {
if (PuzzleBoard.puzArray[((this.x - 75) / 50)][((this.y + 75) / 50)].pieceType != 0){
switch (PuzzleBoard.puzArray[((this.x - 75) / 50)][((this.y + 75) / 50)].pieceType){
case 1:
case 2:
case 4:
case 5:
gotoAndPlay("unfurl");
this.scaleX = 1;
this.lastDir = "left";
break;
case 3:
break;
};
} else {
gotoAndPlay("unfurl");
this.scaleX = 1;
this.lastDir = "left";
};
};
};
};
break;
case "downright":
if (this.x == 575){
this.scaleX = 1;
gotoAndPlay("backup");
this.walking = false;
this.headed = "upleft";
} else {
if (PuzzleBoard.puzArray[((this.x + 25) / 50)][((this.y + 25) / 50)].pieceType != 0){
switch (PuzzleBoard.puzArray[((this.x + 25) / 50)][((this.y + 25) / 50)].pieceType){
case 1:
case 2:
case 4:
this.scaleX = 1;
gotoAndPlay("backup");
this.walking = false;
this.headed = "upleft";
break;
case 3:
this.scaleX = -1;
gotoAndPlay("switchunder");
this.headed = "switchright";
lastDir = "upright";
break;
case 5:
if (this.y == 425){
this.scaleX = -1;
gotoAndPlay("unfurl");
this.lastDir = "right";
PuzzleBoard.puzArray[((this.x + 25) / 50)][((this.y + 25) / 50)].gotoAndPlay(2);
} else {
if (PuzzleBoard.puzArray[((this.x + 25) / 50)][((this.y + 75) / 50)].pieceType != 0){
switch (PuzzleBoard.puzArray[((this.x + 25) / 50)][((this.y + 75) / 50)].pieceType){
case 1:
case 3:
case 4:
case 5:
gotoAndPlay("unfurl");
this.scaleX = -1;
this.lastDir = "right";
PuzzleBoard.puzArray[((this.x + 25) / 50)][((this.y + 25) / 50)].gotoAndPlay(2);
break;
case 2:
break;
};
} else {
gotoAndPlay("unfurl");
this.scaleX = -1;
this.lastDir = "right";
PuzzleBoard.puzArray[((this.x + 25) / 50)][((this.y + 25) / 50)].gotoAndPlay(2);
};
};
break;
};
} else {
if (this.y == 425){
gotoAndPlay("unfurl");
this.scaleX = -1;
this.lastDir = "right";
} else {
if (PuzzleBoard.puzArray[((this.x + 25) / 50)][((this.y + 75) / 50)].pieceType != 0){
switch (PuzzleBoard.puzArray[((this.x + 25) / 50)][((this.y + 75) / 50)].pieceType){
case 1:
case 3:
case 4:
case 5:
gotoAndPlay("unfurl");
this.scaleX = -1;
this.lastDir = "right";
break;
case 2:
break;
};
} else {
gotoAndPlay("unfurl");
this.scaleX = -1;
this.lastDir = "right";
};
};
};
};
break;
case "upright":
if (PuzzleBoard.puzArray[((this.x - 25) / 50)][((this.y - 25) / 50)].pieceType == 0){
if (this.x == 575){
gotoAndPlay("backaround");
this.headed = "downleft";
this.walking = false;
} else {
if (PuzzleBoard.puzArray[((this.x + 25) / 50)][((this.y - 25) / 50)].pieceType != 0){
this.walking = true;
switch (PuzzleBoard.puzArray[((this.x + 25) / 50)][((this.y - 25) / 50)].pieceType){
case 1:
case 2:
case 4:
gotoAndPlay("backaround");
this.headed = "downleft";
this.walking = false;
break;
case 5:
this.headed = "right";
this.walking = true;
gotoAndPlay("overHump");
PuzzleBoard.puzArray[((this.x + 25) / 50)][((this.y - 25) / 50)].gotoAndPlay(2);
break;
};
} else {
this.headed = "right";
this.walking = true;
gotoAndPlay("overHump");
};
};
} else {
switch (PuzzleBoard.puzArray[((this.x - 25) / 50)][((this.y - 25) / 50)].pieceType){
case 1:
case 2:
case 3:
case 4:
gotoAndPlay("backaround");
this.headed = "downleft";
this.walking = false;
break;
case 5:
if (this.x == 575){
gotoAndPlay("backaround");
this.headed = "downleft";
this.walking = false;
} else {
if (PuzzleBoard.puzArray[((this.x + 25) / 50)][((this.y - 25) / 50)].pieceType != 0){
switch (PuzzleBoard.puzArray[((this.x + 25) / 50)][((this.y - 25) / 50)].pieceType){
case 1:
case 2:
case 4:
gotoAndPlay("backaround");
this.headed = "downleft";
this.walking = false;
break;
case 3:
this.walking = true;
break;
case 5:
this.headed = "right";
this.walking = true;
gotoAndPlay("overHump");
PuzzleBoard.puzArray[((this.x + 25) / 50)][((this.y - 25) / 50)].gotoAndPlay(2);
break;
};
} else {
this.headed = "right";
this.walking = true;
gotoAndPlay("overHump");
};
};
break;
};
};
break;
case "upleft":
if (PuzzleBoard.puzArray[((this.x - 25) / 50)][((this.y - 25) / 50)].pieceType == 0){
if (this.x == 25){
gotoAndPlay("backaround");
this.headed = "downright";
this.walking = false;
} else {
if (PuzzleBoard.puzArray[((this.x - 75) / 50)][((this.y - 25) / 50)].pieceType != 0){
this.walking = true;
switch (PuzzleBoard.puzArray[((this.x - 75) / 50)][((this.y - 25) / 50)].pieceType){
case 1:
case 3:
case 4:
gotoAndPlay("backaround");
this.headed = "downright";
this.walking = false;
break;
case 5:
this.headed = "left";
gotoAndPlay("overHump");
PuzzleBoard.puzArray[((this.x - 75) / 50)][((this.y - 25) / 50)].gotoAndPlay(2);
break;
};
} else {
this.headed = "left";
this.walking = true;
gotoAndPlay("overHump");
};
};
} else {
switch (PuzzleBoard.puzArray[((this.x - 25) / 50)][((this.y - 25) / 50)].pieceType){
case 1:
case 2:
case 3:
case 4:
gotoAndPlay("backaround");
this.headed = "downright";
this.walking = false;
break;
case 5:
if (this.x == 25){
gotoAndPlay("backaround");
this.headed = "downright";
this.walking = false;
} else {
if (PuzzleBoard.puzArray[((this.x - 75) / 50)][((this.y - 25) / 50)].pieceType != 0){
switch (PuzzleBoard.puzArray[((this.x - 75) / 50)][((this.y - 25) / 50)].pieceType){
case 1:
case 3:
case 4:
gotoAndPlay("backaround");
this.headed = "downright";
this.walking = false;
break;
case 2:
this.walking = true;
break;
case 5:
this.headed = "left";
this.walking = true;
gotoAndPlay("overHump");
PuzzleBoard.puzArray[((this.x - 75) / 50)][((this.y - 25) / 50)].gotoAndPlay(2);
break;
};
} else {
this.headed = "left";
this.walking = true;
gotoAndPlay("overHump");
};
};
break;
};
};
break;
case "left":
if (this.y == 475){
if (this.x == 25){
gotoAndPlay("bumping");
this.headed = "right";
} else {
if (PuzzleBoard.puzArray[((this.x - 75) / 50)][((this.y - 25) / 50)].pieceType != 0){
switch (PuzzleBoard.puzArray[((this.x - 75) / 50)][((this.y - 25) / 50)].pieceType){
case 1:
case 3:
case 4:
this.walking = false;
gotoAndPlay("bumping");
this.headed = "right";
break;
case 2:
gotoAndPlay("climbing");
this.headed = "upleft";
break;
case 5:
PuzzleBoard.puzArray[((this.x - 75) / 50)][((this.y - 25) / 50)].gotoAndPlay(2);
break;
};
};
};
} else {
if (PuzzleBoard.puzArray[((this.x - 25) / 50)][((this.y + 25) / 50)].pieceType != 0){
switch (PuzzleBoard.puzArray[((this.x - 25) / 50)][((this.y + 25) / 50)].pieceType){
case 5:
case 1:
if (this.x == 25){
gotoAndPlay("bumping");
this.headed = "right";
} else {
if (PuzzleBoard.puzArray[((this.x - 75) / 50)][((this.y - 25) / 50)].pieceType != 0){
switch (PuzzleBoard.puzArray[((this.x - 75) / 50)][((this.y - 25) / 50)].pieceType){
case 1:
case 3:
case 4:
this.walking = false;
gotoAndPlay("bumping");
this.headed = "right";
break;
case 2:
gotoAndPlay("climbing");
this.headed = "upleft";
break;
case 5:
PuzzleBoard.puzArray[((this.x - 75) / 50)][((this.y - 25) / 50)].gotoAndPlay(2);
};
};
};
break;
case 2:
this.walking = false;
gotoAndPlay("fallonup");
this.headed = "upleft";
break;
case 3:
this.walking = false;
gotoAndPlay("fallondown");
this.headed = "downleft";
break;
case 4:
this.walking = false;
gotoAndPlay("walkspikes");
break;
case 7:
this.headed = "down";
break;
};
} else {
lastDir = "left";
this.headed = "down";
this.gotoAndPlay("scared");
};
};
break;
case "right":
if (this.y == 475){
if (this.x == 575){
gotoAndPlay("bumping");
this.headed = "left";
} else {
if (PuzzleBoard.puzArray[((this.x + 25) / 50)][((this.y - 25) / 50)].pieceType != 0){
switch (PuzzleBoard.puzArray[((this.x + 25) / 50)][((this.y - 25) / 50)].pieceType){
case 1:
case 2:
case 4:
this.walking = false;
gotoAndPlay("bumping");
this.headed = "left";
break;
case 3:
gotoAndPlay("climbing");
this.headed = "upright";
break;
case 5:
PuzzleBoard.puzArray[((this.x + 25) / 50)][((this.y - 25) / 50)].gotoAndPlay(2);
break;
};
};
};
} else {
if (PuzzleBoard.puzArray[((this.x - 25) / 50)][((this.y + 25) / 50)].pieceType != 0){
switch (PuzzleBoard.puzArray[((this.x - 25) / 50)][((this.y + 25) / 50)].pieceType){
case 1:
case 5:
if (this.x == 575){
gotoAndPlay("bumping");
this.headed = "left";
} else {
if (PuzzleBoard.puzArray[((this.x + 25) / 50)][((this.y - 25) / 50)].pieceType != 0){
switch (PuzzleBoard.puzArray[((this.x + 25) / 50)][((this.y - 25) / 50)].pieceType){
case 1:
case 2:
case 4:
this.walking = false;
gotoAndPlay("bumping");
this.headed = "left";
break;
case 3:
gotoAndPlay("climbing");
this.headed = "upright";
break;
case 5:
PuzzleBoard.puzArray[((this.x + 25) / 50)][((this.y - 25) / 50)].gotoAndPlay(2);
break;
};
};
};
break;
case 3:
this.walking = false;
gotoAndPlay("fallonup");
this.headed = "upright";
break;
case 2:
this.walking = false;
gotoAndPlay("fallondown");
this.headed = "downright";
break;
case 4:
this.walking = false;
gotoAndPlay("walkspikes");
break;
case 7:
this.headed = "down";
break;
};
} else {
lastDir = "right";
this.headed = "down";
this.gotoAndPlay("scared");
};
};
break;
case "down":
if (this.y == 475){
this.walking = false;
gotoAndPlay(14);
this.headed = lastDir;
} else {
if (PuzzleBoard.puzArray[((this.x - 25) / 50)][((this.y + 25) / 50)].pieceType != 0){
switch (PuzzleBoard.puzArray[((this.x - 25) / 50)][((this.y + 25) / 50)].pieceType){
case 1:
case 5:
this.walking = false;
gotoAndPlay(14);
this.headed = lastDir;
break;
case 2:
this.walking = false;
gotoAndPlay("outoffall");
break;
case 3:
this.walking = false;
gotoAndPlay("outoffall");
break;
case 4:
this.walking = false;
gotoAndPlay("fallspikes");
break;
};
};
};
};
}
function frame69(){
stop();
dispatchEvent(new Event("death"));
}
}
}//package classy
Section 5
//PuzzleArrays (classy.PuzzleArrays)
package classy {
public class PuzzleArrays {
public static var PuzArray10:Array = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1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0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 4, 4, 1, 0, 0, 0, 1, 2, 0, 3, 1, 1, 1, 1, 1, 9, 0, 0, 1, 1, 1, 1, 1);
}
}//package classy
Section 6
//PuzzleBoard (classy.PuzzleBoard)
package classy {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class PuzzleBoard extends MovieClip {
private var curArray:Array;
private var currentPuzzle:int;
private var pieceY:int;
private var pieceX:int;
private var newPiece;
private var lastPieces:Array;
private var polly:PBpolly;
public var restartBtn:MovieClip;
private var creation:Boolean;
public var gameOverScreen:MovieClip;
public static var puzArray:Array;
public static var rory:PBrory;
public function PuzzleBoard():void{
lastPieces = new Array();
super();
addFrameScript(0, frame1);
addEventListener(Event.ADDED_TO_STAGE, init);
}
private function createNewPolly(_arg1):void{
polly = new PBpolly();
polly.pieceType = 7;
pieceY = Math.floor((_arg1 / 12));
pieceX = (_arg1 % 12);
polly.x = ((pieceX * 50) + 25);
polly.y = ((pieceY * 50) + 25);
puzArray[pieceX][pieceY] = polly;
addChildAt(polly, 0);
}
private function init(_arg1:Event):void{
var _local2:*;
var _local3:Array;
removeEventListener(Event.ADDED_TO_STAGE, init);
puzArray = new Array(12);
_local2 = 0;
while (_local2 < puzArray.length) {
_local3 = new Array(10);
puzArray[_local2] = _local3;
_local2++;
};
creation = true;
createPuzzle();
creation = false;
addEventListener(MouseEvent.MOUSE_DOWN, puzzleBoardDown);
stage.addEventListener(MouseEvent.MOUSE_UP, puzzleBoardUp);
}
private function puzzleBoardUp(_arg1:MouseEvent):void{
removeEventListener(Event.ENTER_FRAME, puzzleBoardClick);
}
private function puzzleBoardDown(_arg1:MouseEvent):void{
if (_arg1.target == "[object PuzzleBoard]"){
if ((((PuzzleMenu.currentBlock > 0)) && ((PuzzleMenu.currentBlock < 4)))){
createBlock(((((_arg1.stageY - (_arg1.stageY % 50)) / 50) * 12) + ((_arg1.stageX - (_arg1.stageX % 50)) / 50)), PuzzleMenu.currentBlock);
};
};
addEventListener(Event.ENTER_FRAME, puzzleBoardClick);
}
private function restartPuzzle(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, trueLoveTest);
rory.walking = false;
dispatchEvent(new Event("restartMe"));
}
private function puzzleBoardClick(_arg1:Event):void{
if ((((((((mouseX < 600)) && ((mouseX > 0)))) && ((mouseY < 500)))) && ((mouseY > 0)))){
if ((((PuzzleMenu.currentBlock > 0)) && ((PuzzleMenu.currentBlock < 4)))){
createBlock(((((mouseY - (mouseY % 50)) / 50) * 12) + ((mouseX - (mouseX % 50)) / 50)), PuzzleMenu.currentBlock);
};
};
}
private function createPuzzle():void{
currentPuzzle = MainMenu.currentLevel;
curArray = PuzzleArrays[("PuzArray" + currentPuzzle)];
createBoard();
}
function frame1(){
gameOverScreen.visible = false;
restartBtn.gotoAndStop(4);
gameOverScreen.addEventListener("restartThis", restartPuzzle);
gameOverScreen.addEventListener("nextLvlPls", nextLevel);
restartBtn.buttonMode = true;
restartBtn.addEventListener(MouseEvent.CLICK, restartPuzzle);
}
public function undoPlacement():void{
var _local1:*;
if (lastPieces.length != 0){
_local1 = ((lastPieces[(lastPieces.length - 1)].x / 50) + ((lastPieces[(lastPieces.length - 1)].y / 50) * 12));
lastPieces[(lastPieces.length - 1)].pieceType = 0;
lastPieces.pop();
createBlock(_local1, 0);
};
}
private function createBoard():void{
var _local1:*;
var _local2:Grid;
_local1 = 0;
while (_local1 < 120) {
switch (curArray[_local1]){
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
createBlock(_local1, curArray[_local1]);
break;
case 7:
createNewPolly(_local1);
break;
case 8:
createNewRory(_local1, "left");
break;
case 9:
createNewRory(_local1, "right");
break;
};
_local1++;
};
updateBoard();
setChildIndex(rory, (numChildren - 1));
_local2 = new Grid();
_local2.mouseEnabled = false;
addChild(_local2);
addEventListener(Event.ENTER_FRAME, trueLoveTest);
rory.firstSteps = true;
rory.walking = true;
}
private function spiderEat(_arg1:Event):void{
if (rory.y == (_arg1.target.y + 25)){
if ((((rory.x == (_arg1.target.x + 23))) || ((rory.x == (_arg1.target.x + 27))))){
gameOver(_arg1);
};
};
}
private function createNewRory(_arg1, _arg2):void{
rory = new PBrory();
pieceY = Math.floor((_arg1 / 12));
pieceX = (_arg1 % 12);
rory.headed = _arg2;
rory.lastDir = _arg2;
if (_arg2 == "right"){
rory.scaleX = -1;
};
rory.walking = false;
rory.trueRory = true;
rory.addEventListener("death", gameOver);
rory.x = ((pieceX * 50) + 25);
rory.y = ((pieceY * 50) + 25);
addChild(rory);
createBlock(_arg1, 0);
}
private function nextLevel(_arg1:Event):void{
MainMenu.currentLevel = (MainMenu.currentLevel + 1);
dispatchEvent(new Event("restartMe"));
}
private function updateBoard():void{
var _local1:*;
var _local2:*;
_local1 = 0;
while (_local1 < puzArray.length) {
_local2 = 0;
while (_local2 < puzArray[1].length) {
update(puzArray[_local1][_local2], _local1, _local2);
_local2++;
};
_local1++;
};
}
private function update(_arg1, _arg2, _arg3):void{
var _local4:int;
var _local5:int;
var _local6:*;
_local4 = 1;
_local5 = 1;
switch (_arg1.pieceType){
case 0:
if (_arg3 != 9){
if ((((puzArray[_arg2][(_arg3 + 1)].pieceType == 1)) || ((puzArray[_arg2][(_arg3 + 1)].pieceType == 5)))){
if (_arg1.bonus == undefined){
_local6 = (Math.ceil((Math.random() * 11)) + 1);
_arg1.grass.gotoAndStop(_local6);
_arg1.bonus = _local6;
} else {
_arg1.grass.gotoAndStop(_arg1.bonus);
};
} else {
_arg1.grass.gotoAndStop(1);
};
};
break;
case 1:
if (_arg2 != 0){
if (((!((puzArray[(_arg2 - 1)][_arg3].pieceType == 1))) && (!((puzArray[(_arg2 - 1)][_arg3].pieceType == 3))))){
_local4 = (_local4 + 1);
};
};
if (_arg2 != 11){
if (((!((puzArray[(_arg2 + 1)][_arg3].pieceType == 1))) && (!((puzArray[(_arg2 + 1)][_arg3].pieceType == 2))))){
_local4 = (_local4 + 2);
};
};
if (_arg3 != 9){
if (((!((puzArray[_arg2][(_arg3 + 1)].pieceType == 1))) && (!((puzArray[_arg2][(_arg3 + 1)].pieceType == 5))))){
_local4 = (_local4 + 4);
} else {
if (_arg2 != 11){
if ((((puzArray[(_arg2 + 1)][_arg3].pieceType == 1)) || ((puzArray[(_arg2 + 1)][_arg3].pieceType == 2)))){
if (puzArray[(_arg2 + 1)][(_arg3 + 1)].pieceType != 1){
_local5 = (_local5 + 2);
};
};
};
if (_arg2 != 0){
if ((((puzArray[(_arg2 - 1)][_arg3].pieceType == 1)) || ((puzArray[(_arg2 - 1)][_arg3].pieceType == 3)))){
if (puzArray[(_arg2 - 1)][(_arg3 + 1)].pieceType != 1){
_local5 = (_local5 + 4);
};
};
};
};
};
if (_arg3 != 0){
if (((((!((puzArray[_arg2][(_arg3 - 1)].pieceType == 1))) && (!((puzArray[_arg2][(_arg3 - 1)].pieceType == 2))))) && (!((puzArray[_arg2][(_arg3 - 1)].pieceType == 3))))){
_local4 = (_local4 + 8);
} else {
if (_arg2 != 11){
if ((((puzArray[(_arg2 + 1)][_arg3].pieceType == 1)) || ((puzArray[(_arg2 + 1)][_arg3].pieceType == 2)))){
if (((!((puzArray[(_arg2 + 1)][(_arg3 - 1)].pieceType == 1))) && (!((puzArray[(_arg2 + 1)][(_arg3 - 1)].pieceType == 2))))){
_local5 = (_local5 + 8);
} else {
if ((((puzArray[_arg2][(_arg3 - 1)].pieceType == 2)) || ((puzArray[(_arg2 + 1)][_arg3].pieceType == 2)))){
_local5 = (_local5 + 8);
};
};
};
};
if (_arg2 != 0){
if ((((puzArray[(_arg2 - 1)][_arg3].pieceType == 1)) || ((puzArray[(_arg2 - 1)][_arg3].pieceType == 3)))){
if (((!((puzArray[(_arg2 - 1)][(_arg3 - 1)].pieceType == 1))) && (!((puzArray[(_arg2 - 1)][(_arg3 - 1)].pieceType == 3))))){
_local5 = (_local5 + 1);
} else {
if ((((puzArray[_arg2][(_arg3 - 1)].pieceType == 3)) || ((puzArray[(_arg2 - 1)][_arg3].pieceType == 3)))){
_local5 = (_local5 + 1);
};
};
};
};
};
};
_arg1.corners.gotoAndStop(_local5);
break;
case 2:
if (_arg3 != 9){
if (((!((puzArray[_arg2][(_arg3 + 1)].pieceType == 1))) && (!((puzArray[_arg2][(_arg3 + 1)].pieceType == 5))))){
_local4 = (_local4 + 2);
} else {
if (_arg2 != 0){
if ((((puzArray[(_arg2 - 1)][_arg3].pieceType == 1)) || ((puzArray[(_arg2 - 1)][_arg3].pieceType == 3)))){
if (puzArray[(_arg2 - 1)][(_arg3 + 1)].pieceType != 1){
_local5 = (_local5 + 4);
};
};
};
};
};
if (_arg2 != 0){
if (((!((puzArray[(_arg2 - 1)][_arg3].pieceType == 1))) && (!((puzArray[(_arg2 - 1)][_arg3].pieceType == 3))))){
_local4 = (_local4 + 1);
};
};
_arg1.corners.gotoAndStop(_local5);
break;
case 3:
if (_arg3 != 9){
if (((!((puzArray[_arg2][(_arg3 + 1)].pieceType == 1))) && (!((puzArray[_arg2][(_arg3 + 1)].pieceType == 5))))){
_local4 = (_local4 + 2);
} else {
if (_arg2 != 11){
if ((((puzArray[(_arg2 + 1)][_arg3].pieceType == 1)) || ((puzArray[(_arg2 + 1)][_arg3].pieceType == 2)))){
if (puzArray[(_arg2 + 1)][(_arg3 + 1)].pieceType != 1){
_local5 = (_local5 + 2);
};
};
};
};
};
if (_arg2 != 11){
if (((!((puzArray[(_arg2 + 1)][_arg3].pieceType == 1))) && (!((puzArray[(_arg2 + 1)][_arg3].pieceType == 2))))){
_local4 = (_local4 + 1);
};
};
_arg1.corners.gotoAndStop(_local5);
break;
case 5:
if (_arg3 != 9){
if ((((puzArray[_arg2][(_arg3 + 1)].pieceType == 1)) || ((puzArray[_arg2][(_arg3 + 1)].pieceType == 5)))){
if (_arg1.bonus == undefined){
_local6 = (Math.ceil((Math.random() * 11)) + 1);
_arg1.grass.gotoAndStop(_local6);
_arg1.bonus = _local6;
} else {
_arg1.grass.gotoAndStop(_arg1.bonus);
};
} else {
_arg1.grass.gotoAndStop(1);
};
};
break;
};
_arg1.gotoAndStop(_local4);
}
private function trueLoveTest(_arg1:Event):void{
if ((((((((rory.y > (polly.y - 25))) && ((rory.y <= polly.y)))) && ((rory.x > (polly.x - 50))))) && ((rory.x < (polly.x + 50))))){
removeEventListener(Event.ENTER_FRAME, trueLoveTest);
rory.walking = false;
rory.stop();
setChildIndex(gameOverScreen, (numChildren - 1));
removeEventListener(MouseEvent.MOUSE_DOWN, puzzleBoardDown);
removeEventListener(MouseEvent.MOUSE_UP, puzzleBoardUp);
removeEventListener(Event.ENTER_FRAME, puzzleBoardClick);
newCompletion();
gameOverScreen.gotoAndStop(2);
gameOverScreen.visible = true;
} else {
if (rory.hitTestPoint(polly.x, polly.y)){
removeEventListener(Event.ENTER_FRAME, trueLoveTest);
rory.walking = false;
rory.stop();
setChildIndex(gameOverScreen, (numChildren - 1));
removeEventListener(MouseEvent.MOUSE_DOWN, puzzleBoardDown);
removeEventListener(MouseEvent.MOUSE_UP, puzzleBoardUp);
removeEventListener(Event.ENTER_FRAME, puzzleBoardClick);
newCompletion();
gameOverScreen.gotoAndStop(2);
gameOverScreen.visible = true;
};
};
}
private function newCompletion():void{
var _local1:*;
var _local2:Array;
dispatchEvent(new Event("levelcomplete"));
_local1 = SharedObject.getLocal("PillbugData");
if (_local1.data.levelscomplete != null){
_local2 = _local1.data.levelscomplete;
} else {
_local2 = new Array(32);
};
_local2[(MainMenu.currentLevel - 1)] = true;
_local1.data.levelscomplete = _local2;
_local1.flush();
}
private function gameOver(_arg1:Event):void{
rory.walking = false;
setChildIndex(gameOverScreen, (numChildren - 1));
removeEventListener(Event.ENTER_FRAME, trueLoveTest);
removeEventListener(MouseEvent.MOUSE_DOWN, puzzleBoardDown);
removeEventListener(MouseEvent.MOUSE_UP, puzzleBoardUp);
removeEventListener(Event.ENTER_FRAME, puzzleBoardClick);
gameOverScreen.gotoAndStop(1);
gameOverScreen.visible = true;
}
private function createBlock(_arg1, _arg2):void{
switch (_arg2){
case 0:
newPiece = new Blank();
break;
case 1:
newPiece = new Block();
break;
case 2:
newPiece = new LeftRamp();
break;
case 3:
newPiece = new RightRamp();
break;
case 4:
newPiece = new Spikes();
break;
case 5:
newPiece = new Spider();
newPiece.addEventListener("nomNom", spiderEat);
break;
};
newPiece.pieceType = _arg2;
newPiece.cacheAsBitmap = true;
pieceY = Math.floor((_arg1 / 12));
pieceX = (_arg1 % 12);
newPiece.x = (pieceX * 50);
newPiece.y = (pieceY * 50);
if (creation == true){
puzArray[pieceX][pieceY] = newPiece;
newPiece.pieceType = _arg2;
addChildAt(newPiece, 0);
} else {
if ((((((((newPiece.x <= (rory.x + 24))) && ((newPiece.x >= (rory.x - 74))))) && ((newPiece.y <= (rory.y + 25))))) && ((newPiece.y >= (rory.y - 25))))){
if (newPiece.pieceType == 0){
addChildAt(newPiece, getChildIndex(puzArray[pieceX][pieceY]));
removeChild(puzArray[pieceX][pieceY]);
puzArray[pieceX][pieceY] = newPiece;
updateBoard();
};
} else {
if (puzArray[pieceX][pieceY].pieceType == 0){
addChildAt(newPiece, getChildIndex(puzArray[pieceX][pieceY]));
removeChild(puzArray[pieceX][pieceY]);
puzArray[pieceX][pieceY] = newPiece;
if (newPiece.pieceType > 0){
lastPieces.push(newPiece);
};
updateBoard();
};
};
};
}
}
}//package classy
Section 7
//PuzzleMenu (classy.PuzzleMenu)
package classy {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.filters.*;
public class PuzzleMenu extends MovieClip {
public var puzMenuLeft:MovieClip;
private var bfilter:BevelFilter;
public var puzMenuRight:MovieClip;
public var puzMenuMenu:MovieClip;
private var gfilter:GlowFilter;
public var puzMenuLevels:MovieClip;
private var filterArray:Array;
public var puzMenuBlock:MovieClip;
public var mbtheiBtn:MovieClip;
public var puzMenuOptions:MovieClip;
public static var currentBlock:int = 0;
public static var mainMenuOption:int = 0;
public function PuzzleMenu(){
gfilter = new GlowFilter();
bfilter = new BevelFilter(2);
filterArray = new Array();
super();
addFrameScript(0, frame1);
}
private function mouseWheeler(_arg1:MouseEvent):void{
var _local2:Boolean;
if (_arg1.delta > 0){
_local2 = true;
} else {
_local2 = false;
};
removeGlow(currentBlock);
if (_local2 == true){
switch (currentBlock){
case 1:
case 0:
currentBlock = 3;
applyGlow(puzMenuRight);
break;
case 2:
currentBlock = 1;
applyGlow(puzMenuBlock);
break;
case 3:
currentBlock = 2;
applyGlow(puzMenuLeft);
break;
};
} else {
switch (currentBlock){
case 2:
currentBlock = 3;
applyGlow(puzMenuRight);
break;
case 3:
case 0:
currentBlock = 1;
applyGlow(puzMenuBlock);
break;
case 1:
currentBlock = 2;
applyGlow(puzMenuLeft);
break;
};
};
}
private function applyGlow(_arg1:MovieClip):void{
filterArray = new Array();
filterArray.push(gfilter);
filterArray.push(bfilter);
_arg1.filters = filterArray;
}
private function removeGlow(_arg1):void{
filterArray = new Array();
filterArray.push(bfilter);
switch (_arg1){
case 1:
puzMenuBlock.filters = filterArray;
break;
case 2:
puzMenuLeft.filters = filterArray;
break;
case 3:
puzMenuRight.filters = filterArray;
break;
};
}
private function selectMenuPiece(_arg1:MouseEvent):void{
removeGlow(currentBlock);
if (_arg1.target.parent == this){
applyGlow(MovieClip(_arg1.target));
currentBlock = _arg1.target.blocktype;
} else {
currentBlock = _arg1.target.parent.blocktype;
applyGlow(_arg1.target.parent);
};
}
private function viewOptions(_arg1:MouseEvent):void{
mainMenuOption = 3;
dispatchEvent(new Event("showMenu"));
}
private function keyboardHandler(_arg1:KeyboardEvent):void{
if ((((((_arg1.keyCode == 49)) || ((_arg1.keyCode == 50)))) || ((_arg1.keyCode == 51)))){
removeGlow(currentBlock);
currentBlock = (_arg1.keyCode - 48);
switch (currentBlock){
case 1:
applyGlow(puzMenuBlock);
break;
case 2:
applyGlow(puzMenuLeft);
break;
case 3:
applyGlow(puzMenuRight);
break;
};
};
if (_arg1.keyCode == 77){
dispatchEvent(new Event("mMute"));
};
if (_arg1.keyCode == 81){
dispatchEvent(new Event("changeQuality"));
};
if (_arg1.keyCode == 82){
dispatchEvent(new Event("restartThePuzzle"));
};
if (_arg1.keyCode == 85){
dispatchEvent(new Event("undoPiece"));
};
}
function frame1(){
puzMenuBlock.addEventListener(MouseEvent.CLICK, selectMenuPiece);
puzMenuLeft.addEventListener(MouseEvent.CLICK, selectMenuPiece);
puzMenuRight.addEventListener(MouseEvent.CLICK, selectMenuPiece);
puzMenuMenu.addEventListener(MouseEvent.CLICK, viewMenu);
puzMenuOptions.addEventListener(MouseEvent.CLICK, viewOptions);
puzMenuLevels.addEventListener(MouseEvent.CLICK, viewLevels);
mbtheiBtn.addEventListener(MouseEvent.CLICK, viewMBtheI);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyboardHandler);
stage.addEventListener(MouseEvent.MOUSE_WHEEL, mouseWheeler);
mbtheiBtn.buttonMode = true;
puzMenuMenu.buttonMode = true;
puzMenuLevels.buttonMode = true;
puzMenuBlock.buttonMode = true;
puzMenuLeft.buttonMode = true;
puzMenuRight.buttonMode = true;
puzMenuOptions.buttonMode = true;
puzMenuBlock.blocktype = 1;
puzMenuLeft.blocktype = 2;
puzMenuRight.blocktype = 3;
puzMenuOptions.gotoAndStop(2);
puzMenuLevels.gotoAndStop(3);
}
private function viewLevels(_arg1:MouseEvent):void{
mainMenuOption = 2;
dispatchEvent(new Event("showMenu"));
}
private function viewMenu(_arg1:MouseEvent):void{
mainMenuOption = 1;
dispatchEvent(new Event("showMenu"));
}
private function viewMBtheI(_arg1:MouseEvent):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.kongregate.com/accounts/MBtheI");
navigateToURL(_local2);
}
}
}//package classy
Section 8
//World (classy.World)
package classy {
import flash.display.*;
public dynamic class World extends MovieClip {
}
}//package classy
Section 9
//KongregateEvent (com.kongregate.as3.client.events.KongregateEvent)
package com.kongregate.as3.client.events {
import flash.events.*;
public class KongregateEvent extends Event {
public static const COMPLETE:String = "component_api_available";
public function KongregateEvent(_arg1:String){
super(_arg1);
}
}
}//package com.kongregate.as3.client.events
Section 10
//AbstractShadowService (com.kongregate.as3.client.services.AbstractShadowService)
package com.kongregate.as3.client.services {
import flash.events.*;
public class AbstractShadowService extends EventDispatcher {
protected function alert(_arg1:String, _arg2:String, _arg3="", _arg4:String=""):void{
trace(((((((("Kongregate API: " + _arg1) + ".") + _arg2) + "(") + _arg3) + ") ") + _arg4));
}
}
}//package com.kongregate.as3.client.services
Section 11
//HighScoreServiceShadow (com.kongregate.as3.client.services.HighScoreServiceShadow)
package com.kongregate.as3.client.services {
public class HighScoreServiceShadow extends AbstractShadowService implements IHighScoreServices {
private var mode:String;
public function HighScoreServiceShadow(){
mode = "";
}
public function submit(_arg1:Number, _arg2:String=null):void{
alert("IHighScoreServices", "submit", arguments);
}
public function connect():Boolean{
alert("IKongregateServices", "connect");
return (true);
}
public function requestList(_arg1:Function):void{
alert("IHighScoreServices", "requestList", "", (("[Mode: " + mode) + "]"));
_arg1({success:false});
}
public function setMode(_arg1:String):void{
alert("IHighScoreServices", "setMode", arguments);
this.mode = _arg1;
}
}
}//package com.kongregate.as3.client.services
Section 12
//IHighScoreServices (com.kongregate.as3.client.services.IHighScoreServices)
package com.kongregate.as3.client.services {
public interface IHighScoreServices {
function setMode(_arg1:String):void;
function submit(_arg1:Number, _arg2:String=null):void;
function requestList(_arg1:Function):void;
}
}//package com.kongregate.as3.client.services
Section 13
//IKongregateServices (com.kongregate.as3.client.services.IKongregateServices)
package com.kongregate.as3.client.services {
import flash.events.*;
public interface IKongregateServices extends IEventDispatcher {
function getPlayerInfo(_arg1:Function):void;
function connect(_arg1:Number=-1):Boolean;
}
}//package com.kongregate.as3.client.services
Section 14
//IStatServices (com.kongregate.as3.client.services.IStatServices)
package com.kongregate.as3.client.services {
public interface IStatServices {
function submitArray(_arg1:Array):void;
function submit(_arg1:String, _arg2:Number):void;
}
}//package com.kongregate.as3.client.services
Section 15
//IUserServices (com.kongregate.as3.client.services.IUserServices)
package com.kongregate.as3.client.services {
public interface IUserServices {
function getName():String;
function getPlayerInfo(_arg1:Function):void;
}
}//package com.kongregate.as3.client.services
Section 16
//KongregateServiceShadow (com.kongregate.as3.client.services.KongregateServiceShadow)
package com.kongregate.as3.client.services {
public class KongregateServiceShadow extends AbstractShadowService implements IKongregateServices {
public function getName():String{
alert("IKongregateServices", "getName");
return ("Guest");
}
public function connect(_arg1:Number=-1):Boolean{
alert("IKongregateServices", "connect", arguments);
return (true);
}
public function getPlayerInfo(_arg1:Function):void{
alert("IKongregateServices", "getPlayerInfo");
_arg1(new Object());
}
}
}//package com.kongregate.as3.client.services
Section 17
//StatServiceShadow (com.kongregate.as3.client.services.StatServiceShadow)
package com.kongregate.as3.client.services {
public class StatServiceShadow extends AbstractShadowService implements IStatServices {
public function submitArray(_arg1:Array):void{
alert("IStatServices", "submitArray", arguments);
}
public function submit(_arg1:String, _arg2:Number):void{
alert("IStatServices", "submitStat", arguments);
}
}
}//package com.kongregate.as3.client.services
Section 18
//UserServiceShadow (com.kongregate.as3.client.services.UserServiceShadow)
package com.kongregate.as3.client.services {
public class UserServiceShadow extends AbstractShadowService implements IUserServices {
public function getName():String{
alert("UserService", "getName");
return ("Guest");
}
public function getPlayerInfo(_arg1:Function):void{
alert("UserService", "getPlayerInfo");
_arg1({isGuest:true, name:"Guest", points:0, level:0, isMode:false, isAdmin:false, isDeveloper:false, avatarPath:"", chatAvatarPath:""});
}
}
}//package com.kongregate.as3.client.services
Section 19
//IAPIBootstrap (com.kongregate.as3.client.IAPIBootstrap)
package com.kongregate.as3.client {
import flash.events.*;
import flash.display.*;
public interface IAPIBootstrap {
function init(_arg1:Event=null, _arg2:Stage=null):void;
function hideLog():void;
function showLog(_arg1:int=0):void;
}
}//package com.kongregate.as3.client
Section 20
//KongregateAPI (com.kongregate.as3.client.KongregateAPI)
package com.kongregate.as3.client {
import flash.events.*;
import flash.display.*;
import com.kongregate.as3.client.services.*;
import com.kongregate.as3.client.events.*;
import flash.system.*;
import flash.net.*;
import flash.errors.*;
import flash.utils.*;
public class KongregateAPI extends Sprite {
private const VERSION:Number = 1;
private var loader:Loader;
private var loadedDomain:ApplicationDomain;
private static const CLASS_USER:String = "com.kongregate.as3.client.services.UserServices";
private static const CLASS_STATS:String = "com.kongregate.as3.client.services.StatServices";
private static const CLASS_SERVICES:String = "com.kongregate.as3.client.services.KongregateServices";
private static const CLASS_SCORES:String = "com.kongregate.as3.client.services.HighScoreServices";
private static const DEBUG_API_URL:String = "//Linuxpc/kongregate/public/flash/API_AS3.swf";
private static var _connected:Boolean;
private static var kUser:IUserServices;
private static var _loaded:Boolean;
private static var kServices:IKongregateServices;
private static var kScores:IHighScoreServices;
private static var mInstance:KongregateAPI;
private static var kStats:IStatServices;
private static var kAPI:IAPIBootstrap;
public function KongregateAPI(){
if (mInstance != null){
throw (new Error("Warning: KongregateAPI has been added to stage more than once or accessed improperly. Use getInstance() or a stage reference to access."));
};
mInstance = this;
this.addEventListener(Event.ADDED_TO_STAGE, init, false, 0, true);
}
public function get loaded():Boolean{
return (_loaded);
}
public function get connected():Boolean{
return (_connected);
}
private function alertConnected(_arg1:TimerEvent=null):void{
var _local2:KongregateEvent;
var _local3:Boolean;
_local2 = new KongregateEvent(KongregateEvent.COMPLETE);
_local3 = this.dispatchEvent(_local2);
}
private function init(_arg1:Event):void{
var _local2:Object;
var _local3:String;
var _local4:URLRequest;
var _local5:LoaderContext;
this.removeEventListener(Event.ADDED_TO_STAGE, init);
_loaded = false;
_connected = false;
_local2 = LoaderInfo(root.loaderInfo).parameters;
_local3 = _local2.api_path;
if (_local3 == null){
trace("Alert: Kongregate API could not be loaded, due to local testing. API will load when the game is uploaded.");
createShadowServices();
return;
};
Security.allowDomain("*.kongregate.com");
Security.allowDomain("kongregatetrunk.com");
_local4 = new URLRequest(_local3);
_local5 = new LoaderContext(false);
_local5.applicationDomain = ApplicationDomain.currentDomain;
_local5.securityDomain = SecurityDomain.currentDomain;
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
loader.load(_local4, _local5);
}
public function get api():IAPIBootstrap{
return (kAPI);
}
private function loadComplete(_arg1:Event):void{
getServices();
}
public function get scores():IHighScoreServices{
return (kScores);
}
private function ioErrorHandler(_arg1:IOErrorEvent):void{
throw (new IOError(("API file not found. " + _arg1)));
}
public function get services():IKongregateServices{
return (kServices);
}
public function get stats():IStatServices{
return (kStats);
}
private function createShadowServices():void{
var _local1:Timer;
trace(">>> Kongregate Shadow Services instantiated for local development..");
kServices = new KongregateServiceShadow();
kScores = new HighScoreServiceShadow();
kStats = new StatServiceShadow();
kUser = new UserServiceShadow();
_local1 = new Timer(200, 1);
_local1.addEventListener(TimerEvent.TIMER_COMPLETE, alertConnected);
_local1.start();
_connected = true;
}
public function get user():IUserServices{
return (kUser);
}
private function getServices():void{
var _local1:ApplicationDomain;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
_local1 = ApplicationDomain.currentDomain;
kAPI = IAPIBootstrap(loader.getChildAt(0));
this.addChild(loader);
_local2 = _local1.getDefinition(CLASS_SERVICES);
trace(_local2);
kServices = _local2.getInstance();
_local3 = _local1.getDefinition(CLASS_SCORES);
kScores = _local3.getInstance();
_local4 = _local1.getDefinition(CLASS_STATS);
kStats = _local4.getInstance();
_local5 = _local1.getDefinition(CLASS_USER);
kUser = _local5.getInstance();
kServices.connect(VERSION);
_loaded = true;
_connected = true;
alertConnected();
}
public static function getInstance():KongregateAPI{
if (!mInstance){
throw (new IllegalOperationError("You must add the Kongregate API component to the stage before attempting to access it."));
};
return (mInstance);
}
}
}//package com.kongregate.as3.client
Section 21
//_BlockGrass_3 (PRunMochi_fla._BlockGrass_3)
package PRunMochi_fla {
import flash.display.*;
public dynamic class _BlockGrass_3 extends MovieClip {
public function _BlockGrass_3(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package PRunMochi_fla
Section 22
//_MenuBtn_9 (PRunMochi_fla._MenuBtn_9)
package PRunMochi_fla {
import flash.display.*;
public dynamic class _MenuBtn_9 extends MovieClip {
public function _MenuBtn_9(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package PRunMochi_fla
Section 23
//_MenuBtnIntro_37 (PRunMochi_fla._MenuBtnIntro_37)
package PRunMochi_fla {
import flash.display.*;
public dynamic class _MenuBtnIntro_37 extends MovieClip {
public function _MenuBtnIntro_37(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package PRunMochi_fla
Section 24
//_MuteBtn_19 (PRunMochi_fla._MuteBtn_19)
package PRunMochi_fla {
import flash.display.*;
public dynamic class _MuteBtn_19 extends MovieClip {
public function _MuteBtn_19(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package PRunMochi_fla
Section 25
//_RampGrass_42 (PRunMochi_fla._RampGrass_42)
package PRunMochi_fla {
import flash.display.*;
public dynamic class _RampGrass_42 extends MovieClip {
public function _RampGrass_42(){
addFrameScript(0, frame1);
}
function frame1(){
this.gotoAndStop(Math.ceil((Math.random() * 11)));
}
}
}//package PRunMochi_fla
Section 26
//congrats_18 (PRunMochi_fla.congrats_18)
package PRunMochi_fla {
import flash.display.*;
public dynamic class congrats_18 extends MovieClip {
public function congrats_18(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package PRunMochi_fla
Section 27
//corners_39 (PRunMochi_fla.corners_39)
package PRunMochi_fla {
import flash.display.*;
public dynamic class corners_39 extends MovieClip {
public function corners_39(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package PRunMochi_fla
Section 28
//gameOverScreen_8 (PRunMochi_fla.gameOverScreen_8)
package PRunMochi_fla {
import flash.events.*;
import flash.display.*;
public dynamic class gameOverScreen_8 extends MovieClip {
public var nextBtn:MovieClip;
public var retryBtn:MovieClip;
public function gameOverScreen_8(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
retryBtn.gotoAndStop(4);
retryBtn.buttonMode = true;
retryBtn.addEventListener(MouseEvent.CLICK, restartLevel);
}
function frame2(){
nextBtn.gotoAndStop(5);
nextBtn.buttonMode = true;
nextBtn.addEventListener(MouseEvent.CLICK, nextLevel);
}
public function nextLevel(_arg1:MouseEvent):void{
dispatchEvent(new Event("nextLvlPls"));
}
public function restartLevel(_arg1:MouseEvent):void{
dispatchEvent(new Event("restartThis"));
}
}
}//package PRunMochi_fla
Section 29
//hat_36 (PRunMochi_fla.hat_36)
package PRunMochi_fla {
import flash.events.*;
import flash.display.*;
public dynamic class hat_36 extends MovieClip {
public var playBtn:MovieClip;
public function hat_36(){
addFrameScript(7, frame8);
}
function frame8(){
stop();
playBtn.buttonMode = true;
playBtn.addEventListener(MouseEvent.CLICK, playBtnClick);
}
public function playBtnClick(_arg1:MouseEvent):void{
dispatchEvent(new Event("playGame"));
}
}
}//package PRunMochi_fla
Section 30
//instructionsMC_24 (PRunMochi_fla.instructionsMC_24)
package PRunMochi_fla {
import flash.display.*;
public dynamic class instructionsMC_24 extends MovieClip {
public function instructionsMC_24(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package PRunMochi_fla
Section 31
//qualityBtn_21 (PRunMochi_fla.qualityBtn_21)
package PRunMochi_fla {
import flash.display.*;
public dynamic class qualityBtn_21 extends MovieClip {
public function qualityBtn_21(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package PRunMochi_fla
Section 32
//SongMC_22 (PRunMochi_fla.SongMC_22)
package PRunMochi_fla {
import flash.display.*;
public dynamic class SongMC_22 extends MovieClip {
public function SongMC_22(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package PRunMochi_fla
Section 33
//Blank (Blank)
package {
import flash.display.*;
public dynamic class Blank extends MovieClip {
public var grass:MovieClip;
public function Blank(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 34
//Block (Block)
package {
import flash.display.*;
public dynamic class Block extends MovieClip {
public var corners:MovieClip;
}
}//package
Section 35
//Checkmark (Checkmark)
package {
import flash.display.*;
public dynamic class Checkmark extends MovieClip {
}
}//package
Section 36
//Grid (Grid)
package {
import flash.display.*;
public dynamic class Grid extends MovieClip {
}
}//package
Section 37
//Intro (Intro)
package {
import flash.events.*;
import flash.display.*;
public dynamic class Intro extends MovieClip {
public var hat:MovieClip;
public var mutedIntro:MovieClip;
public function Intro(){
addFrameScript(0, frame1, 99, frame100);
}
function frame1(){
mutedIntro.buttonMode = true;
mutedIntro.addEventListener(MouseEvent.CLICK, muteIntro);
}
function frame100(){
stop();
hat.addEventListener("playGame", playGameDispatch);
}
public function muteIntro(_arg1:MouseEvent):void{
dispatchEvent(new Event("muteTheIntro"));
switch (mutedIntro.currentFrame){
case 1:
mutedIntro.gotoAndStop(2);
break;
case 2:
mutedIntro.gotoAndStop(1);
break;
};
}
public function playGameDispatch(_arg1:Event):void{
dispatchEvent(new Event("readyPlay"));
}
}
}//package
Section 38
//IntroMusic (IntroMusic)
package {
import flash.media.*;
public dynamic class IntroMusic extends Sound {
}
}//package
Section 39
//LeftRamp (LeftRamp)
package {
import flash.display.*;
public dynamic class LeftRamp extends MovieClip {
public var grass:MovieClip;
public var corners:MovieClip;
}
}//package
Section 40
//LevelCover (LevelCover)
package {
import flash.display.*;
public dynamic class LevelCover extends MovieClip {
}
}//package
Section 41
//Music (Music)
package {
import flash.media.*;
public dynamic class Music extends Sound {
}
}//package
Section 42
//PBpolly (PBpolly)
package {
import flash.display.*;
public dynamic class PBpolly extends MovieClip {
public function PBpolly(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 43
//RightRamp (RightRamp)
package {
import flash.display.*;
public dynamic class RightRamp extends MovieClip {
public var grass:MovieClip;
public var corners:MovieClip;
}
}//package
Section 44
//Spider (Spider)
package {
import flash.display.*;
public dynamic class Spider extends MovieClip {
public var grass:MovieClip;
public function Spider(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package
Section 45
//Spikes (Spikes)
package {
import flash.display.*;
public dynamic class Spikes extends MovieClip {
}
}//package