Section 1
//betweenLevelScreen (betweenLevelScreen)
package {
import flash.display.*;
public class betweenLevelScreen extends MovieClip {
}
}//package
Section 2
//betweenLevelScreenStartButton (betweenLevelScreenStartButton)
package {
import flash.display.*;
public dynamic class betweenLevelScreenStartButton extends MovieClip {
}
}//package
Section 3
//block1 (block1)
package {
import flash.display.*;
public class block1 extends MovieClip {
}
}//package
Section 4
//block2 (block2)
package {
import flash.display.*;
public dynamic class block2 extends MovieClip {
}
}//package
Section 5
//bonus (bonus)
package {
import flash.display.*;
public class bonus extends MovieClip {
var active:Boolean;// = true
var scoreToDisplay:int;// = 0
var deathPending:Boolean;// = false
public function bonus(){
deathPending = false;
scoreToDisplay = 0;
active = true;
super();
}
public function getScore(){
return (scoreToDisplay);
}
public function getActive():Boolean{
return (active);
}
public function die(_arg1:int){
deathPending = true;
scoreToDisplay = _arg1;
}
public function update():Boolean{
return (deathPending);
}
public function sleep(){
active = false;
}
}
}//package
Section 6
//bonusText (bonusText)
package {
import flash.display.*;
import flash.text.*;
public class bonusText extends MovieClip {
var startX:int;
var startY:int;
var dead:Boolean;// = false
public var scoreText:TextField;
public function bonusText(_arg1:Number, _arg2:Number){
dead = false;
super();
x = _arg1;
y = _arg2;
startX = _arg1;
startY = _arg2;
}
public function die(){
this.parent.removeChild(this);
dead = true;
}
public function update(_arg1:Number){
if (!dead){
y = (y - (1 * _arg1));
if (y < (startY - 60)){
this.die();
};
};
}
}
}//package
Section 7
//coinSound (coinSound)
package {
import flash.media.*;
public dynamic class coinSound extends Sound {
}
}//package
Section 8
//crumbleBlock (crumbleBlock)
package {
import flash.display.*;
public class crumbleBlock extends MovieClip {
var health:Number;
var cBHeight:Number;
var cBWidth:Number;
var mapIndex:int;
var maxHealth:Number;
public function crumbleBlock(_arg1:Number, _arg2:int, _arg3:Number, _arg4:Number){
health = _arg1;
maxHealth = _arg1;
mapIndex = _arg2;
cBWidth = _arg3;
cBHeight = _arg4;
}
public function update(_arg1:mainChar, _arg2:Array, _arg3:Number){
if (health > 0){
if ((((_arg1.x >= this.x)) && ((_arg1.x <= (this.x + cBWidth))))){
if ((((_arg1.y >= (this.y - _arg1.getHeight()))) && ((_arg1.y <= this.y)))){
health = (health - _arg3);
if (health <= 0){
health = 0;
_arg2[mapIndex] = 0;
};
};
};
};
this.alpha = (health / maxHealth);
}
}
}//package
Section 9
//dieSound (dieSound)
package {
import flash.media.*;
public dynamic class dieSound extends Sound {
}
}//package
Section 10
//docClass (docClass)
package {
import flash.events.*;
import flash.display.*;
public dynamic class docClass extends MovieClip {
var gameOver1:gameOverSound;
var level1:level;
var levelComplete1:levelCompleteSound;
var gameGrid:Array;
var gameOverScreen1:gameOverScreen;
var numLevels:int;// = 4
var score:int;// = 0
var gameCompleteScreen1:gameCompleteScreen;
var gameComplete1:gameCompleteSound;
var titleScreen1:titleScreen;
var levelNumber:int;
public function docClass(){
numLevels = 4;
score = 0;
gameOver1 = new gameOverSound();
gameComplete1 = new gameCompleteSound();
levelComplete1 = new levelCompleteSound();
super();
titleScreen1 = new titleScreen();
this.addChild(titleScreen1);
titleScreen1.start.addEventListener(MouseEvent.CLICK, startGame);
gameOverScreen1 = new gameOverScreen();
gameCompleteScreen1 = new gameCompleteScreen();
gameCompleteScreen1.restart.addEventListener(MouseEvent.CLICK, gCReset);
gameOverScreen1.restart.addEventListener(MouseEvent.CLICK, gOReset);
}
function setupLevel(){
gameGrid = new Array();
switch (levelNumber){
case 0:
gameGrid.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
gameGrid.push(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1);
gameGrid.push(1, 0, 0, 0, 0, 56, 0, 0, 0, 0, 56, 0, 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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rid.push(1, 0, 0, 0, 5, 1, 50, 51, 52, 1, 5, 1, 50, 51, 52, 1, 5, 1, 1, 1, 0, 0, 2, 2, 0, 0, 50, 51, 51, 51, 52, 1);
gameGrid.push(1, 56, 0, 0, 0, 5, 5, 5, 5, 5, 56, 5, 5, 5, 5, 5, 56, 5, 5, 1, 1, 1, 2, 2, 0, 0, 13, 0, 13, 0, 0, 1);
gameGrid.push(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 2, 2, 0, 0, 0, 0, 0, 0, 56, 1);
gameGrid.push(1, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 1);
gameGrid.push(1, 0, 0, 0, 1, 3, 0, 56, 0, 0, 1, 3, 0, 56, 0, 0, 1, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 1);
gameGrid.push(1, 1, 1, 1, 1, 53, 54, 54, 54, 55, 1, 53, 54, 54, 54, 55, 1, 53, 54, 54, 54, 55, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
break;
case 3:
gameGrid.push(1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1);
gameGrid.push(6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7);
gameGrid.push(6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7);
gameGrid.push(6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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rid.push(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 0, 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 1);
gameGrid.push(1, 0, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 1);
gameGrid.push(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 1);
gameGrid.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
break;
default:
break;
};
}
function handleKeyUp(_arg1:KeyboardEvent):void{
level1.handleKeyUp(_arg1);
}
public function gCReset(_arg1:MouseEvent){
this.removeChild(gameCompleteScreen1);
reset();
}
public function gameComplete(){
stage.removeEventListener(KeyboardEvent.KEY_DOWN, handleKeyDown);
stage.removeEventListener(KeyboardEvent.KEY_UP, handleKeyUp);
stage.removeEventListener(Event.ENTER_FRAME, update);
gameComplete1.play();
gameCompleteScreen1.scoreText.text = String(score);
this.addChild(gameCompleteScreen1);
}
public function reset(){
score = 0;
this.addChild(titleScreen1);
}
public function gOReset(_arg1:MouseEvent){
this.removeChild(gameOverScreen1);
reset();
}
public function startGame(_arg1:MouseEvent){
this.removeChild(titleScreen1);
levelNumber = 0;
setupLevel();
level1 = new level(gameGrid, 1200);
addChild(level1);
stage.addEventListener(KeyboardEvent.KEY_DOWN, handleKeyDown);
stage.addEventListener(KeyboardEvent.KEY_UP, handleKeyUp);
stage.addEventListener(Event.ENTER_FRAME, update);
}
function handleKeyDown(_arg1:KeyboardEvent):void{
level1.handleKeyDown(_arg1);
}
function update(_arg1:Event){
level1.update(_arg1);
if (level1.timeRemaining <= 0){
score = level1.score;
removeChild(level1);
gameOver();
} else {
if (level1.isComplete()){
score = level1.score;
removeChild(level1);
level1 = null;
levelNumber++;
if (levelNumber < numLevels){
levelComplete1.play();
setupLevel();
level1 = new level(gameGrid, 1200);
level1.score = score;
addChild(level1);
} else {
gameComplete();
};
};
};
}
public function gameOver(){
stage.removeEventListener(KeyboardEvent.KEY_DOWN, handleKeyDown);
stage.removeEventListener(KeyboardEvent.KEY_UP, handleKeyUp);
stage.removeEventListener(Event.ENTER_FRAME, update);
gameOver1.play();
gameOverScreen1.scoreText.text = String(score);
this.addChild(gameOverScreen1);
}
}
}//package
Section 11
//door (door)
package {
import flash.display.*;
public class door extends MovieClip {
var open:Boolean;// = false
public var targetClip:doorTarget;
public function door(){
open = false;
super();
addFrameScript(0, frame1, 14, frame15);
}
public function openDoor(){
gotoAndPlay("open");
open = true;
}
function frame15(){
stop();
}
function frame1(){
stop();
}
public function isOpen():Boolean{
return (open);
}
}
}//package
Section 12
//doorTarget (doorTarget)
package {
import flash.display.*;
public dynamic class doorTarget extends MovieClip {
}
}//package
Section 13
//enemy (enemy)
package {
public class enemy extends gameObject {
var prospectiveX:Number;
var prospectiveY:Number;
var LEFT:int;// = 0
var bottomLeftGridX:Number;
var bottomLeftGridY:Number;
var HORIZONTAL:int;// = 4
var topLeftGridX:Number;
var topLeftGridY:Number;
var topRightGridY:Number;
var topRightGridX:Number;
var speed:Number;
var STATIC:int;// = 3
var gridYSize:int;
var enemyGridXs:Array;
var UP:int;// = 6
var enemyGridYs:Array;
var DOWN:int;// = 7
var movement:int;
var enemyHeight:Number;
var enemyDirection:int;
var topLeftY:Number;
var topLeftX:Number;
var gridXSize:int;
var enemyWidth:Number;
var enemyMathExt:mathExt;
var topRightY:Number;
var topRightX:Number;
var VERTICAL:int;// = 5
var isStationary:Boolean;// = false
var bottomRightGridX:Number;
var bottomRightGridY:Number;
var bottomRightY:Number;
var bottomLeftX:Number;
var bottomRightX:Number;
var bottomLeftY:Number;
var RIGHT:int;// = 1
public function enemy(){
LEFT = 0;
RIGHT = 1;
STATIC = 3;
HORIZONTAL = 4;
VERTICAL = 5;
UP = 6;
DOWN = 7;
isStationary = false;
super();
}
function moveTest(_arg1:Array):Boolean{
var _local2:Boolean;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
_local2 = true;
_local3 = enemyGridXs.length;
_local4 = 0;
while (_local4 < _local3) {
_local5 = enemyMathExt.convertToIndex(enemyGridXs[_local4], enemyGridYs[_local4]);
switch (enemyDirection){
case LEFT:
_local6 = enemyMathExt.convertToIndex((enemyGridXs[_local4] + 1), enemyGridYs[_local4]);
break;
case RIGHT:
_local6 = enemyMathExt.convertToIndex((enemyGridXs[_local4] - 1), enemyGridYs[_local4]);
break;
case UP:
_local6 = enemyMathExt.convertToIndex(enemyGridXs[_local4], (enemyGridYs[_local4] + 1));
break;
case DOWN:
_local6 = enemyMathExt.convertToIndex(enemyGridXs[_local4], (enemyGridYs[_local4] - 1));
break;
default:
_local6 = enemyMathExt.convertToIndex(enemyGridXs[_local4], enemyGridYs[_local4]);
break;
};
switch (_arg1[_local5]){
case 0:
break;
case 1:
_local2 = false;
break;
case 2:
_local2 = false;
break;
case 43:
_local2 = false;
break;
case 50:
case 51:
case 52:
case 53:
case 54:
case 55:
_local2 = false;
break;
default:
break;
};
_local4++;
};
return (_local2);
}
public function die(){
}
public function update(_arg1:Array, _arg2:Number){
var _local3:Number;
var _local4:Number;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
if (!isStationary){
switch (enemyDirection){
case LEFT:
prospectiveX = (x - (speed * _arg2));
prospectiveY = y;
break;
case RIGHT:
prospectiveX = (x + (speed * _arg2));
prospectiveY = y;
break;
case UP:
prospectiveX = x;
prospectiveY = (y - (speed * _arg2));
break;
case DOWN:
prospectiveX = x;
prospectiveY = (y + (speed * _arg2));
break;
case STATIC:
prospectiveX = x;
prospectiveY = y;
break;
default:
prospectiveX = x;
prospectiveY = y;
break;
};
updateCorners();
if (moveTest(_arg1)){
x = prospectiveX;
y = prospectiveY;
} else {
switch (enemyDirection){
case LEFT:
enemyDirection = RIGHT;
break;
case RIGHT:
enemyDirection = LEFT;
break;
case UP:
enemyDirection = DOWN;
break;
case DOWN:
enemyDirection = UP;
break;
default:
break;
};
};
};
refreshHitBox();
}
public function init(_arg1:Number, _arg2:int, _arg3:int, _arg4:Number, _arg5:Number, _arg6:int, _arg7:int, _arg8){
enemyMathExt = new mathExt(_arg6, _arg7);
speed = _arg1;
gridXSize = _arg2;
gridYSize = _arg3;
enemyWidth = _arg4;
enemyHeight = _arg5;
enemyDirection = STATIC;
enemyGridXs = new Array();
enemyGridYs = new Array();
movement = _arg8;
switch (movement){
case HORIZONTAL:
enemyDirection = RIGHT;
break;
case VERTICAL:
enemyDirection = DOWN;
break;
case STATIC:
enemyDirection = STATIC;
break;
default:
break;
};
setLocalHitBox(3, 3, (gridXSize - 3), (gridYSize - 3));
}
public function kill(){
enemyMathExt = null;
}
function updateCorners(){
var _local1:int;
enemyGridXs = new Array();
enemyGridYs = new Array();
topRightX = (prospectiveX + (enemyWidth - 1));
topRightY = prospectiveY;
topLeftX = prospectiveX;
topLeftY = prospectiveY;
bottomRightX = (prospectiveX + (enemyWidth - 1));
bottomRightY = (prospectiveY + (enemyHeight - 1));
bottomLeftX = prospectiveX;
bottomLeftY = (prospectiveY + (enemyHeight - 1));
topRightGridX = int(((topRightX - (topRightX % gridXSize)) / gridXSize));
topRightGridY = int(((topRightY - (topRightY % gridYSize)) / gridYSize));
topLeftGridX = int(((topLeftX - (topLeftX % gridXSize)) / gridXSize));
topLeftGridY = int(((topLeftY - (topLeftY % gridYSize)) / gridYSize));
bottomRightGridX = int(((bottomRightX - (bottomRightX % gridXSize)) / gridXSize));
bottomRightGridY = int(((bottomRightY - (bottomRightY % gridYSize)) / gridYSize));
bottomLeftGridX = int(((bottomLeftX - (bottomLeftX % gridXSize)) / gridXSize));
bottomLeftGridY = int(((bottomLeftY - (bottomLeftY % gridYSize)) / gridYSize));
enemyGridXs.push(topRightGridX);
enemyGridYs.push(topRightGridY);
enemyGridXs.push(bottomRightGridX);
enemyGridYs.push(bottomRightGridY);
enemyGridXs.push(topLeftGridX);
enemyGridYs.push(topLeftGridY);
enemyGridXs.push(bottomLeftGridX);
enemyGridYs.push(bottomLeftGridY);
if ((topRightGridX - topLeftGridX) > 1){
_local1 = (topLeftGridX + 1);
while (_local1 < topRightGridX) {
enemyGridXs.push(_local1);
enemyGridYs.push(topLeftGridY);
_local1++;
};
};
if ((bottomRightGridX - bottomLeftGridX) > 1){
_local1 = (bottomLeftGridX + 1);
while (_local1 < bottomRightGridX) {
enemyGridXs.push(_local1);
enemyGridYs.push(bottomLeftGridY);
_local1++;
};
};
if ((bottomLeftGridY - topLeftGridY) > 1){
_local1 = (topLeftGridY + 1);
while (_local1 < bottomLeftGridY) {
enemyGridXs.push(topLeftGridX);
enemyGridYs.push(_local1);
_local1++;
};
};
if ((bottomRightGridY - topRightGridY) > 1){
_local1 = (topRightGridY + 1);
while (_local1 < bottomRightGridY) {
enemyGridXs.push(topRightGridX);
enemyGridYs.push(_local1);
_local1++;
};
};
}
}
}//package
Section 14
//gameCompleteScreen (gameCompleteScreen)
package {
import flash.display.*;
import flash.text.*;
public dynamic class gameCompleteScreen extends MovieClip {
public var restart:gameCompleteScreenStartButton;
public var scoreText:TextField;
}
}//package
Section 15
//gameCompleteScreenStartButton (gameCompleteScreenStartButton)
package {
import flash.display.*;
public dynamic class gameCompleteScreenStartButton extends MovieClip {
}
}//package
Section 16
//gameCompleteSound (gameCompleteSound)
package {
import flash.media.*;
public dynamic class gameCompleteSound extends Sound {
}
}//package
Section 17
//gameObject (gameObject)
package {
import flash.display.*;
public class gameObject extends MovieClip {
public var left:Number;
var localLeft:Number;
public var right:Number;
public var bottom:Number;
public var top:Number;
var localRight:Number;
var localBottom:Number;
var localTop:Number;
public function refreshHitBox(){
top = (y + localTop);
bottom = (y + localBottom);
left = (x + localLeft);
right = (x + localRight);
}
public function setLocalHitBox(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
localTop = _arg2;
localLeft = _arg1;
localBottom = _arg4;
localRight = _arg3;
}
public function hitBoxTest(_arg1:gameObject):Boolean{
if ((((((top >= _arg1.top)) && ((top < _arg1.bottom)))) || ((((bottom >= _arg1.top)) && ((bottom < _arg1.bottom)))))){
if ((((((left >= _arg1.left)) && ((left < _arg1.right)))) || ((((right >= _arg1.left)) && ((right < _arg1.right)))))){
return (true);
};
};
return (false);
}
}
}//package
Section 18
//gameOverScreen (gameOverScreen)
package {
import flash.display.*;
import flash.text.*;
public dynamic class gameOverScreen extends MovieClip {
public var restart:gameOverScreenStartButton;
public var scoreText:TextField;
}
}//package
Section 19
//gameOverScreenStartButton (gameOverScreenStartButton)
package {
import flash.display.*;
public dynamic class gameOverScreenStartButton extends MovieClip {
}
}//package
Section 20
//gameOverSound (gameOverSound)
package {
import flash.media.*;
public dynamic class gameOverSound extends Sound {
}
}//package
Section 21
//instructionsScreen (instructionsScreen)
package {
import flash.display.*;
public dynamic class instructionsScreen extends MovieClip {
}
}//package
Section 22
//instructionsScreenStartButton (instructionsScreenStartButton)
package {
import flash.display.*;
public dynamic class instructionsScreenStartButton extends MovieClip {
}
}//package
Section 23
//jumpSound (jumpSound)
package {
import flash.media.*;
public dynamic class jumpSound extends Sound {
}
}//package
Section 24
//leftConveyorLeft (leftConveyorLeft)
package {
import flash.display.*;
public dynamic class leftConveyorLeft extends MovieClip {
}
}//package
Section 25
//leftConveyorMiddle (leftConveyorMiddle)
package {
import flash.display.*;
public dynamic class leftConveyorMiddle extends MovieClip {
}
}//package
Section 26
//leftConveyorRight (leftConveyorRight)
package {
import flash.display.*;
public dynamic class leftConveyorRight extends MovieClip {
}
}//package
Section 27
//level (level)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.ui.*;
public class level extends MovieClip {
var gridXSize:int;
var gridHeight:int;
var LEFT:int;// = 0
var RIGHT:int;// = 1
var HORIZONTAL:int;// = 4
var levelTimer:Timer;
var gridWidth:int;
var door1:door;
var complete:Boolean;
var gameGrid:Array;
var mainChar1:mainChar;
var STATIC:int;// = 3
var VERTICAL:int;// = 5
var gridYSize:int;
var timeLeft:int;
var bonusArray:Array;
var DOWN:int;// = 7
var crumbleBlockArray:Array;
var enemyArray:Array;
var levelReadOut:readOut;
var UP:int;// = 6
var gameMathExt:mathExt;
var bonusTextArray:Array;
public function level(_arg1:Array, _arg2:int){
var _local3:int;
var _local4:MovieClip;
var _local5:crumbleBlock;
var _local6:MovieClip;
var _local7:bonus;
var _local8:enemy;
LEFT = 0;
RIGHT = 1;
STATIC = 3;
HORIZONTAL = 4;
VERTICAL = 5;
UP = 6;
DOWN = 7;
super();
timeLeft = _arg2;
levelReadOut = new readOut();
levelReadOut.x = 0;
levelReadOut.y = 320;
addChild(levelReadOut);
levelReadOut.timerText.text = String(timeLeft);
gameGrid = new Array();
enemyArray = new Array();
bonusArray = new Array();
crumbleBlockArray = new Array();
bonusTextArray = new Array();
complete = false;
gridXSize = 20;
gridYSize = 20;
gridWidth = 32;
gridHeight = 16;
gameMathExt = new mathExt(gridWidth, gridHeight);
gameGrid = _arg1;
levelTimer = new Timer(100, timeLeft);
levelTimer.addEventListener("timer", timerHandler);
levelTimer.start();
_local3 = 0;
while (_local3 < gameGrid.length) {
if (gameGrid[_local3] == 1){
_local4 = new block1();
_local4.x = (gameMathExt.convertToX(_local3) * gridXSize);
_local4.y = (gameMathExt.convertToY(_local3) * gridYSize);
this.addChild(_local4);
} else {
if (gameGrid[_local3] == 2){
_local4 = new block2();
_local4.x = (gameMathExt.convertToX(_local3) * gridXSize);
_local4.y = (gameMathExt.convertToY(_local3) * gridYSize);
this.addChild(_local4);
} else {
if (gameGrid[_local3] == 44){
_local5 = new crumbleBlock(30, _local3, 20, 20);
_local5.x = (gameMathExt.convertToX(_local3) * gridXSize);
_local5.y = (gameMathExt.convertToY(_local3) * gridYSize);
crumbleBlockArray.push(_local5);
this.addChild(_local5);
gameGrid[_local3] = 2;
} else {
if (gameGrid[_local3] == 3){
_local8 = new enemy();
_local8.init(1, gridXSize, gridYSize, 20, 20, gridWidth, gridHeight, HORIZONTAL);
_local8.x = (gameMathExt.convertToX(_local3) * gridXSize);
_local8.y = (gameMathExt.convertToY(_local3) * gridYSize);
addChild(_local8);
enemyArray.push(_local8);
} else {
if (gameGrid[_local3] == 4){
_local8 = new spikes();
_local8.init(1, gridXSize, gridYSize, 20, 20, gridWidth, gridHeight, HORIZONTAL);
_local8.x = (gameMathExt.convertToX(_local3) * gridXSize);
_local8.y = (gameMathExt.convertToY(_local3) * gridYSize);
addChild(_local8);
enemyArray.push(_local8);
} else {
if (gameGrid[_local3] == 5){
_local8 = new spikes2();
_local8.init(1, gridXSize, gridYSize, 20, 20, gridWidth, gridHeight, HORIZONTAL);
_local8.x = (gameMathExt.convertToX(_local3) * gridXSize);
_local8.y = (gameMathExt.convertToY(_local3) * gridYSize);
addChild(_local8);
enemyArray.push(_local8);
} else {
if (gameGrid[_local3] == 6){
_local8 = new spikes3();
_local8.init(1, gridXSize, gridYSize, 20, 20, gridWidth, gridHeight, HORIZONTAL);
_local8.x = (gameMathExt.convertToX(_local3) * gridXSize);
_local8.y = (gameMathExt.convertToY(_local3) * gridYSize);
addChild(_local8);
enemyArray.push(_local8);
} else {
if (gameGrid[_local3] == 7){
_local8 = new spikes4();
_local8.init(1, gridXSize, gridYSize, 20, 20, gridWidth, gridHeight, HORIZONTAL);
_local8.x = (gameMathExt.convertToX(_local3) * gridXSize);
_local8.y = (gameMathExt.convertToY(_local3) * gridYSize);
addChild(_local8);
enemyArray.push(_local8);
} else {
if (gameGrid[_local3] == 13){
_local8 = new enemy();
_local8.init(1, gridXSize, gridYSize, 20, 20, gridWidth, gridHeight, VERTICAL);
_local8.x = (gameMathExt.convertToX(_local3) * gridXSize);
_local8.y = (gameMathExt.convertToY(_local3) * gridYSize);
addChild(_local8);
enemyArray.push(_local8);
} else {
if (gameGrid[_local3] == 50){
_local6 = new leftConveyorLeft();
_local6.x = (gameMathExt.convertToX(_local3) * gridXSize);
_local6.y = (gameMathExt.convertToY(_local3) * gridYSize);
addChild(_local6);
} else {
if (gameGrid[_local3] == 51){
_local6 = new leftConveyorMiddle();
_local6.x = (gameMathExt.convertToX(_local3) * gridXSize);
_local6.y = (gameMathExt.convertToY(_local3) * gridYSize);
addChild(_local6);
} else {
if (gameGrid[_local3] == 52){
_local6 = new leftConveyorRight();
_local6.x = (gameMathExt.convertToX(_local3) * gridXSize);
_local6.y = (gameMathExt.convertToY(_local3) * gridYSize);
addChild(_local6);
} else {
if (gameGrid[_local3] == 53){
_local6 = new rightConveyorLeft();
_local6.x = (gameMathExt.convertToX(_local3) * gridXSize);
_local6.y = (gameMathExt.convertToY(_local3) * gridYSize);
addChild(_local6);
} else {
if (gameGrid[_local3] == 54){
_local6 = new rightConveyorMiddle();
_local6.x = (gameMathExt.convertToX(_local3) * gridXSize);
_local6.y = (gameMathExt.convertToY(_local3) * gridYSize);
addChild(_local6);
} else {
if (gameGrid[_local3] == 55){
_local6 = new rightConveyorRight();
_local6.x = (gameMathExt.convertToX(_local3) * gridXSize);
_local6.y = (gameMathExt.convertToY(_local3) * gridYSize);
addChild(_local6);
} else {
if (gameGrid[_local3] == 56){
_local7 = new bonus();
bonusArray.push(_local7);
_local7.x = (gameMathExt.convertToX(_local3) * gridXSize);
_local7.y = (gameMathExt.convertToY(_local3) * gridYSize);
addChild(_local7);
} else {
if (gameGrid[_local3] == 57){
door1 = new door();
door1.x = (gameMathExt.convertToX(_local3) * gridXSize);
door1.y = (gameMathExt.convertToY(_local3) * gridYSize);
addChild(door1);
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
_local3++;
};
_local3 = 0;
while (_local3 < gameGrid.length) {
if (gameGrid[_local3] == 58){
mainChar1 = new mainChar(4, gridXSize, gridYSize, 20, 30, gridWidth, gridHeight, 60);
mainChar1.x = (gameMathExt.convertToX(_local3) * gridXSize);
mainChar1.y = (gameMathExt.convertToY(_local3) * gridYSize);
addChild(mainChar1);
};
_local3++;
};
}
function handleKeyUp(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.UP){
mainChar1.stopJump();
};
if (_arg1.keyCode == Keyboard.LEFT){
mainChar1.stopLeft();
};
if (_arg1.keyCode == Keyboard.RIGHT){
mainChar1.stopRight();
};
}
public function set score(_arg1:int){
mainChar1.setScore(_arg1);
}
function timerHandler(_arg1:TimerEvent):void{
timeLeft--;
levelReadOut.timerText.text = String(timeLeft);
}
public function get score():int{
return (mainChar1.getScore());
}
function handleKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.UP){
mainChar1.startJump();
};
if (_arg1.keyCode == Keyboard.LEFT){
mainChar1.startLeft();
};
if (_arg1.keyCode == Keyboard.RIGHT){
mainChar1.startRight();
};
}
public function get timeRemaining():int{
return (timeLeft);
}
function update(_arg1:Event){
var _local2:int;
var _local3:int;
var _local4:bonusText;
_local2 = enemyArray.length;
if (mainChar1.update(gameGrid, enemyArray, bonusArray, 1, timeLeft) == 0){
if (door1.isOpen() == false){
door1.openDoor();
};
};
_local3 = 0;
while (_local3 < _local2) {
enemyArray[_local3].update(gameGrid, 1);
_local3++;
};
_local2 = crumbleBlockArray.length;
_local3 = 0;
while (_local3 < _local2) {
crumbleBlockArray[_local3].update(mainChar1, gameGrid, 1);
_local3++;
};
_local2 = bonusArray.length;
_local3 = 0;
while (_local3 < _local2) {
if (((bonusArray[_local3].getActive()) && (bonusArray[_local3].update()))){
_local4 = new bonusText(bonusArray[_local3].x, bonusArray[_local3].y);
_local4.scoreText.text = bonusArray[_local3].getScore();
addChild(_local4);
bonusTextArray.push(_local4);
bonusArray[_local3].sleep();
bonusArray[_local3].x = 2000;
bonusArray[_local3].y = 2000;
removeChild(bonusArray[_local3]);
};
_local3++;
};
_local2 = bonusTextArray.length;
_local3 = 0;
while (_local3 < _local2) {
bonusTextArray[_local3].update(1);
_local3++;
};
if (((mainChar1.hitTestObject(door1.targetClip)) && (door1.isOpen()))){
complete = true;
};
levelReadOut.scoreText.text = mainChar1.getScore();
}
public function isComplete():Boolean{
return (complete);
}
public function getTimeLeft():int{
return (timeLeft);
}
}
}//package
Section 28
//levelCompleteSound (levelCompleteSound)
package {
import flash.media.*;
public dynamic class levelCompleteSound extends Sound {
}
}//package
Section 29
//mainChar (mainChar)
package {
public class mainChar extends gameObject {
var jumpPoint:Number;
var prospectiveX:Number;
var prospectiveY:Number;
var charWidth:Number;
var LEFT:int;// = 0
var jumpPressed:Boolean;// = false
var charHeight:Number;
var jumpBaseY:Number;
var bottomLeftGridX:Number;
var bottomLeftGridY:Number;
var startX:Number;
var startY:Number;
var topLeftGridY:Number;
var topLeftGridX:Number;
var mainCharMathExt:mathExt;
var topRightGridY:Number;
var topRightGridX:Number;
var speed:Number;
var gridYSize:int;
var STATIC:int;// = 3
var falling:Boolean;// = false
var score:int;// = 0
var jumpLength:Number;
var charDirection:int;
var topLeftY:Number;
var topLeftX:Number;
var rightBoost:Boolean;// = false
var STATIC_RIGHT:int;// = 5
var gridXSize:int;
var jumpHeight:Number;
var jumping:Boolean;
var dieLimit:Number;// = 400
var totalBonuses:int;// = 0
var dying:Boolean;// = false
var STATIC_LEFT:int;// = 4
var dieCounter:Number;// = 0
var topRightY:Number;
var topRightX:Number;
var jumpPointVertical:Number;
var firstUpdate:Boolean;// = true
var rightBoostSpeed:Number;// = 1
var bottomRightGridX:Number;
var bottomRightGridY:Number;
var die1:dieSound;
var coin1:coinSound;
var bottomRightY:Number;
var jump1:jumpSound;
var bottomLeftX:Number;
var bottomRightX:Number;
var leftBoostSpeed:Number;// = 1
var charGridXs:Array;
var leftBoost:Boolean;// = false
var bottomLeftY:Number;
var dieHeight:Number;// = 25
var RIGHT:int;// = 1
var charGridYs:Array;
public function mainChar(_arg1:Number, _arg2:int, _arg3:int, _arg4:Number, _arg5:Number, _arg6:int, _arg7:int, _arg8){
firstUpdate = true;
LEFT = 0;
RIGHT = 1;
STATIC = 3;
STATIC_LEFT = 4;
STATIC_RIGHT = 5;
jumpPressed = false;
falling = false;
dieHeight = 25;
dying = false;
dieCounter = 0;
dieLimit = 400;
leftBoost = false;
rightBoost = false;
leftBoostSpeed = 1;
rightBoostSpeed = 1;
totalBonuses = 0;
score = 0;
jump1 = new jumpSound();
coin1 = new coinSound();
die1 = new dieSound();
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7);
mainCharMathExt = new mathExt(_arg6, _arg7);
speed = _arg1;
gridXSize = _arg2;
gridYSize = _arg3;
charWidth = _arg4;
charHeight = _arg5;
jumpHeight = _arg8;
jumping = false;
jumpPoint = 0;
charDirection = STATIC_RIGHT;
this.gotoAndPlay("standRight");
charGridXs = new Array();
charGridYs = new Array();
setLocalHitBox(3, 3, (gridXSize - 3), (gridYSize - 3));
}
function moveTest(_arg1:Array):Boolean{
var _local2:Boolean;
var _local3:int;
var _local4:int;
var _local5:int;
_local2 = true;
_local3 = charGridXs.length;
_local4 = 0;
while (_local4 < _local3) {
_local5 = mainCharMathExt.convertToIndex(charGridXs[_local4], charGridYs[_local4]);
switch (_arg1[_local5]){
case 0:
break;
case 1:
leftBoost = false;
rightBoost = false;
_local2 = false;
break;
case 2:
if ((((prospectiveY > y)) && (!((((prospectiveY + (charHeight - 1)) - ((prospectiveY + (charHeight - 1)) % gridYSize)) == ((y + (charHeight - 1)) - ((y + (charHeight - 1)) % gridYSize))))))){
leftBoost = false;
rightBoost = false;
_local2 = false;
};
break;
case 50:
case 51:
case 52:
if (prospectiveY > y){
leftBoost = true;
_local2 = false;
} else {
leftBoost = false;
rightBoost = false;
_local2 = false;
};
break;
case 53:
case 54:
case 55:
if (prospectiveY > y){
rightBoost = true;
_local2 = false;
} else {
leftBoost = false;
rightBoost = false;
_local2 = false;
};
break;
default:
break;
};
_local4++;
};
return (_local2);
}
public function getHeight():Number{
return (charHeight);
}
public function getWidth():Number{
return (charWidth);
}
function frame2(){
stop();
}
function frame3(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
public function getBonus(){
}
function frame7(){
stop();
}
function frame1(){
stop();
}
public function die(){
die1.play();
dying = true;
this.gotoAndStop("dying");
jumping = false;
jumpPoint = 0;
}
function frame6(){
stop();
}
public function update(_arg1:Array, _arg2:Array, _arg3:Array, _arg4:Number, _arg5:int):int{
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:Number;
var _local15:Number;
var _local16:Boolean;
if (firstUpdate){
firstUpdate = false;
startX = x;
startY = y;
totalBonuses = _arg3.length;
};
if (!dying){
switch (charDirection){
case LEFT:
prospectiveX = (x - (speed * _arg4));
prospectiveY = y;
break;
case RIGHT:
prospectiveX = (x + (speed * _arg4));
prospectiveY = y;
break;
case STATIC_LEFT:
prospectiveX = x;
prospectiveY = y;
break;
case STATIC_RIGHT:
prospectiveX = x;
prospectiveY = y;
break;
default:
prospectiveX = x;
prospectiveY = y;
break;
};
if (leftBoost){
prospectiveX = (prospectiveX - (leftBoostSpeed * _arg4));
};
if (rightBoost){
prospectiveX = (prospectiveX + (rightBoostSpeed * _arg4));
};
if (prospectiveX > x){
_local14 = -1;
} else {
if (prospectiveX < x){
_local14 = 1;
} else {
if (prospectiveX == x){
_local14 = 0;
} else {
_local14 = 0;
};
};
};
if (prospectiveY > y){
_local15 = -1;
} else {
if (prospectiveY < y){
_local15 = 1;
} else {
if (prospectiveY == y){
_local15 = 0;
} else {
_local15 = 0;
};
};
};
while (!((((prospectiveX == x)) && ((prospectiveY == y))))) {
updateCorners();
if (moveTest(_arg1)){
x = prospectiveX;
y = prospectiveY;
break;
};
prospectiveX = (prospectiveX + _local14);
prospectiveY = (prospectiveY + _local15);
};
prospectiveX = x;
prospectiveY = (y + (speed * _arg4));
if (jumping){
jumpPoint = (jumpPoint + (speed * _arg4));
if (jumpPoint > jumpHeight){
jumping = false;
jumpPoint = 0;
switch (charDirection){
case LEFT:
this.gotoAndStop("walkLeft");
break;
case RIGHT:
this.gotoAndStop("walkRight");
break;
case STATIC_RIGHT:
this.gotoAndStop("standRight");
break;
case STATIC_LEFT:
this.gotoAndStop("standLeft");
break;
default:
break;
};
} else {
if (jumpPoint < (jumpHeight / 2)){
_local6 = ((jumpHeight / 2) - jumpPoint);
} else {
_local6 = (jumpPoint - (jumpHeight / 2));
};
};
if (jumping){
jumpPointVertical = Math.sqrt((Math.pow((jumpHeight / 2), 2) - Math.pow(_local6, 2)));
prospectiveY = (jumpBaseY - jumpPointVertical);
};
};
if (prospectiveX > x){
_local14 = -1;
} else {
if (prospectiveX < x){
_local14 = 1;
} else {
if (prospectiveX == x){
_local14 = 0;
} else {
_local14 = 0;
};
};
};
if (prospectiveY > y){
_local15 = -1;
} else {
if (prospectiveY < y){
_local15 = 1;
} else {
if (prospectiveY == y){
_local15 = 0;
} else {
_local15 = 0;
};
};
};
_local16 = true;
while (!((((prospectiveX == x)) && ((prospectiveY == y))))) {
updateCorners();
_local16 = moveTest(_arg1);
if (_local16){
if (prospectiveY > y){
falling = true;
};
x = prospectiveX;
y = prospectiveY;
break;
};
prospectiveX = (prospectiveX + _local14);
prospectiveY = (prospectiveY + _local15);
};
if (!_local16){
if (falling){
switch (charDirection){
case LEFT:
this.gotoAndStop("walkLeft");
break;
case RIGHT:
this.gotoAndStop("walkRight");
break;
case STATIC_RIGHT:
this.gotoAndStop("standRight");
break;
case STATIC_LEFT:
this.gotoAndStop("standLeft");
break;
default:
break;
};
};
falling = false;
jumpPoint = 0;
};
refreshHitBox();
_local12 = _arg2.length;
_local13 = 0;
while (_local13 < _arg2.length) {
if (hitBoxTest(_arg2[_local13])){
die();
};
_local13++;
};
_local12 = _arg3.length;
_local13 = 0;
while (_local13 < _arg3.length) {
if (hitTestObject(_arg3[_local13])){
coin1.play();
_arg3[_local13].die(_arg5);
score = (score + _arg5);
totalBonuses--;
};
_local13++;
};
} else {
dieCounter = (dieCounter + (speed * _arg4));
if (dieCounter > dieHeight){
y = (y + ((speed * 4) * _arg4));
if (y > dieLimit){
x = startX;
y = startY;
dying = false;
this.gotoAndPlay("standRight");
dieCounter = 0;
};
} else {
y = (y - ((speed * 4) * _arg4));
};
};
return (totalBonuses);
}
public function startRight(){
if (charDirection != RIGHT){
if (!jumping){
if (!dying){
this.gotoAndStop("walkRight");
};
} else {
if (!dying){
this.gotoAndStop("jumpRight");
};
};
};
charDirection = RIGHT;
}
function inGridSquare(_arg1:Number, _arg2:Number):Boolean{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
_local3 = (_arg1 + (charWidth - 1));
_local4 = _arg2;
_local5 = _arg1;
_local6 = _arg2;
_local7 = (_arg1 + (charWidth - 1));
_local8 = (_arg2 + (charHeight - 1));
_local9 = _arg1;
_local10 = (_arg2 + (charHeight - 1));
if ((((((mainCharMathExt.convertToIndex(_local3, _local4) == mainCharMathExt.convertToIndex(_local5, _local6))) && ((mainCharMathExt.convertToIndex(_local3, _local4) == mainCharMathExt.convertToIndex(_local9, _local10))))) && ((mainCharMathExt.convertToIndex(_local3, _local4) == mainCharMathExt.convertToIndex(_local7, _local8))))){
return (true);
};
return (false);
}
public function getScore(){
return (score);
}
public function stopRight(){
if (!dying){
this.gotoAndStop("standRight");
};
charDirection = STATIC_RIGHT;
}
public function setScore(_arg1:int){
score = _arg1;
}
public function stopLeft(){
if (!dying){
this.gotoAndStop("standLeft");
};
charDirection = STATIC_LEFT;
}
public function stopJump(){
jumping = false;
jumpPressed = false;
}
public function kill(){
mainCharMathExt = null;
}
public function startLeft(){
if (charDirection != LEFT){
if (!jumping){
if (!dying){
this.gotoAndStop("walkLeft");
};
} else {
if (!dying){
this.gotoAndStop("jumpLeft");
};
};
};
charDirection = LEFT;
}
public function startJump(){
if ((((((((jumping == false)) && ((jumpPressed == false)))) && ((jumpPoint == 0)))) && ((falling == false)))){
if ((((charDirection == RIGHT)) || ((charDirection == STATIC_RIGHT)))){
if (!dying){
jump1.play();
this.gotoAndStop("jumpRight");
};
} else {
if ((((charDirection == LEFT)) || ((charDirection == STATIC_LEFT)))){
if (!dying){
jump1.play();
this.gotoAndStop("jumpLeft");
};
};
};
jumping = true;
jumpPressed = true;
jumpBaseY = y;
};
}
function updateCorners(){
var _local1:int;
charGridXs = new Array();
charGridYs = new Array();
topRightX = (prospectiveX + (charWidth - 1));
topRightY = prospectiveY;
topLeftX = prospectiveX;
topLeftY = prospectiveY;
bottomRightX = (prospectiveX + (charWidth - 1));
bottomRightY = (prospectiveY + (charHeight - 1));
bottomLeftX = prospectiveX;
bottomLeftY = (prospectiveY + (charHeight - 1));
topRightGridX = int(((topRightX - (topRightX % gridXSize)) / gridXSize));
topRightGridY = int(((topRightY - (topRightY % gridYSize)) / gridYSize));
topLeftGridX = int(((topLeftX - (topLeftX % gridXSize)) / gridXSize));
topLeftGridY = int(((topLeftY - (topLeftY % gridYSize)) / gridYSize));
bottomRightGridX = int(((bottomRightX - (bottomRightX % gridXSize)) / gridXSize));
bottomRightGridY = int(((bottomRightY - (bottomRightY % gridYSize)) / gridYSize));
bottomLeftGridX = int(((bottomLeftX - (bottomLeftX % gridXSize)) / gridXSize));
bottomLeftGridY = int(((bottomLeftY - (bottomLeftY % gridYSize)) / gridYSize));
charGridXs.push(topRightGridX);
charGridYs.push(topRightGridY);
charGridXs.push(bottomRightGridX);
charGridYs.push(bottomRightGridY);
charGridXs.push(topLeftGridX);
charGridYs.push(topLeftGridY);
charGridXs.push(bottomLeftGridX);
charGridYs.push(bottomLeftGridY);
if ((topRightGridX - topLeftGridX) > 1){
_local1 = (topLeftGridX + 1);
while (_local1 < topRightGridX) {
charGridXs.push(_local1);
charGridYs.push(topLeftGridY);
_local1++;
};
};
if ((bottomRightGridX - bottomLeftGridX) > 1){
_local1 = (bottomLeftGridX + 1);
while (_local1 < bottomRightGridX) {
charGridXs.push(_local1);
charGridYs.push(bottomLeftGridY);
_local1++;
};
};
if ((bottomLeftGridY - topLeftGridY) > 1){
_local1 = (topLeftGridY + 1);
while (_local1 < bottomLeftGridY) {
charGridXs.push(topLeftGridX);
charGridYs.push(_local1);
_local1++;
};
};
if ((bottomRightGridY - topRightGridY) > 1){
_local1 = (topRightGridY + 1);
while (_local1 < bottomRightGridY) {
charGridXs.push(topRightGridX);
charGridYs.push(_local1);
_local1++;
};
};
}
}
}//package
Section 30
//mathExt (mathExt)
package {
public class mathExt {
var gridWidth:int;
var gridHeight:int;
public function mathExt(_arg1:int, _arg2:int){
gridWidth = _arg1;
gridHeight = _arg2;
}
public function convertToIndex(_arg1:int, _arg2:int){
return (((_arg2 * gridWidth) + _arg1));
}
public function convertToX(_arg1:int){
return ((_arg1 % gridWidth));
}
public function convertToY(_arg1:int){
return (((_arg1 - (_arg1 % gridWidth)) / gridWidth));
}
}
}//package
Section 31
//musicSound (musicSound)
package {
import flash.media.*;
public dynamic class musicSound extends Sound {
}
}//package
Section 32
//readOut (readOut)
package {
import flash.display.*;
import flash.text.*;
public dynamic class readOut extends MovieClip {
public var timerText:TextField;
public var scoreText:TextField;
}
}//package
Section 33
//rightConveyorLeft (rightConveyorLeft)
package {
import flash.display.*;
public dynamic class rightConveyorLeft extends MovieClip {
}
}//package
Section 34
//rightConveyorMiddle (rightConveyorMiddle)
package {
import flash.display.*;
public dynamic class rightConveyorMiddle extends MovieClip {
}
}//package
Section 35
//rightConveyorRight (rightConveyorRight)
package {
import flash.display.*;
public dynamic class rightConveyorRight extends MovieClip {
}
}//package
Section 36
//spikes (spikes)
package {
public class spikes extends enemy {
public function spikes(){
isStationary = true;
}
}
}//package
Section 37
//spikes2 (spikes2)
package {
public class spikes2 extends spikes {
}
}//package
Section 38
//spikes3 (spikes3)
package {
public class spikes3 extends spikes {
}
}//package
Section 39
//spikes4 (spikes4)
package {
public class spikes4 extends spikes {
}
}//package
Section 40
//titleScreen (titleScreen)
package {
import flash.display.*;
public dynamic class titleScreen extends MovieClip {
public var start:titleScreenStartButton;
}
}//package
Section 41
//titleScreenStartButton (titleScreenStartButton)
package {
import flash.display.*;
public dynamic class titleScreenStartButton extends MovieClip {
}
}//package