Section 1
//AcidBottle (Classes.AcidBottle)
package Classes {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
public class AcidBottle extends BodyParts {
var sound:BottleSound;
var partIndex:Number;// = 0
public function AcidBottle(){
partIndex = 0;
super();
this.figure = new Array(1);
this.figure[0] = [1];
this.figureCenter = new Point(0.5, 0.5);
this.type = "bottle";
sound = new BottleSound();
this.addEventListener("deleteme", deletemeEventHanler);
}
private function deletemeEventHanler(_arg1:Event){
this.removeEventListener("deleteme", deletemeEventHanler);
parent.removeChild(this);
}
override public function rotateMe(_arg1:Number=0):void{
}
override public function stopAnimation(_arg1=null){
this.gotoAndStop((2 + Math.floor((Math.random() * 2))));
if ((this.getChildAt(0) is MovieClip)){
(this.getChildAt(0) as MovieClip).play();
};
this.sound.play();
}
override public function getTLC(_arg1=0):Point{
return (new Point(0, 0));
}
}
}//package Classes
Section 2
//BodyParts (Classes.BodyParts)
package Classes {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
public class BodyParts extends MovieClip {
public var rotationAngle:Number;
var partOfSet:Boolean;
public var figure:Array;
private var movedown:Boolean;
private var moveright:Boolean;
private var rotatingframecount:Number;
public var xT:Number;
private var movespeed:Number;
private var moveup:Boolean;
private var movestep:Number;
protected var clincher:ClincherClass;
private var moveiteration:Number;
var figureIndex:Number;
protected var moving:Boolean;
public var type:String;
private var moveframecount:Number;
private var moveleft:Boolean;
public var figureCenter:Point;
public var torso:Number;
public var yT:Number;
private var movemult:Number;
private var rotatingmult:Number;
private var rotatingiteration:Number;
private var rotating:Boolean;
protected var wasAttached:Boolean;
public var attached:Boolean;
private var rotatingspeed:Number;
public function BodyParts(){
this.rotationAngle = 0;
this.xT = 0;
this.yT = 0;
this.partOfSet = false;
this.moveup = false;
this.movedown = false;
this.moveleft = false;
this.moveright = false;
this.movespeed = 0;
this.movestep = 0;
this.moveframecount = 0;
this.moveiteration = 0;
this.movemult = 1;
this.rotating = true;
this.rotatingspeed = 0;
this.rotatingframecount = 0;
this.rotatingiteration = 0;
this.rotatingmult = 1;
attached = false;
wasAttached = false;
moving = false;
torso = -1;
this.stop();
this.addEventListener(Event.ENTER_FRAME, enterFrameEventHandler);
}
public function sendFigureMatrixToOutput():void{
var _local1:Number;
var _local2:Number;
var _local3:Array;
_local2 = 0;
while (_local2 < this.figure[0].length) {
_local3 = new Array();
_local1 = 0;
while (_local1 < this.figure.length) {
_local3.push(this.figure[_local1][_local2]);
_local1++;
};
trace(_local3);
_local2++;
};
}
public function unattach(){
if (attached){
if (clincher != null){
removeChild(clincher);
};
};
}
public function rotateMatrix(_arg1=0):Array{
var _local2:Array;
var _local3:Array;
var _local4:Number;
var _local5:Number;
_local2 = new Array();
if ((this.figure is Array)){
if (_arg1 == 0){
_local4 = 0;
while (_local4 < this.figure.length) {
_local2.push(this.figure[_local4].slice());
_local4++;
};
};
if (_arg1 == 90){
_local5 = (this.figure[0].length - 1);
while (_local5 >= 0) {
_local3 = new Array();
_local4 = 0;
while (_local4 < this.figure.length) {
_local3.push(this.figure[_local4][_local5]);
_local4++;
};
_local2.push(_local3);
_local5--;
};
};
if ((((_arg1 == 180)) || ((_arg1 == -180)))){
_local4 = (this.figure.length - 1);
while (_local4 >= 0) {
_local2.push(this.figure[_local4].slice().reverse());
_local4--;
};
};
if (_arg1 == -90){
_local5 = 0;
while (_local5 < this.figure[0].length) {
_local2[_local5] = new Array();
_local4 = (this.figure.length - 1);
while (_local4 >= 0) {
_local2[_local5].push(this.figure[_local4][_local5]);
_local4--;
};
_local5++;
};
};
};
return (_local2);
}
public function attach(_arg1:Boolean=false){
}
public function rotateMe(_arg1:Number=0):void{
if (this.rotationAngle == 180){
this.rotation = -180;
this.rotationAngle = -90;
} else {
this.rotationAngle = (this.rotationAngle + 90);
};
}
public function moveMe(_arg1:String, _arg2:Number, _arg3:Number=0):void{
if (_arg1 == "down"){
this.yT = (this.yT + _arg2);
moving = true;
};
if (_arg1 == "left"){
this.xT = (this.xT - _arg2);
moving = true;
};
if (_arg1 == "right"){
this.xT = (this.xT + _arg2);
moving = true;
};
}
public function stopAnimation(_arg1=null){
this.removeEventListener(Event.ENTER_FRAME, enterFrameEventHandler);
this.stop();
}
public function getTLC(_arg1=0):Point{
var _local2:Point;
_local2 = new Point(0, 0);
return (_local2);
}
protected function enterFrameEventHandler(_arg1:Event):void{
if (Math.abs((this.rotation - this.rotationAngle)) >= 1){
this.rotation = (this.rotation + (Math.abs((this.rotation - this.rotationAngle)) / 3));
} else {
this.rotation = this.rotationAngle;
};
moving = true;
if (this.xT < this.x){
this.x = (this.x - (Math.abs((this.xT - this.x)) / 3));
};
if (this.yT < this.y){
this.y = (this.y - (Math.abs((this.yT - this.y)) / 3));
};
if (this.xT > this.x){
this.x = (this.x + (Math.abs((this.xT - this.x)) / 3));
};
if (this.yT > this.y){
this.y = (this.y + (Math.abs((this.yT - this.y)) / 3));
};
if (Math.abs((this.xT - this.x)) <= 1){
this.x = this.xT;
};
if (Math.abs((this.yT - this.y)) <= 1){
this.y = this.yT;
};
if (torso != -1){
if ((((((((Math.abs((this.xT - this.x)) <= 1)) && ((Math.abs((this.yT - this.y)) <= 1)))) && (!((torso == -1))))) && ((Math.abs(((parent as GameClass).parts[torso].yT - (parent as GameClass).parts[torso].y)) <= 1)))){
moving = false;
};
};
if (((((attached) && (!(moving)))) && (!(wasAttached)))){
attach();
wasAttached = true;
};
if (((((!(attached)) || (moving))) && (wasAttached))){
unattach();
wasAttached = false;
};
}
}
}//package Classes
Section 3
//BottleSound (Classes.BottleSound)
package Classes {
import flash.media.*;
public class BottleSound extends Sound {
}
}//package Classes
Section 4
//ClincherClass (Classes.ClincherClass)
package Classes {
import flash.display.*;
import flash.filters.*;
public class ClincherClass extends MovieClip {
public function ClincherClass(){
addFrameScript(10, frame11);
filters = [new GlowFilter(0, 1, 5, 5, 2)];
}
function frame11(){
stop();
}
}
}//package Classes
Section 5
//FrankieAnimation (Classes.FrankieAnimation)
package Classes {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
public class FrankieAnimation extends Sprite {
public var rotationAngle:Number;
public var yT:Number;
private var animation:Boolean;
private var param:Number;
private var targetAngle:Number;
private var lightning;
public var xT:Number;
public function FrankieAnimation(){
animation = false;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function stopMe():void{
var _local1:Number;
animation = false;
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
_local1 = 0;
while (_local1 < numChildren) {
(getChildAt(_local1) as BodyParts).stopAnimation();
_local1++;
};
parent.removeChild(this);
}
public function startAnimation(_arg1:Number):void{
targetAngle = _arg1;
if (Math.floor((Math.random() * 2)) == 0){
lightning = new LightningClass();
} else {
lightning = new Lightning2Class();
};
lightning.x = globalToLocal(new Point(x, y)).x;
lightning.y = globalToLocal(new Point(x, y)).y;
this.addChild(lightning);
addEventListener("lightningend", lightningEnd);
addEventListener("lightning2end", lightningEnd);
(lightning as MovieClip).filters = [new GlowFilter(0xFFFFFF, 1, 13, 13, 2), new GlowFilter(7845375, 1, 100, 100, 5)];
lightning.play();
}
private function lightningEnd(_arg1:Event){
var _local2:*;
rotation = targetAngle;
animation = true;
param = 0;
rotationAngle = rotation;
_local2 = 0;
while (_local2 < this.numChildren) {
if ((getChildAt(_local2) is BodyParts)){
(getChildAt(_local2) as BodyParts).attach(true);
};
_local2++;
};
removeEventListener("lightningend", lightningEnd);
removeEventListener("lightning2end", lightningEnd);
}
private function onEnterFrame(_arg1:Event):void{
if (animation){
x = (x + 20);
rotation = (rotationAngle + (Math.sin(param) * 15));
param = (param + (3 / Math.PI));
};
if ((((((((this.x < -100)) || ((this.x > 640)))) || ((this.y < -100)))) || ((this.y > 530)))){
this.stopMe();
};
}
}
}//package Classes
Section 6
//FrankieSound (Classes.FrankieSound)
package Classes {
import flash.media.*;
public class FrankieSound extends Sound {
}
}//package Classes
Section 7
//GameClass (Classes.GameClass)
package Classes {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.text.*;
import flash.utils.*;
public class GameClass extends MovieClip {
var frankies:Number;
var intervalIndex:uint;
var pauseScreen:PauseScreen;
var bodyPartsTypesCount;// = 10
var position:Number;// = 0
var paused:Boolean;
var gameMusicChannel:SoundChannel;
var wasAccelerationStarted:Boolean;
var nextPartScreen:NextPartScreen;
private var mult:Number;// = 50
private var iter:Number;// = 10
var gameGrid:GameGrid;
var speed:Number;
var gameMusic:GameMusic;
var started:Boolean;
var scoreField:TextField;
var acceleration:Boolean;
var haveActivePart:Boolean;
var nextParts:Array;
var partsOnGrid:Array;
var sprite:FrankieAnimation;
var gameover:Boolean;
var gameoverScreen:GameOver;
var parts:Array;
var score:Number;
public static const GAME_OVER:String = "gameover";
public static const GAME_PAUSE:String = "gamepause";
public static const PART_NEW:String = "partnew";
public static const GAME_START:String = "gamestart";
public static const PART_LANDED:String = "partlanded";
public static const HAVE_FRANKIE:String = "havefrankie";
public function GameClass(){
var _local1:Number;
bodyPartsTypesCount = 10;
position = 0;
mult = 50;
iter = 10;
super();
this.addEventListener(GameConfig.PART_NEW, partNewEventHandler);
this.addEventListener(GameConfig.PART_LANDED, partLandedEventHandler);
this.pauseScreen = new PauseScreen();
this.gameoverScreen = new GameOver();
this.nextPartScreen = new NextPartScreen();
this.speed = 1500;
this.paused = false;
this.score = 0;
this.frankies = 0;
this.haveActivePart = false;
this.gameover = false;
this.acceleration = false;
this.wasAccelerationStarted = false;
if (this.gameGrid == null){
this.gameGrid = new GameGrid();
this.addChild(this.gameGrid);
};
if (this.parts == null){
this.parts = new Array();
} else {
this.parts.splice(0, this.parts.length);
};
if (this.nextParts == null){
this.nextParts = new Array();
} else {
this.nextParts.splice(0, this.nextParts.length);
};
if (this.partsOnGrid == null){
this.partsOnGrid = new Array();
};
this.partsOnGrid.splice(0, this.partsOnGrid.length);
_local1 = 0;
while (_local1 < this.bodyPartsTypesCount) {
this.partsOnGrid.push(0);
_local1++;
};
this.nextPartScreen.x = 82;
this.nextPartScreen.y = 95;
this.addChild(this.nextPartScreen);
this.started = true;
this.gameMusic = new GameMusic();
this.gameMusicChannel = this.gameMusic.play(0, 10000);
this.dispatchEvent(new Event(GameConfig.PART_NEW, true));
}
private function getNextParts(_arg1:Number=0):Array{
var _local2:Number;
var _local3:Number;
var _local4:Array;
var _local5:Array;
var _local6:Number;
_local3 = ((Math.floor((this.score / 3)))>0) ? 2 : 0;
_local2 = (6 + _local3);
_local4 = new Array(_local2);
_local5 = new Array(_local2);
_local6 = 0;
while (_local6 < _local2) {
_local5[_local6] = false;
_local6++;
};
_local6 = 0;
while (_local6 < _local2) {
_local4[_local6] = Math.floor((Math.random() * _local2));
while (_local5[_local4[_local6]]) {
_local4[_local6] = Math.floor((Math.random() * _local2));
};
_local5[_local4[_local6]] = true;
if (_local4[_local6] == 1){
_local4[_local6] = ((Math.floor((Math.random() * 2)))==0) ? 1 : 5;
} else {
if ((((_local4[_local6] == 2)) || ((_local4[_local6] == 5)))){
_local4[_local6] = ((Math.floor((Math.random() * 2)))==0) ? 2 : 6;
} else {
if (_local4[_local6] == 3){
_local4[_local6] = ((Math.floor((Math.random() * 2)))==0) ? 3 : 7;
} else {
if (_local4[_local6] == 4){
_local4[_local6] = ((Math.floor((Math.random() * 2)))==0) ? 4 : 8;
} else {
if (_local4[_local6] >= 6){
if ((_local4[_local6] % 2) == 0){
_local4[_local6] = Math.floor((Math.random() * 9));
} else {
_local4[_local6] = 9;
};
};
};
};
};
};
_local6++;
};
return (_local4);
}
private function moveLastFigureDown(){
var _local1:Number;
var _local2:Number;
var _local3:Array;
var _local4:Point;
if (this.haveActivePart){
if (this.parts.length > 0){
_local1 = (this.parts.length - 1);
_local2 = this.parts[_local1].rotationAngle;
_local4 = new Point(0, 0);
_local3 = this.parts[_local1].rotateMatrix(_local2);
_local4 = this.gameGrid.getCellGridCoordinates((this.parts[_local1].xT + (this.parts[_local1].getTLC(_local2).x * this.gameGrid.cellSize)), (this.parts[_local1].yT + (this.parts[_local1].getTLC(_local2).y * this.gameGrid.cellSize)));
if (this.gameGrid.moveTest(_local3, _local4, _local1, "down")){
this.parts[_local1].moveMe("down", this.gameGrid.cellSize);
_local4.y++;
this.gameGrid.removeFromGrid(_local1);
this.gameGrid.putOnGrid(_local3, _local1, _local4);
} else {
this.dispatchEvent(new Event(PART_LANDED));
};
};
};
}
public function pauseMe(){
if (this.started){
if (this.paused){
this.paused = false;
this.removeChild(this.pauseScreen);
} else {
this.paused = true;
this.addChild(this.pauseScreen);
};
};
}
private function toSortArray(_arg1, _arg2):int{
var _local3:Array;
var _local4:Number;
var _local5:Array;
var _local6:Number;
_local3 = _arg1.rotateMatrix(_arg1.rotationAngle);
_local4 = (_arg1.yT + ((_arg1.getTLC(_arg1.rotationAngle).y + _local3[0].length) * this.gameGrid.cellSize));
_local5 = _arg2.rotateMatrix(_arg2.rotationAngle);
_local6 = (_arg2.yT + ((_arg2.getTLC(_arg2.rotationAngle).y + _local5[0].length) * this.gameGrid.cellSize));
if (_local4 > _local6){
return (1);
};
if (_local4 < _local6){
return (-1);
};
if ((_arg1.yT + (_arg1.getTLC(_arg1.rotationAngle).y * this.gameGrid.cellSize)) > (_arg2.yT + (_arg2.getTLC(_arg2.rotationAngle).y * this.gameGrid.cellSize))){
return (1);
};
if ((_arg1.yT + (_arg1.getTLC(_arg1.rotationAngle).y * this.gameGrid.cellSize)) < (_arg2.yT + (_arg2.getTLC(_arg2.rotationAngle).y * this.gameGrid.cellSize))){
return (-1);
};
return (0);
}
public function stopMe(){
var _local1:Number;
if (this.paused){
this.removeChild(this.pauseScreen);
this.paused = true;
};
if (this.gameMusicChannel != null){
this.gameMusicChannel.stop();
};
_local1 = 0;
while (_local1 < this.parts.length) {
this.parts[_local1].stopAnimation();
_local1++;
};
this.removeEventListener(GameConfig.PART_NEW, partNewEventHandler);
this.removeEventListener(GameConfig.PART_LANDED, partLandedEventHandler);
this.gameover = true;
this.started = false;
this.gameoverScreen.score.text = String(this.score);
this.addChild(this.gameoverScreen);
}
public function keyDownEventHandler(_arg1:KeyboardEvent){
var _local2:Number;
var _local3:Number;
var _local4:Array;
var _local5:Point;
if (((((this.haveActivePart) && (!(this.paused)))) && (this.started))){
_local2 = (this.parts.length - 1);
_local3 = this.parts[_local2].rotationAngle;
_local5 = new Point(0, 0);
if (_arg1.keyCode == 37){
_local4 = this.parts[_local2].rotateMatrix(_local3);
_local5 = this.gameGrid.getCellGridCoordinates((this.parts[_local2].xT + (this.parts[_local2].getTLC(_local3).x * this.gameGrid.cellSize)), (this.parts[_local2].yT + (this.parts[_local2].getTLC(_local3).y * this.gameGrid.cellSize)));
if (this.gameGrid.moveTest(_local4, _local5, _local2, "left")){
this.parts[_local2].moveMe("left", this.gameGrid.cellSize);
_local5.x--;
this.gameGrid.removeFromGrid(_local2);
this.gameGrid.putOnGrid(_local4, _local2, _local5);
};
};
if (_arg1.keyCode == 38){
_local4 = this.parts[_local2].rotateMatrix(((_local3)==180) ? -90 : (_local3 + 90));
_local5 = this.gameGrid.getCellGridCoordinates((this.parts[_local2].xT + (this.parts[_local2].getTLC(((_local3)==180) ? -90 : (_local3 + 90)).x * this.gameGrid.cellSize)), (this.parts[_local2].yT + (this.parts[_local2].getTLC(((_local3)==180) ? -90 : (_local3 + 90)).y * this.gameGrid.cellSize)));
if (this.gameGrid.moveTest(_local4, _local5, _local2, "here")){
this.parts[_local2].rotateMe();
this.gameGrid.removeFromGrid(_local2);
this.gameGrid.putOnGrid(_local4, _local2, _local5);
};
};
if (_arg1.keyCode == 39){
_local4 = this.parts[_local2].rotateMatrix(_local3);
_local5 = this.gameGrid.getCellGridCoordinates((this.parts[_local2].xT + (this.parts[_local2].getTLC(_local3).x * this.gameGrid.cellSize)), (this.parts[_local2].yT + (this.parts[_local2].getTLC(_local3).y * this.gameGrid.cellSize)));
if (this.gameGrid.moveTest(_local4, _local5, _local2, "right")){
this.parts[_local2].moveMe("right", this.gameGrid.cellSize);
_local5.x++;
this.gameGrid.removeFromGrid(_local2);
this.gameGrid.putOnGrid(_local4, _local2, _local5);
};
};
if (_arg1.keyCode == 40){
if (!wasAccelerationStarted){
this.acceleration = true;
wasAccelerationStarted = true;
};
if (this.acceleration){
this.moveLastFigureDown();
};
};
};
if ((((_arg1.keyCode == 80)) || ((_arg1.keyCode == 32)))){
this.dispatchEvent(new Event(GameConfig.GAME_PAUSE, true));
};
if (_arg1.keyCode == 27){
this.dispatchEvent(new Event(GameConfig.GAME_OVER, true));
};
}
private function partNewEventHandler(_arg1:Event){
var _local2:*;
var _local3:Number;
var _local4:Point;
if (((!(this.haveActivePart)) && (this.started))){
if (this.nextParts.length <= 1){
if (this.nextParts.length == 0){
this.nextParts = this.getNextParts();
} else {
this.nextParts = this.nextParts.concat(this.getNextParts());
};
};
_local3 = this.nextParts.shift();
this.nextPartScreen.gotoAndStop((this.nextParts[0] + 1));
var _local5 = this.partsOnGrid;
var _local6 = _local3;
var _local7 = (_local5[_local6] + 1);
_local5[_local6] = _local7;
if (_local3 == 0){
_local2 = new HeadPart();
};
if (_local3 == 1){
_local2 = new TorsoPart();
};
if (_local3 == 2){
_local2 = new HandPart();
};
if (_local3 == 3){
_local2 = new LegPart();
};
if (_local3 == 4){
_local2 = new Leg2Part();
};
if (_local3 == 5){
_local2 = new TorsoSmallPart();
};
if (_local3 == 6){
_local2 = new HandSmallPart();
};
if (_local3 == 7){
_local2 = new LegSmallPart();
};
if (_local3 == 8){
_local2 = new Leg2SmallPart();
};
if (_local3 == 9){
_local2 = new AcidBottle();
};
if (_local2 != null){
this.acceleration = false;
_local2.x = (this.gameGrid.gridStartX + (((Math.floor((this.gameGrid.gridWidth / 2)) - 1) + _local2.figureCenter.x) * this.gameGrid.cellSize));
_local2.xT = _local2.x;
_local2.y = (this.gameGrid.gridStartY + (_local2.figureCenter.y * this.gameGrid.cellSize));
_local2.yT = _local2.y;
_local4 = this.gameGrid.getCellGridCoordinates((_local2.xT + (_local2.getTLC().x * this.gameGrid.cellSize)), (_local2.yT + (_local2.getTLC().y * this.gameGrid.cellSize)));
if (this.gameGrid.moveTest(_local2.figure, _local4, this.parts.length, "here")){
this.parts.push(_local2);
this.parts[(this.parts.length - 1)].figureIndex = (this.parts.length - 1);
this.gameGrid.putOnGrid(_local2.figure, (this.parts.length - 1), _local4);
this.addChild(this.parts[(this.parts.length - 1)]);
this.haveActivePart = true;
this.intervalIndex = setInterval(moveLastFigureDown, this.speed);
} else {
this.dispatchEvent(new Event(GAME_OVER));
};
} else {
trace("Error: could not create a body part object");
};
};
}
private function partLandedEventHandler(_arg1:Event=null){
var _local2:Boolean;
var _local3:Boolean;
var _local4:Boolean;
var _local5:Boolean;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Array;
var _local11:Point;
var _local12:Point;
var _local13:*;
var _local14:Number;
var _local15:Array;
var _local16:*;
var _local17:Point;
var _local18:Array;
_local2 = false;
_local3 = false;
_local4 = false;
if (this.haveActivePart){
clearInterval(this.intervalIndex);
this.haveActivePart = false;
_local8 = (this.parts.length - 1);
if (this.parts[_local8].type == "bottle"){
_local12 = this.gameGrid.getCellGridCoordinates(this.parts[_local8].xT, this.parts[_local8].yT);
_local6 = _local8;
this.gameGrid.removeFromGrid(_local6);
if (_local12.y < (this.gameGrid.gridHeight - 1)){
this.removeChild(this.parts[_local6]);
this.parts.pop();
_local6 = this.gameGrid.getCellState(_local12.x, (_local12.y + 1));
this.parts[_local6].stopAnimation();
this.removeChild(this.parts[_local6]);
this.gameGrid.removeFromGrid(_local6, "bottlemagic");
if (parts[_local6].type == "torso"){
_local7 = 0;
while (_local7 < this.parts.length) {
if (parts[_local7].torso == _local6){
parts[_local7].torso = -1;
};
_local7++;
};
};
delete this.parts[_local6];
this.parts.splice(_local6, 1);
_local6 = 0;
while (_local6 < this.parts.length) {
this.gameGrid.replaceOnGrid(this.parts[_local6].figureIndex, _local6);
this.parts[_local6].figureIndex = _local6;
_local6++;
};
_local2 = true;
} else {
this.parts[_local6].stopAnimation();
this.parts.pop();
};
_local3 = true;
} else {
_local14 = Math.floor(((Math.random() * 4) + 1));
if (_local14 == 1){
_local13 = new PartSound1();
};
if (_local14 == 2){
_local13 = new PartSound2();
};
if (_local14 == 3){
_local13 = new PartSound3();
};
if (_local14 == 4){
_local13 = new PartSound4();
};
_local13.play();
};
};
_local5 = false;
if (!_local3){
_local6 = 0;
while (_local6 < this.parts.length) {
if (this.parts[_local6].type == "torso"){
_local15 = this.checkTorso(_local6);
if (_local15.length > 0){
_local7 = 0;
while (_local7 < _local15.length) {
_local5 = true;
this.parts[_local15[_local7]].partOfSet = true;
this.parts[_local15[_local7]].torso = -1;
_local7++;
};
_local16 = (0 - (this.parts[_local15[1]] as HeadPart).rotationAngle);
_local17 = new Point(this.parts[_local15[0]].xT, this.parts[_local15[0]].yT);
sprite = new FrankieAnimation();
sprite.xT = _local17.x;
sprite.x = _local17.x;
sprite.yT = _local17.y;
sprite.y = _local17.y;
sprite.rotationAngle = 0;
sprite.rotation = 0;
_local7 = 0;
while (_local7 < _local15.length) {
this.removeChild(this.parts[_local15[_local7]]);
this.parts[_local15[_local7]].xT = (this.parts[_local15[_local7]].xT - _local17.x);
this.parts[_local15[_local7]].x = (this.parts[_local15[_local7]].x - _local17.x);
this.parts[_local15[_local7]].yT = (this.parts[_local15[_local7]].yT - _local17.y);
this.parts[_local15[_local7]].y = (this.parts[_local15[_local7]].y - _local17.y);
sprite.addChild(this.parts[_local15[_local7]]);
_local7++;
};
this.addChild(sprite);
sprite.startAnimation(_local16);
this.haveFrankie((_local15.length - 2));
};
};
_local6++;
};
};
if (_local5){
_local6 = 0;
_local7 = -1;
while (_local6 < this.parts.length) {
_local7++;
if (this.parts[_local6].partOfSet == false){
_local6++;
} else {
this.gameGrid.removeFromGrid(_local7);
delete this.parts[_local6];
this.parts.splice(_local6, 1);
};
};
_local6 = 0;
while (_local6 < this.parts.length) {
this.gameGrid.replaceOnGrid(this.parts[_local6].figureIndex, _local6);
this.parts[_local6].figureIndex = _local6;
_local6++;
};
_local2 = true;
};
if (_local2){
_local18 = this.parts.slice();
_local18.sort(toSortArray, Array.DESCENDING);
_local6 = 0;
while (_local6 < this.parts.length) {
_local8 = _local18[_local6].figureIndex;
_local9 = this.parts[_local8].rotationAngle;
_local10 = this.parts[_local8].rotateMatrix(_local9);
_local11 = this.gameGrid.getCellGridCoordinates((this.parts[_local8].xT + (this.parts[_local8].getTLC(_local9).x * this.gameGrid.cellSize)), (this.parts[_local8].yT + (this.parts[_local8].getTLC(_local9).y * this.gameGrid.cellSize)));
while (this.gameGrid.moveTest(_local10, _local11, _local8, "down")) {
this.parts[_local8].moveMe("down", this.gameGrid.cellSize);
_local11.y++;
this.gameGrid.removeFromGrid(_local8);
this.gameGrid.putOnGrid(_local10, _local8, _local11);
};
_local6++;
};
_local4 = true;
};
if (_local4){
this.partLandedEventHandler();
return;
};
if (this.parts.length > 0){
_local8 = (this.parts.length - 1);
_local9 = this.parts[_local8].rotationAngle;
_local11 = this.gameGrid.getCellGridCoordinates((this.parts[_local8].xT + (this.parts[_local8].getTLC(_local9).x * this.gameGrid.cellSize)), (this.parts[_local8].yT + (this.parts[_local8].getTLC(_local9).y * this.gameGrid.cellSize)));
if (_local11.y < 4){
this.dispatchEvent(new Event(GAME_OVER, true));
} else {
this.dispatchEvent(new Event(PART_NEW));
};
} else {
this.dispatchEvent(new Event(PART_NEW));
};
}
private function haveFrankie(_arg1:Number):void{
var _local2:ThunderSound;
this.score = (this.score + (100 + ((_arg1 * (10 + (_arg1 * 10))) / 2)));
this.frankies++;
_local2 = new ThunderSound();
_local2.play();
this.gameGrid.score.text = String(this.score);
this.gameGrid.level.text = String((Math.floor((this.frankies / 5)) + 1));
this.gameGrid.frankies.text = String(this.frankies);
if ((this.frankies % 5) == 0){
if (this.speed > 100){
this.speed = Math.floor((this.speed * 0.7));
};
};
}
public function keyUpEventHandler(_arg1:KeyboardEvent){
if (_arg1.keyCode == 40){
this.wasAccelerationStarted = false;
trace("acceleration stopped");
};
}
private function checkTorso(_arg1:Number):Array{
var _local2:Array;
var _local3:Point;
var _local4:Point;
var _local5:Array;
var _local6:Array;
var _local7:Array;
var _local8:Boolean;
var _local9:Boolean;
var _local10:Boolean;
var _local11:Number;
var _local12:Number;
_local2 = new Array();
if (this.parts[_arg1].type == "torso"){
_local3 = this.parts[_arg1].getTLC(this.parts[_arg1].rotationAngle);
_local3.x = (this.parts[_arg1].xT + (_local3.x * this.gameGrid.cellSize));
_local3.y = (this.parts[_arg1].yT + (_local3.y * this.gameGrid.cellSize));
_local4 = this.gameGrid.getCellGridCoordinates(_local3.x, _local3.y);
_local5 = this.parts[_arg1].rotateMatrix(this.parts[_arg1].rotationAngle);
_local6 = new Array();
_local6["head"] = new Array();
_local6["hands"] = new Array();
_local6["legs"] = new Array();
_local7 = new Array();
_local8 = false;
_local9 = false;
_local10 = false;
if (_local4.y > 0){
_local11 = _local4.x;
while (_local11 < (_local4.x + _local5.length)) {
if (this.gameGrid.grid[_local11][(_local4.y - 1)] != -1){
if (!this.parts[this.gameGrid.grid[_local11][(_local4.y - 1)]].partOfSet){
switch (this.parts[this.gameGrid.grid[_local11][(_local4.y - 1)]].type){
case "head":
if ((((this.parts[this.gameGrid.grid[_local11][(_local4.y - 1)]].rotationAngle == 0)) && ((((((_local11 > _local4.x)) && ((this.gameGrid.grid[(_local11 - 1)][(_local4.y - 1)] == this.gameGrid.grid[_local11][(_local4.y - 1)])))) || ((((_local11 == _local4.x)) && ((this.gameGrid.grid[(_local11 + 1)][(_local4.y - 1)] == this.gameGrid.grid[_local11][(_local4.y - 1)])))))))){
_local7.push(this.gameGrid.grid[_local11][(_local4.y - 1)]);
};
break;
case "hand":
if (this.parts[this.gameGrid.grid[_local11][(_local4.y - 1)]].rotationAngle == 180){
_local7.push(this.gameGrid.grid[_local11][(_local4.y - 1)]);
};
break;
case "leg":
if (this.parts[this.gameGrid.grid[_local11][(_local4.y - 1)]].rotationAngle == 180){
_local3 = this.parts[this.gameGrid.grid[_local11][(_local4.y - 1)]].getTLC(this.parts[this.gameGrid.grid[_local11][(_local4.y - 1)]].rotationAngle);
_local3.x = (this.parts[this.gameGrid.grid[_local11][(_local4.y - 1)]].xT + (_local3.x * this.gameGrid.cellSize));
_local3.y = (this.parts[this.gameGrid.grid[_local11][(_local4.y - 1)]].yT + (_local3.y * this.gameGrid.cellSize));
_local3 = this.gameGrid.getCellGridCoordinates(_local3.x, _local3.y);
if ((_local3.y + this.parts[this.gameGrid.grid[_local11][(_local4.y - 1)]].rotateMatrix(this.parts[this.gameGrid.grid[_local11][(_local4.y - 1)]].rotationAngle)[0].length) == _local4.y){
_local7.push(this.gameGrid.grid[_local11][(_local4.y - 1)]);
};
};
break;
};
};
};
_local11++;
};
};
if ((_local4.x + _local5.length) < this.gameGrid.gridWidth){
_local12 = _local4.y;
while (_local12 < (_local4.y + _local5[0].length)) {
if (this.gameGrid.grid[(_local4.x + _local5.length)][_local12] != -1){
if (!this.parts[this.gameGrid.grid[(_local4.x + _local5.length)][_local12]].partOfSet){
switch (this.parts[this.gameGrid.grid[(_local4.x + _local5.length)][_local12]].type){
case "head":
if (this.parts[this.gameGrid.grid[(_local4.x + _local5.length)][_local12]].rotationAngle == 90){
if ((((((_local12 > _local4.y)) && ((this.gameGrid.grid[(_local4.x + _local5.length)][(_local12 - 1)] == this.gameGrid.grid[(_local4.x + _local5.length)][_local12])))) || ((((_local12 == _local4.y)) && ((this.gameGrid.grid[(_local4.x + _local5.length)][(_local12 + 1)] == this.gameGrid.grid[(_local4.x + _local5.length)][_local12])))))){
_local7.push(this.gameGrid.grid[(_local4.x + _local5.length)][_local12]);
};
};
break;
case "hand":
if (this.parts[this.gameGrid.grid[(_local4.x + _local5.length)][_local12]].rotationAngle == -90){
_local7.push(this.gameGrid.grid[(_local4.x + _local5.length)][_local12]);
};
break;
case "leg":
if (this.parts[this.gameGrid.grid[(_local4.x + _local5.length)][_local12]].rotationAngle == -90){
_local3 = this.parts[this.gameGrid.grid[(_local4.x + _local5.length)][_local12]].getTLC(this.parts[this.gameGrid.grid[(_local4.x + _local5.length)][_local12]].rotationAngle);
_local3.x = (this.parts[this.gameGrid.grid[(_local4.x + _local5.length)][_local12]].xT + (_local3.x * this.gameGrid.cellSize));
_local3.y = (this.parts[this.gameGrid.grid[(_local4.x + _local5.length)][_local12]].yT + (_local3.y * this.gameGrid.cellSize));
_local3 = this.gameGrid.getCellGridCoordinates(_local3.x, _local3.y);
if (_local3.x == (_local4.x + _local5.length)){
_local7.push(this.gameGrid.grid[(_local4.x + _local5.length)][_local12]);
};
};
break;
};
};
};
_local12++;
};
};
if ((_local4.y + _local5[0].length) < this.gameGrid.gridHeight){
_local11 = _local4.x;
while (_local11 < (_local4.x + _local5.length)) {
if (this.gameGrid.grid[_local11][(_local4.y + _local5[0].length)] != -1){
if (!this.parts[this.gameGrid.grid[_local11][(_local4.y + _local5[0].length)]].partOfSet){
switch (this.parts[this.gameGrid.grid[_local11][(_local4.y + _local5[0].length)]].type){
case "head":
if (this.parts[this.gameGrid.grid[_local11][(_local4.y + _local5[0].length)]].rotationAngle == 180){
if ((((((_local11 > _local4.x)) && ((this.gameGrid.grid[(_local11 - 1)][(_local4.y + _local5[0].length)] == this.gameGrid.grid[_local11][(_local4.y + _local5.length)])))) || ((((_local11 == _local4.x)) && ((this.gameGrid.grid[(_local11 + 1)][(_local4.y + _local5.length)] == this.gameGrid.grid[_local11][(_local4.y + _local5.length)])))))){
_local7.push(this.gameGrid.grid[_local11][(_local4.y + _local5[0].length)]);
};
};
break;
case "hand":
if (this.parts[this.gameGrid.grid[_local11][(_local4.y + _local5[0].length)]].rotationAngle == 0){
_local7.push(this.gameGrid.grid[_local11][(_local4.y + _local5[0].length)]);
};
break;
case "leg":
if (this.parts[this.gameGrid.grid[_local11][(_local4.y + _local5[0].length)]].rotationAngle == 0){
_local3 = this.parts[this.gameGrid.grid[_local11][(_local4.y + _local5[0].length)]].getTLC(this.parts[this.gameGrid.grid[_local11][(_local4.y + _local5[0].length)]].rotationAngle);
_local3.x = (this.parts[this.gameGrid.grid[_local11][(_local4.y + _local5[0].length)]].xT + (_local3.x * this.gameGrid.cellSize));
_local3.y = (this.parts[this.gameGrid.grid[_local11][(_local4.y + _local5[0].length)]].yT + (_local3.y * this.gameGrid.cellSize));
_local3 = this.gameGrid.getCellGridCoordinates(_local3.x, _local3.y);
if (_local3.y == (_local4.y + _local5[0].length)){
_local7.push(this.gameGrid.grid[_local11][(_local4.y + _local5[0].length)]);
};
};
break;
};
};
};
_local11++;
};
};
if (_local4.x > 0){
_local12 = _local4.y;
while (_local12 < (_local4.y + _local5[0].length)) {
if (this.gameGrid.grid[(_local4.x - 1)][_local12] != -1){
if (!this.parts[this.gameGrid.grid[(_local4.x - 1)][_local12]].partOfSet){
switch (this.parts[this.gameGrid.grid[(_local4.x - 1)][_local12]].type){
case "head":
if (this.parts[this.gameGrid.grid[(_local4.x - 1)][_local12]].rotationAngle == -90){
if ((((((_local12 > _local4.y)) && ((this.gameGrid.grid[(_local4.x - 1)][(_local12 - 1)] == this.gameGrid.grid[(_local4.x - 1)][_local12])))) || ((((_local12 == _local4.y)) && ((this.gameGrid.grid[(_local4.x - 1)][(_local12 + 1)] == this.gameGrid.grid[(_local4.x - 1)][_local12])))))){
_local7.push(this.gameGrid.grid[(_local4.x - 1)][_local12]);
};
};
break;
case "hand":
if (this.parts[this.gameGrid.grid[(_local4.x - 1)][_local12]].rotationAngle == 90){
_local7.push(this.gameGrid.grid[(_local4.x - 1)][_local12]);
};
break;
case "leg":
if (this.parts[this.gameGrid.grid[(_local4.x - 1)][_local12]].rotationAngle == 90){
_local3 = this.parts[this.gameGrid.grid[(_local4.x - 1)][_local12]].getTLC(this.parts[this.gameGrid.grid[(_local4.x - 1)][_local12]].rotationAngle);
_local3.x = (this.parts[this.gameGrid.grid[(_local4.x - 1)][_local12]].xT + (_local3.x * this.gameGrid.cellSize));
_local3.y = (this.parts[this.gameGrid.grid[(_local4.x - 1)][_local12]].yT + (_local3.y * this.gameGrid.cellSize));
_local3 = this.gameGrid.getCellGridCoordinates(_local3.x, _local3.y);
if ((_local3.x + this.parts[this.gameGrid.grid[(_local4.x - 1)][_local12]].rotateMatrix(this.parts[this.gameGrid.grid[(_local4.x - 1)][_local12]].rotationAngle).length) == _local4.x){
_local7.push(this.gameGrid.grid[(_local4.x - 1)][_local12]);
};
};
break;
};
};
};
_local12++;
};
};
_local7.sort();
_local11 = 0;
while (_local11 < _local7.length) {
if (this.parts[_local7[_local11]].type == "head"){
if (!_local8){
_local6["head"].push(_local7[_local11]);
_local8 = true;
};
};
if (this.parts[_local7[_local11]].type == "hand"){
_local6["hands"].push(_local7[_local11]);
if (_local6["hands"].length == 2){
_local9 = true;
};
this.parts[_local7[_local11]].attached = true;
this.parts[_local7[_local11]].torso = _arg1;
if (this.getChildIndex(this.parts[_local7[_local11]]) < this.getChildIndex(this.parts[_arg1])){
this.swapChildren(this.parts[_local7[_local11]], this.parts[_arg1]);
};
};
if (this.parts[_local7[_local11]].type == "leg"){
_local6["legs"].push(_local7[_local11]);
if (_local6["legs"].length == 2){
_local10 = true;
};
this.parts[_local7[_local11]].attached = true;
this.parts[_local7[_local11]].torso = _arg1;
if (this.getChildIndex(this.parts[_local7[_local11]]) < this.getChildIndex(this.parts[_arg1])){
this.swapChildren(this.parts[_local7[_local11]], this.parts[_arg1]);
};
};
_local11++;
};
if (_local8){
_local2.push(_arg1);
_local2.push(_local6["head"][0]);
_local11 = 0;
while (_local11 < _local6["hands"].length) {
_local2.push(_local6["hands"][_local11]);
_local11++;
};
_local11 = 0;
while (_local11 < _local6["legs"].length) {
_local2.push(_local6["legs"][_local11]);
_local11++;
};
};
};
return (_local2);
}
}
}//package Classes
Section 8
//GameConfig (Classes.GameConfig)
package Classes {
public class GameConfig {
public static const GAME_OVER:String = "gameover";
public static const GAME_PAUSE:String = "gamepause";
public static const PART_NEW:String = "partnew";
public static const GAME_START:String = "gamestart";
public static const PART_LANDED:String = "partlanded";
public static const HAVE_FRANKIE:String = "havefrankie";
}
}//package Classes
Section 9
//GameGrid (Classes.GameGrid)
package Classes {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
public dynamic class GameGrid extends MovieClip {
public var frankies:TextField;
public var gridHeight:Number;
public var gridStartX:Number;
public var gridStartY:Number;
public var gridWidth:Number;
public var prof:MovieClip;
var grid:Array;
public var cellSize:Number;
public var level:TextField;
public var score:TextField;
public function GameGrid(){
this.cellSize = 21;
this.gridStartX = 166;
this.gridStartY = 68;
this.gridWidth = 10;
this.gridHeight = 16;
this.x = this.gridStartX;
this.y = this.gridStartY;
this.resetField();
this.score.text = "0";
this.level.text = "1";
this.frankies.text = "0";
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function getCellCoordinates(_arg1:Number, _arg2:Number):Point{
var _local3:Point;
_local3 = new Point(0, 0);
_local3.x = (this.gridStartX + (_arg1 * this.cellSize));
_local3.y = (this.gridStartY + (_arg2 * this.cellSize));
return (_local3);
}
public function moveTest(_arg1:Array, _arg2:Point, _arg3:Number=-1, _arg4:String="here"):Boolean{
var _local5:Boolean;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
_local5 = true;
if ((_arg1 is Array)){
_local6 = _arg1.length;
_local7 = 0;
if ((((_local6 > 0)) && ((_arg1[0] is Array)))){
_local7 = _arg1[0].length;
} else {
return (false);
};
if (_arg4 == "up"){
};
if (_arg4 == "left"){
if (_arg2.x > 0){
_local8 = (_arg2.x - 1);
while (_local8 < ((_arg2.x - 1) + _local6)) {
if ((_arg1[((_local8 - _arg2.x) + 1)] is Array)){
_local9 = _arg2.y;
while (_local9 < (_arg2.y + _local7)) {
if (((((!((_arg1[((_local8 - _arg2.x) + 1)][(_local9 - _arg2.y)] == 0))) && (!((this.grid[_local8][_local9] == -1))))) && (!((this.grid[_local8][_local9] == _arg3))))){
return (false);
};
_local9++;
};
} else {
return (false);
};
_local8++;
};
} else {
return (false);
};
};
if (_arg4 == "right"){
if ((_arg2.x + _local6) < this.gridWidth){
_local8 = (_arg2.x + 1);
while (_local8 < ((_arg2.x + 1) + _local6)) {
if ((_arg1[((_local8 - _arg2.x) - 1)] is Array)){
_local9 = _arg2.y;
while (_local9 < (_arg2.y + _local7)) {
if (((((!((_arg1[((_local8 - _arg2.x) - 1)][(_local9 - _arg2.y)] == 0))) && (!((this.grid[_local8][_local9] == -1))))) && (!((this.grid[_local8][_local9] == _arg3))))){
return (false);
};
_local9++;
};
} else {
return (false);
};
_local8++;
};
} else {
return (false);
};
};
if (_arg4 == "down"){
if ((_arg2.y + _local7) < this.gridHeight){
_local8 = _arg2.x;
while (_local8 < (_arg2.x + _local6)) {
if ((_arg1[(_local8 - _arg2.x)] is Array)){
_local9 = (_arg2.y + 1);
while (_local9 < ((_arg2.y + 1) + _local7)) {
if (((((!((_arg1[(_local8 - _arg2.x)][((_local9 - _arg2.y) - 1)] == 0))) && (!((this.grid[_local8][_local9] == -1))))) && (!((this.grid[_local8][_local9] == _arg3))))){
return (false);
};
_local9++;
};
} else {
return (false);
};
_local8++;
};
} else {
return (false);
};
};
if (_arg4 == "here"){
if ((((((((_arg2.x >= 0)) && (((_arg2.x + _local6) <= this.gridWidth)))) && ((_arg2.y >= 0)))) && (((_arg2.y + _local7) <= this.gridHeight)))){
_local8 = _arg2.x;
while (_local8 < (_arg2.x + _local6)) {
if ((_arg1[(_local8 - _arg2.x)] is Array)){
_local9 = _arg2.y;
while (_local9 < (_arg2.y + _local7)) {
if (((((!((_arg1[(_local8 - _arg2.x)][(_local9 - _arg2.y)] == 0))) && (!((this.grid[_local8][_local9] == -1))))) && (!((this.grid[_local8][_local9] == _arg3))))){
return (false);
};
_local9++;
};
} else {
return (false);
};
_local8++;
};
} else {
return (false);
};
};
} else {
return (false);
};
return (true);
}
public function setCellState(_arg1:Number, _arg2:Number, _arg3):Boolean{
var _local4:*;
_local4 = false;
if ((((((_arg1 >= 0)) && ((_arg1 < this.gridWidth)))) && ((((_arg2 >= 0)) && ((_arg2 < this.gridHeight)))))){
this.grid[_arg1][_arg2] = _arg3;
_local4 = true;
};
return (_local4);
}
public function resetField():void{
var _local1:Number;
var _local2:Number;
if (this.grid == null){
this.grid = new Array();
};
_local1 = 0;
while (_local1 < this.gridWidth) {
if (this.grid[_local1] == null){
this.grid[_local1] = new Array();
};
_local2 = 0;
while (_local2 < this.gridHeight) {
this.grid[_local1][_local2] = -1;
_local2++;
};
_local1++;
};
}
public function sendGridToOutput(){
var _local1:Number;
var _local2:Number;
var _local3:Array;
_local2 = 0;
while (_local2 < this.gridHeight) {
_local3 = new Array();
_local1 = 0;
while (_local1 < this.gridWidth) {
if (this.grid[_local1][_local2] == -1){
_local3.push("-");
} else {
_local3.push(this.grid[_local1][_local2]);
};
_local1++;
};
trace(_local3);
_local2++;
};
}
public function getCellState(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
_local3 = -1;
if ((((((_arg1 >= 0)) && ((_arg1 < this.gridWidth)))) && ((((_arg2 >= 0)) && ((_arg2 < this.gridHeight)))))){
_local3 = this.grid[_arg1][_arg2];
};
return (_local3);
}
public function replaceOnGrid(_arg1:Number, _arg2:Number):void{
var _local3:Number;
var _local4:Number;
if (_arg1 != _arg2){
_local3 = 0;
while (_local3 < this.gridWidth) {
_local4 = 0;
while (_local4 < this.gridHeight) {
if (this.grid[_local3][_local4] == _arg1){
this.grid[_local3][_local4] = _arg2;
};
_local4++;
};
_local3++;
};
};
}
private function onEnterFrame(_arg1:Event){
var _local2:Number;
var _local3:*;
if (!Math.round((Math.random() * 300))){
_local2 = Math.floor((Math.random() * 3));
if (_local2 == 0){
this.prof.gotoAndPlay(1);
};
if (_local2 == 1){
this.prof.gotoAndPlay(35);
_local3 = new ProfSound();
_local3.play();
};
if (_local2 == 2){
this.prof.gotoAndPlay(35);
_local3 = new ProfSound2();
_local3.play();
};
};
}
public function putOnGrid(_arg1:Array, _arg2:Number, _arg3:Point):void{
var _local4:Number;
var _local5:Number;
if ((_arg1 is Array)){
_local4 = _arg3.x;
while (_local4 < (_arg3.x + _arg1.length)) {
_local5 = _arg3.y;
while (_local5 < (_arg3.y + _arg1[(_local4 - _arg3.x)].length)) {
if (_arg1[(_local4 - _arg3.x)][(_local5 - _arg3.y)] == 1){
this.grid[_local4][_local5] = _arg2;
};
_local5++;
};
_local4++;
};
};
}
public function removeFromGrid(... _args):void{
var _local2:Boolean;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:AcidBottle;
var _local7:Point;
_local2 = false;
if (_args.length > 0){
if ((_args[(_args.length - 1)] is String)){
if (_args[(_args.length - 1)] == "bottlemagic"){
_local2 = true;
};
_args.pop();
};
};
_local3 = 0;
while (_local3 < this.gridWidth) {
_local4 = 0;
while (_local4 < this.gridHeight) {
_local5 = 0;
while (_local5 < _args.length) {
if (this.grid[_local3][_local4] == _args[_local5]){
if (_local2){
_local6 = new AcidBottle();
_local7 = this.getCellCoordinates(_local3, _local4);
_local6.xT = (_local7.x + (this.gridWidth / 2));
_local6.x = _local6.xT;
_local6.yT = (_local7.y + (this.gridWidth / 2));
_local6.y = _local6.yT;
parent.addChild(_local6);
_local6.stopAnimation();
};
this.grid[_local3][_local4] = -1;
};
_local5++;
};
_local4++;
};
_local3++;
};
}
public function getCellGridCoordinates(_arg1:Number, _arg2:Number):Point{
var _local3:Point;
_local3 = new Point(0, 0);
_local3.x = Math.floor(((_arg1 - this.gridStartX) / this.cellSize));
_local3.y = Math.floor(((_arg2 - this.gridStartY) / this.cellSize));
return (_local3);
}
}
}//package Classes
Section 10
//GameMusic (Classes.GameMusic)
package Classes {
import flash.media.*;
public class GameMusic extends Sound {
}
}//package Classes
Section 11
//GameOver (Classes.GameOver)
package Classes {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public dynamic class GameOver extends MovieClip {
public var helpText:MovieClip;
public var bg:MovieClip;
public var score:TextField;
public var submitscore:SimpleButton;
public var playagain:SimpleButton;
public var movHiScores:HiScores;
public var helpButton:SimpleButton;
public var scoreTitle:MovieClip;
public var backButton:SimpleButton;
public function GameOver(){
helpText.visible = false;
backButton.visible = false;
bg.alpha = 1;
this.x = 270;
this.y = 215;
playagain.addEventListener(MouseEvent.CLICK, playAgainPressed);
submitscore.addEventListener(MouseEvent.CLICK, submitScorePressed);
helpButton.addEventListener(MouseEvent.CLICK, helpButtonPressed);
backButton.addEventListener(MouseEvent.CLICK, backButtonPressed);
}
private function submitScorePressed(_arg1:MouseEvent):void{
trace(score.text);
movHiScores.setDetails(69, 0, "Frankie", false, parseInt(score.text), String(score.text), "points!");
}
private function helpButtonPressed(_arg1:MouseEvent){
playagain.visible = false;
submitscore.visible = false;
helpButton.visible = false;
score.visible = false;
scoreTitle.visible = false;
bg.alpha = 4;
backButton.visible = true;
helpText.visible = true;
}
private function backButtonPressed(_arg1:MouseEvent){
backButton.visible = false;
helpText.visible = false;
playagain.visible = true;
submitscore.visible = true;
helpButton.visible = true;
score.visible = true;
scoreTitle.visible = true;
bg.alpha = 1;
}
private function playAgainPressed(_arg1:MouseEvent):void{
dispatchEvent(new Event("gamestart", true));
}
}
}//package Classes
Section 12
//HandPart (Classes.HandPart)
package Classes {
import flash.geom.*;
public class HandPart extends BodyParts {
public function HandPart(){
this.figure = new Array(1);
this.figure[0] = new Array(1, 1, 1);
this.figureCenter = new Point(0.5, 1.5);
this.type = "hand";
}
override public function attach(_arg1:Boolean=false){
clincher = new ClincherClass();
if (_arg1){
clincher.gotoAndStop(11);
};
clincher.x = 0;
clincher.y = -33;
addChild(clincher);
}
override public function getTLC(_arg1=0):Point{
if ((((((_arg1 == 0)) || ((_arg1 == 180)))) || ((_arg1 == -180)))){
return (new Point(-0.5, -1.5));
};
if ((((_arg1 == 90)) || ((_arg1 == -90)))){
return (new Point(-1.5, -0.5));
};
return (new Point(-0.5, -1.5));
}
}
}//package Classes
Section 13
//HandSmallPart (Classes.HandSmallPart)
package Classes {
import flash.geom.*;
public class HandSmallPart extends BodyParts {
public function HandSmallPart(){
this.figure = new Array(1);
this.figure[0] = new Array(1, 1);
this.figureCenter = new Point(0.5, 0.5);
this.type = "hand";
}
override public function attach(_arg1:Boolean=false){
clincher = new ClincherClass();
if (_arg1){
clincher.gotoAndStop(11);
};
clincher.x = 0;
clincher.y = -10;
addChild(clincher);
}
override public function getTLC(_arg1=0):Point{
if (_arg1 == 0){
return (new Point(-0.5, -0.5));
};
if (_arg1 == 90){
return (new Point(-1.5, -0.5));
};
if ((((_arg1 == 180)) || ((_arg1 == -180)))){
return (new Point(-0.5, -1.5));
};
if (_arg1 == -90){
return (new Point(-0.5, -0.5));
};
return (new Point(-0.5, -0.5));
}
}
}//package Classes
Section 14
//HeadPart (Classes.HeadPart)
package Classes {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
public dynamic class HeadPart extends BodyParts {
var partIndex:Number;// = 0
public function HeadPart(){
partIndex = 0;
super();
this.figure = new Array(2);
this.figure[0] = new Array(1, 1);
this.figure[1] = new Array(1, 1);
this.figureCenter = new Point(1, 1);
this.type = "head";
}
override protected function enterFrameEventHandler(_arg1:Event):void{
super.enterFrameEventHandler(_arg1);
if (!Math.round((Math.random() * 300))){
if ((this.getChildAt((this.numChildren - 1)) is MovieClip)){
(this.getChildAt((this.numChildren - 1)) as MovieClip).play();
};
};
}
override public function getTLC(_arg1=0):Point{
return (new Point(-1, -1));
}
}
}//package Classes
Section 15
//Leg2Part (Classes.Leg2Part)
package Classes {
import flash.geom.*;
public class Leg2Part extends BodyParts {
public function Leg2Part(){
this.figure = new Array(2);
this.figure[0] = new Array(0, 0, 1);
this.figure[1] = new Array(1, 1, 1);
this.figureCenter = new Point(1.5, 1.5);
this.type = "leg";
}
override public function attach(_arg1:Boolean=false){
clincher = new ClincherClass();
if (_arg1){
clincher.gotoAndStop(11);
};
clincher.x = 0;
clincher.y = -33;
addChild(clincher);
}
override public function getTLC(_arg1=0):Point{
if (_arg1 == 0){
return (new Point(-1.5, -1.5));
};
if (_arg1 == 90){
return (new Point(-1.5, -1.5));
};
if ((((_arg1 == 180)) || ((_arg1 == -180)))){
return (new Point(-0.5, -1.5));
};
if (_arg1 == -90){
return (new Point(-1.5, -0.5));
};
return (new Point(-1.5, -1.5));
}
}
}//package Classes
Section 16
//Leg2SmallPart (Classes.Leg2SmallPart)
package Classes {
import flash.geom.*;
public class Leg2SmallPart extends BodyParts {
public function Leg2SmallPart(){
this.figure = new Array(2);
this.figure[0] = new Array(0, 1);
this.figure[1] = new Array(1, 1);
this.figureCenter = new Point(1.5, 1.5);
this.type = "leg";
}
override public function attach(_arg1:Boolean=false){
clincher = new ClincherClass();
if (_arg1){
clincher.gotoAndStop(11);
};
clincher.x = 2;
clincher.y = -33;
addChild(clincher);
}
override public function getTLC(_arg1=0):Point{
if (_arg1 == 0){
return (new Point(-1.5, -1.5));
};
if (_arg1 == 90){
return (new Point(-0.5, -1.5));
};
if ((((_arg1 == 180)) || ((_arg1 == -180)))){
return (new Point(-0.5, -0.5));
};
if (_arg1 == -90){
return (new Point(-1.5, -0.5));
};
return (new Point(-1.5, -1.5));
}
}
}//package Classes
Section 17
//LegPart (Classes.LegPart)
package Classes {
import flash.geom.*;
public class LegPart extends BodyParts {
public function LegPart(){
this.figure = new Array(2);
this.figure[0] = new Array(1, 1, 1);
this.figure[1] = new Array(0, 0, 1);
this.figureCenter = new Point(0.5, 1.5);
this.type = "leg";
}
override public function attach(_arg1:Boolean=false){
clincher = new ClincherClass();
if (_arg1){
clincher.gotoAndStop(11);
};
clincher.x = 0;
clincher.y = -33;
addChild(clincher);
}
override public function getTLC(_arg1=0):Point{
if (_arg1 == 0){
return (new Point(-0.5, -1.5));
};
if (_arg1 == 90){
return (new Point(-1.5, -0.5));
};
if ((((_arg1 == 180)) || ((_arg1 == -180)))){
return (new Point(-1.5, -1.5));
};
if (_arg1 == -90){
return (new Point(-1.5, -1.5));
};
return (new Point(-0.5, -1.5));
}
}
}//package Classes
Section 18
//LegSmallPart (Classes.LegSmallPart)
package Classes {
import flash.geom.*;
public class LegSmallPart extends BodyParts {
public function LegSmallPart(){
this.figure = new Array(2);
this.figure[0] = new Array(1, 1);
this.figure[1] = new Array(0, 1);
this.figureCenter = new Point(0.5, 1.5);
this.type = "leg";
}
override public function attach(_arg1:Boolean=false){
clincher = new ClincherClass();
if (_arg1){
clincher.gotoAndStop(11);
};
clincher.x = -3;
clincher.y = -33;
addChild(clincher);
}
override public function getTLC(_arg1=0):Point{
if (_arg1 == 0){
return (new Point(-0.5, -1.5));
};
if (_arg1 == 90){
return (new Point(-0.5, -0.5));
};
if ((((_arg1 == 180)) || ((_arg1 == -180)))){
return (new Point(-1.5, -0.5));
};
if (_arg1 == -90){
return (new Point(-1.5, -1.5));
};
return (new Point(-0.5, -1.5));
}
}
}//package Classes
Section 19
//Lightning2Class (Classes.Lightning2Class)
package Classes {
import flash.display.*;
import flash.events.*;
public class Lightning2Class extends MovieClip {
public function Lightning2Class(){
addFrameScript(0, frame1, 5, frame6);
addEventListener("lightning2end", destroyLightning);
}
function frame6(){
dispatchEvent(new Event("lightning2end", true));
}
function frame1(){
}
private function destroyLightning(_arg1:Event){
removeEventListener("lightning2end", destroyLightning);
parent.removeChild(this);
}
}
}//package Classes
Section 20
//LightningClass (Classes.LightningClass)
package Classes {
import flash.display.*;
import flash.events.*;
public class LightningClass extends MovieClip {
public function LightningClass(){
addFrameScript(0, frame1, 4, frame5);
addEventListener("lightningend", destroyLightning);
}
function frame1(){
}
function frame5(){
dispatchEvent(new Event("lightningend", true));
}
private function destroyLightning(_arg1:Event){
removeEventListener("lightningend", destroyLightning);
parent.removeChild(this);
}
}
}//package Classes
Section 21
//MenuClass (Classes.MenuClass)
package Classes {
import flash.display.*;
import flash.events.*;
import flash.media.*;
public dynamic class MenuClass extends MovieClip {
private var mMusicSoundTransform:SoundTransform;
private var mWolfSoundChannel:SoundChannel;
private var mMusicChannel:SoundChannel;
public var fading:MovieClip;
public var creditsbutton:SimpleButton;
public var title:MovieClip;
public var playbutton:SimpleButton;
public var intro:MovieClip;
public var helpbutton:SimpleButton;
private var waswolf:Boolean;
public var creditstext:MovieClip;
private var mMusic:MenuMusic;
public var backbutton:SimpleButton;
public var helptext:MovieClip;
private var mWolfSound:WolfSound;
public function MenuClass(_arg1:Boolean=true){
this.title.visible = false;
this.playbutton.visible = false;
this.helpbutton.visible = false;
this.backbutton.visible = false;
this.helptext.visible = false;
this.creditsbutton.visible = false;
this.creditstext.visible = false;
this.intro.visible = false;
this.waswolf = false;
this.mWolfSound = new WolfSound();
this.mMusic = new MenuMusic();
this.stop();
if (_arg1){
this.addEventListener("loadtitle", loadTitle);
this.fading.play();
} else {
loadTitle();
};
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function loadTitle(_arg1:Event=null):void{
var _local2:WolfSound;
if (_arg1 != null){
this.removeEventListener("loadtitle", loadTitle);
};
_local2 = new WolfSound();
mWolfSoundChannel = _local2.play();
mWolfSoundChannel.addEventListener(Event.SOUND_COMPLETE, wolfSoundStopped);
this.title.visible = true;
this.playbutton.visible = true;
this.playbutton.addEventListener(MouseEvent.CLICK, playIntro);
this.helpbutton.visible = true;
this.helpbutton.addEventListener(MouseEvent.CLICK, showHelp);
this.creditsbutton.visible = true;
this.creditsbutton.addEventListener(MouseEvent.CLICK, showCredits);
}
private function showMenu(_arg1:Event):void{
this.backbutton.visible = false;
this.helptext.visible = false;
this.playbutton.visible = true;
this.helpbutton.visible = true;
this.title.visible = true;
this.creditstext.visible = false;
this.creditsbutton.visible = true;
}
private function wolfSoundStopped(_arg1:Event):void{
mMusicSoundTransform = new SoundTransform(0, 0);
mMusicChannel = mMusic.play(0, 10000, mMusicSoundTransform);
this.waswolf = true;
}
public function stopMusic():void{
if (mWolfSoundChannel != null){
mWolfSoundChannel.stop();
};
if (mMusicChannel != null){
mMusicChannel.stop();
};
}
private function playIntro(_arg1:MouseEvent):void{
if (mWolfSoundChannel != null){
mWolfSoundChannel.stop();
};
if (mMusicChannel != null){
mMusicChannel.stop();
};
this.playbutton.visible = false;
this.helpbutton.visible = false;
this.creditsbutton.visible = false;
this.intro.visible = true;
this.intro.play();
}
private function onEnterFrame(_arg1:Event){
if (((!((mMusicSoundTransform == null))) && (this.waswolf))){
mMusicSoundTransform.volume = (mMusicSoundTransform.volume + (1 / 100));
mMusicChannel.soundTransform = mMusicSoundTransform;
if (mMusicSoundTransform.volume >= 1){
mMusicSoundTransform.volume = 1;
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
};
};
}
private function showCredits(_arg1:Event){
this.playbutton.visible = false;
this.helpbutton.visible = false;
this.backbutton.visible = true;
this.helptext.visible = false;
this.title.visible = false;
this.creditsbutton.visible = false;
this.creditstext.visible = true;
this.backbutton.addEventListener(MouseEvent.CLICK, showMenu);
}
private function showHelp(_arg1:Event):void{
this.playbutton.visible = false;
this.helpbutton.visible = false;
this.backbutton.visible = true;
this.helptext.visible = true;
this.creditsbutton.visible = false;
this.title.visible = false;
this.backbutton.addEventListener(MouseEvent.CLICK, showMenu);
}
}
}//package Classes
Section 22
//MenuMusic (Classes.MenuMusic)
package Classes {
import flash.media.*;
public class MenuMusic extends Sound {
}
}//package Classes
Section 23
//NextPartScreen (Classes.NextPartScreen)
package Classes {
import flash.display.*;
public class NextPartScreen extends MovieClip {
public function NextPartScreen(){
this.x = 540;
this.y = 0;
this.stop();
}
}
}//package Classes
Section 24
//PartSound1 (Classes.PartSound1)
package Classes {
import flash.media.*;
public class PartSound1 extends Sound {
}
}//package Classes
Section 25
//PartSound2 (Classes.PartSound2)
package Classes {
import flash.media.*;
public class PartSound2 extends Sound {
}
}//package Classes
Section 26
//PartSound3 (Classes.PartSound3)
package Classes {
import flash.media.*;
public class PartSound3 extends Sound {
}
}//package Classes
Section 27
//PartSound4 (Classes.PartSound4)
package Classes {
import flash.media.*;
public class PartSound4 extends Sound {
}
}//package Classes
Section 28
//PauseScreen (Classes.PauseScreen)
package Classes {
import flash.display.*;
public class PauseScreen extends MovieClip {
public function PauseScreen(){
this.x = 270;
this.y = 215;
}
}
}//package Classes
Section 29
//ProfSound (Classes.ProfSound)
package Classes {
import flash.media.*;
public class ProfSound extends Sound {
}
}//package Classes
Section 30
//ProfSound2 (Classes.ProfSound2)
package Classes {
import flash.media.*;
public class ProfSound2 extends Sound {
}
}//package Classes
Section 31
//ThunderSound (Classes.ThunderSound)
package Classes {
import flash.media.*;
public class ThunderSound extends Sound {
}
}//package Classes
Section 32
//TorsoPart (Classes.TorsoPart)
package Classes {
import flash.geom.*;
public class TorsoPart extends BodyParts {
public function TorsoPart(){
this.figure = new Array(3);
this.figure[0] = new Array(1, 1, 1);
this.figure[1] = new Array(1, 1, 1);
this.figure[2] = new Array(1, 1, 1);
this.figureCenter = new Point(1.5, 1.5);
this.type = "torso";
}
override public function rotateMe(_arg1:Number=0):void{
}
override public function getTLC(_arg1=0):Point{
return (new Point(-1.5, -1.5));
}
}
}//package Classes
Section 33
//TorsoSmallPart (Classes.TorsoSmallPart)
package Classes {
import flash.geom.*;
public class TorsoSmallPart extends BodyParts {
public function TorsoSmallPart(){
this.figure = new Array(2);
this.figure[0] = new Array(1, 1, 1);
this.figure[1] = new Array(1, 1, 1);
this.figureCenter = new Point(1, 1);
this.type = "torso";
}
override public function getTLC(_arg1=0):Point{
if (_arg1 == 0){
return (new Point(-1, -1));
};
if (_arg1 == 90){
return (new Point(-2, -1));
};
if ((((_arg1 == 180)) || ((_arg1 == -180)))){
return (new Point(-1, -2));
};
if (_arg1 == -90){
return (new Point(-1, -1));
};
return (new Point(-1, -1));
}
}
}//package Classes
Section 34
//WolfSound (Classes.WolfSound)
package Classes {
import flash.media.*;
public class WolfSound extends Sound {
}
}//package Classes
Section 35
//bottle3_55 (fTetris_fla.bottle3_55)
package fTetris_fla {
import flash.display.*;
import flash.events.*;
public dynamic class bottle3_55 extends MovieClip {
public function bottle3_55(){
addFrameScript(11, frame12);
}
function frame12(){
this.dispatchEvent(new Event("deleteme", true, false));
}
}
}//package fTetris_fla
Section 36
//bottle4_54 (fTetris_fla.bottle4_54)
package fTetris_fla {
import flash.display.*;
public dynamic class bottle4_54 extends MovieClip {
public function bottle4_54(){
addFrameScript(0, frame1);
}
function frame1(){
this.scaleX = (1 - (Math.floor((Math.random() * 2)) * 2));
}
}
}//package fTetris_fla
Section 37
//bottle5_57 (fTetris_fla.bottle5_57)
package fTetris_fla {
import flash.display.*;
import flash.events.*;
public dynamic class bottle5_57 extends MovieClip {
public function bottle5_57(){
addFrameScript(11, frame12);
}
function frame12(){
this.dispatchEvent(new Event("deleteme", true, false));
}
}
}//package fTetris_fla
Section 38
//bottle6_56 (fTetris_fla.bottle6_56)
package fTetris_fla {
import flash.display.*;
public dynamic class bottle6_56 extends MovieClip {
public function bottle6_56(){
addFrameScript(0, frame1);
}
function frame1(){
this.scaleX = (1 - (Math.floor((Math.random() * 2)) * 2));
}
}
}//package fTetris_fla
Section 39
//chest2_16 (fTetris_fla.chest2_16)
package fTetris_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import Classes.*;
import flash.media.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.filters.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class chest2_16 extends MovieClip {
public var frankieSound;
public function chest2_16(){
addFrameScript(0, frame1, 3, frame4);
}
function frame1(){
stop();
}
function frame4(){
frankieSound = new FrankieSound();
frankieSound.play();
}
}
}//package fTetris_fla
Section 40
//eyes_30 (fTetris_fla.eyes_30)
package fTetris_fla {
import flash.display.*;
import flash.events.*;
public dynamic class eyes_30 extends MovieClip {
public function eyes_30(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
addEventListener(Event.ENTER_FRAME, cbl);
}
public function cbl(_arg1=null){
if (!Math.round((Math.random() * 100))){
play();
};
}
}
}//package fTetris_fla
Section 41
//Fading_9 (fTetris_fla.Fading_9)
package fTetris_fla {
import flash.display.*;
import flash.events.*;
public dynamic class Fading_9 extends MovieClip {
public function Fading_9(){
addFrameScript(69, frame70);
}
function frame70(){
stop();
dispatchEvent(new Event("loadtitle", true));
}
}
}//package fTetris_fla
Section 42
//fingers_2 (fTetris_fla.fingers_2)
package fTetris_fla {
import flash.display.*;
import flash.events.*;
public dynamic class fingers_2 extends MovieClip {
public function fingers_2(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
addEventListener(Event.ENTER_FRAME, cbl);
}
public function cbl(_arg1=null){
if (!Math.round((Math.random() * 200))){
play();
};
}
}
}//package fTetris_fla
Section 43
//Frankenstein_49 (fTetris_fla.Frankenstein_49)
package fTetris_fla {
import flash.display.*;
public dynamic class Frankenstein_49 extends MovieClip {
public function Frankenstein_49(){
addFrameScript(0, frame1, 32, frame33);
}
function frame1(){
stop();
}
function frame33(){
stop();
}
}
}//package fTetris_fla
Section 44
//intro_11 (fTetris_fla.intro_11)
package fTetris_fla {
import flash.display.*;
import flash.events.*;
public dynamic class intro_11 extends MovieClip {
public var chest:MovieClip;
public var skipButton:SimpleButton;
public function intro_11(){
addFrameScript(0, frame1, 94, frame95, 95, frame96, 186, frame187, 187, frame188, 188, frame189, 189, frame190, 190, frame191, 191, frame192, 192, frame193, 193, frame194, 194, frame195, 195, frame196, 196, frame197, 197, frame198, 198, frame199, 199, frame200, 200, frame201, 201, frame202, 202, frame203, 203, frame204, 487, frame488);
}
function frame200(){
chest.gotoAndStop(13);
}
function frame204(){
chest.gotoAndStop(17);
}
function frame201(){
chest.gotoAndStop(14);
}
function frame202(){
chest.gotoAndStop(15);
}
function frame95(){
}
function frame187(){
chest.gotoAndStop(0);
}
public function skipButtonPressed(_arg1:MouseEvent){
skipButton.removeEventListener(MouseEvent.CLICK, skipButtonPressed);
stop();
dispatchEvent(new Event("gamestart", true));
}
function frame1(){
stop();
}
function frame96(){
skipButton.addEventListener(MouseEvent.CLICK, skipButtonPressed);
}
function frame190(){
chest.gotoAndStop(3);
}
function frame188(){
chest.gotoAndStop(1);
}
function frame194(){
chest.gotoAndStop(7);
}
function frame191(){
chest.gotoAndStop(4);
}
function frame192(){
chest.gotoAndStop(5);
}
function frame189(){
chest.gotoAndStop(2);
}
function frame198(){
chest.gotoAndStop(11);
}
function frame196(){
chest.gotoAndStop(9);
}
function frame195(){
chest.gotoAndStop(8);
}
function frame197(){
chest.gotoAndStop(10);
}
function frame199(){
chest.gotoAndStop(12);
}
function frame488(){
stop();
dispatchEvent(new Event("gamestart", true));
}
function frame203(){
chest.gotoAndStop(16);
}
function frame193(){
chest.gotoAndStop(6);
}
}
}//package fTetris_fla
Section 45
//MainTimeline (fTetris_fla.MainTimeline)
package fTetris_fla {
import flash.display.*;
import flash.events.*;
public dynamic class MainTimeline extends MovieClip {
public var wasGameStarted:Boolean;
public var movSplash:Splash;
public function MainTimeline(){
addFrameScript(0, frame1, 1, frame2);
}
public function splashEnterFrame(_arg1:Event){
if (movSplash.isComplete()){
movSplash.removeEventListener(Event.ENTER_FRAME, splashEnterFrame);
if (!wasGameStarted){
startGame();
wasGameStarted = true;
};
};
}
function frame1(){
stop();
MochiAd.showPreGameAd({clip:root, id:"72a4b958c5a936c2", res:"540x430"});
MochiBot.track(this, "1a2c1f79");
}
public function startGame(){
var _local1:Game;
_local1 = new Game();
addChild(_local1);
}
function frame2(){
stop();
wasGameStarted = false;
movSplash.addEventListener(Event.ENTER_FRAME, splashEnterFrame);
}
}
}//package fTetris_fla
Section 46
//Symbol1_43 (fTetris_fla.Symbol1_43)
package fTetris_fla {
import flash.display.*;
import flash.events.*;
public dynamic class Symbol1_43 extends MovieClip {
public function Symbol1_43(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
addEventListener(Event.ENTER_FRAME, cbl);
}
public function cbl(_arg1=null){
if (!Math.round((Math.random() * 300))){
play();
};
}
}
}//package fTetris_fla
Section 47
//Symbol1copy_5 (fTetris_fla.Symbol1copy_5)
package fTetris_fla {
import flash.display.*;
import flash.events.*;
public dynamic class Symbol1copy_5 extends MovieClip {
public function Symbol1copy_5(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
addEventListener(Event.ENTER_FRAME, cbl);
}
public function cbl(_arg1=null){
if (!Math.round((Math.random() * 300))){
play();
};
}
}
}//package fTetris_fla
Section 48
//movEntryScreen_2 (HiScores_fla.movEntryScreen_2)
package HiScores_fla {
import flash.display.*;
import flash.text.*;
public dynamic class movEntryScreen_2 extends MovieClip {
public var txtName:TextField;
public var movCode:MovieClip;
public var txtMsg2:TextField;
public var btnRefreshCode:SimpleButton;
public var txtCode:TextField;
public var txtMsg1:TextField;
public var btnSubmit:SimpleButton;
}
}//package HiScores_fla
Section 49
//movInfoScreen_6 (HiScores_fla.movInfoScreen_6)
package HiScores_fla {
import flash.display.*;
import flash.text.*;
public dynamic class movInfoScreen_6 extends MovieClip {
public var btnView:SimpleButton;
public var txtInfo:TextField;
public var btnBack:SimpleButton;
}
}//package HiScores_fla
Section 50
//Game (Game)
package {
import flash.display.*;
import flash.events.*;
import Classes.*;
public class Game extends MovieClip {
private var screen;
public function Game(){
screen = new MenuClass();
addChild(screen);
addEventListener("gamestart", playGame);
addEventListener("loadmenu", loadMenu);
}
private function pauseGame(_arg1:Event):void{
(screen as GameClass).pauseMe();
}
private function changeSoundStatus(_arg1:Event):void{
}
private function playGame(_arg1:Event):void{
if ((screen is MenuClass)){
(screen as MenuClass).stopMusic();
};
removeChild(screen);
screen = new GameClass();
addChild(screen);
addEventListener("gamepause", pauseGame);
addEventListener("gameover", gameOver);
addEventListener("sound", changeSoundStatus);
addEventListener("gamestart", playGame);
root.stage.focus = root.stage;
this.stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
this.stage.addEventListener(KeyboardEvent.KEY_UP, keyUnPressed);
}
private function loadMenu(_arg1:Event):void{
if (screen != null){
removeEventListener("gamepause", pauseGame);
removeEventListener("gameover", gameOver);
removeEventListener("sound", changeSoundStatus);
removeChild(screen);
screen = new MenuClass(false);
addChild(screen);
addEventListener("loadmenu", loadMenu);
};
}
private function keyUnPressed(_arg1:KeyboardEvent):void{
(screen as GameClass).keyUpEventHandler(_arg1);
}
private function keyPressed(_arg1:KeyboardEvent):void{
(screen as GameClass).keyDownEventHandler(_arg1);
}
private function gameOver(_arg1:Event):void{
(screen as GameClass).stopMe();
}
}
}//package
Section 51
//HiScores (HiScores)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public dynamic class HiScores extends MovieClip {
private var KEY:String;// = "rocket"
private var score:Number;
private var lowIsBest:Boolean;
private var gameId:Number;
private var infoScreen:MovieClip;// = null
public var movEntryScreen:MovieClip;
private var levelId:Number;
private var entryScreen:MovieClip;// = null
public var movInfoScreen:MovieClip;
private var gameCode:String;
public static var HS_SERVLET_URL:String = (SERVER_URL + "/servlet/hiServlet");
public static var SERVER_URL:String = "http://www.gimme5games.com";
public static var INDEX_URL:String = (SERVER_URL + "/index.jsp?id=");
public function HiScores(){
KEY = "rocket";
infoScreen = null;
entryScreen = null;
super();
this.visible = false;
}
public function secCodeLoad():void{
var _local1:Loader;
var _local2:String;
_local1 = new Loader();
_local1.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, secCodeLoadError);
_local2 = ((HS_SERVLET_URL + "?type=genCode&cachebuster=") + new Date().getTime());
_local1.load(new URLRequest(_local2));
entryScreen["movCode"].addChild(_local1);
}
public function submitDetails():void{
var _local1:Boolean;
var _local2:String;
var _local3:String;
var _local4:Number;
var _local5:Number;
var _local6:URLVariables;
var _local7:URLRequest;
var _local8:URLLoader;
entryScreen.visible = false;
infoScreen.visible = true;
_local1 = true;
if (entryScreen["txtName"].text.length == 0){
showInfoMessage("Please enter your name.", true);
} else {
if (entryScreen["txtCode"].text.length != 5){
showInfoMessage("Please enter all 5 letters of the security code.", true);
} else {
showInfoMessage("Submitting hi-score details to the server, please wait.", true);
infoScreen["btnBack"].visible = false;
_local1 = false;
};
};
if (!_local1){
_local2 = ((((((((("save|" + entryScreen["txtName"].text) + "|") + entryScreen["txtCode"].text) + "|") + score) + "|") + gameId) + "|") + levelId);
_local3 = "";
_local4 = 0;
_local5 = 0;
while (_local4 < _local2.length) {
if (_local5 >= KEY.length){
_local5 = 0;
};
_local3 = (_local3 + String.fromCharCode(((_local2.charCodeAt(_local4) ^ KEY.charCodeAt(_local5)) + 1)));
_local4++;
_local5++;
};
_local6 = new URLVariables();
_local6.ffdata = _local3;
_local6.lowIsBest = lowIsBest;
_local7 = new URLRequest(HS_SERVLET_URL);
_local8 = new URLLoader();
_local8.dataFormat = URLLoaderDataFormat.VARIABLES;
_local7.data = _local6;
_local7.method = URLRequestMethod.POST;
_local8.addEventListener(Event.COMPLETE, submitHiScoreHandler);
_local8.addEventListener(IOErrorEvent.IO_ERROR, submitHiScoreError);
_local8.load(_local7);
};
}
public function back():void{
entryScreen.visible = true;
infoScreen.visible = false;
}
public function submitHiScoreHandler(_arg1:Event):void{
var _local2:URLLoader;
var _local3:Number;
_local2 = URLLoader(_arg1.target);
_local3 = _local2.data.res;
if (_local3 == -1){
showInfoMessage("Could not store hi-score details. Click on back, generate a new security code and re-submit.", true);
} else {
if (_local3 == 0){
showInfoMessage("Sorry, a better score already exists with that name.", false);
} else {
if (_local3 == 1){
showInfoMessage("Congratulations! You made it into the\nhi-score table.", false);
};
};
};
}
public function showInfoMessage(_arg1:String, _arg2:Boolean):void{
infoScreen["txtInfo"].text = _arg1;
infoScreen["btnBack"].visible = _arg2;
infoScreen["btnView"].visible = !(_arg2);
}
public function secCodeLoadError(_arg1:IOErrorEvent):void{
entryScreen.visible = false;
infoScreen.visible = true;
showInfoMessage("Could not generate a security code. Click on back and try to refresh the code window.", true);
}
public function setDetails(_arg1:Number, _arg2:Number, _arg3:String, _arg4:Boolean, _arg5:Number, _arg6:String, _arg7:String):void{
this.gameId = _arg1;
this.levelId = _arg2;
this.gameCode = _arg3;
this.lowIsBest = _arg4;
this.score = _arg5;
this.entryScreen = this["movEntryScreen"];
this.infoScreen = this["movInfoScreen"];
entryScreen["txtMsg1"].text = _arg6;
entryScreen["txtMsg2"].text = _arg7;
entryScreen["txtName"].text = "";
entryScreen["txtCode"].text = "";
entryScreen.visible = true;
infoScreen.visible = false;
secCodeLoad();
entryScreen["btnRefreshCode"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
entryScreen["btnSubmit"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
infoScreen["btnView"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
infoScreen["btnBack"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
this.visible = true;
}
public function submitHiScoreError(_arg1:IOErrorEvent):void{
showInfoMessage("A serious problem was encountered with the server, please try again in a few minutes.", true);
}
public function onButtonPress(_arg1:MouseEvent):void{
switch (_arg1.target.name){
case "btnRefreshCode":
secCodeLoad();
break;
case "btnSubmit":
submitDetails();
break;
case "btnView":
viewScore();
break;
case "btnBack":
back();
break;
};
}
public function viewScore():void{
var _local1:URLRequest;
_local1 = new URLRequest(((((((((INDEX_URL + gameCode) + "_hs") + "&name=") + entryScreen["txtName"].text) + "&levelId=") + levelId) + "&cachebuster=") + new Date().getTime()));
navigateToURL(_local1, "_blank");
}
}
}//package
Section 52
//MochiAd (MochiAd)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
public class MochiAd {
public static function getVersion():String{
return ("2.1");
}
public static function showTimedAd(_arg1:Object):void{
MochiAd.showInterLevelAd(_arg1);
}
public static function _allowDomains(_arg1:String):String{
var _local2:String;
_local2 = _arg1.split("/")[2].split(":")[0];
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function load(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var depth:Number;
var mc:MovieClip;
var wh:Array;
var lv:URLVariables;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var f:Function;
var g:Function;
var req:URLRequest;
var v:Object;
var options = _arg1;
DEFAULTS = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
if (!MochiAd._isNetworkAvailable()){
return (null);
};
if (clip._mochiad_loaded){
return (null);
};
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, "_mochiad", depth);
wh = MochiAd._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
};
lv = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
f = function (_arg1:Object):void{
mc._mochiad_ctr_failed = true;
};
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
g = function (_arg1:Object):void{
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.load(req);
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function sendHighScore(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip;
_local4 = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["sendHighScore", _arg1], _arg2, _arg3);
return (true);
}
public static function _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local3:Object;
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
_local3 = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
if (_arg1){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
_arg1 = _local3.clip.loaderInfo.parameters.mochiad_options;
if (_arg1){
_local5 = _arg1.split("&");
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6].split("=");
_local3[unescape(_local7[0])] = unescape(_local7[1]);
_local6++;
};
};
return (_local3);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
_arg1.removeChild(_arg1._mochiad);
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function showInterLevelAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
this.clip.stop();
}, ad_finished:function ():void{
this.clip.play();
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = _local1.loaderInfo.bytesTotal;
if ((((_local4 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
_local3 = true;
};
};
};
if ((((_local2 > chk.ad_msec)) || (this.parent._mochiad_ctr_failed))){
_local3 = true;
};
if (_local3){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local3:Object;
var _local4:Number;
var _local5:Number;
var _local6:Array;
_local3 = _arg2.getBounds(_arg2.root);
_local4 = 0;
_local5 = 0;
if (typeof(_arg1.res) != "undefined"){
_local6 = _arg1.res.split("x");
_local4 = parseFloat(_local6[0]);
_local5 = parseFloat(_local6[1]);
} else {
_local4 = (_local3.xMax - _local3.xMin);
_local5 = (_local3.yMax - _local3.yMin);
};
if ((((_local4 == 0)) || ((_local5 == 0)))){
_local4 = _arg2.stage.stageWidth;
_local5 = _arg2.stage.stageHeight;
};
return ([_local4, _local5]);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip;
_local4 = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function _loadCommunicator(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var clipname:String;
var server:String;
var depth:Number;
var mc:MovieClip;
var lv:URLVariables;
var k:String;
var lc:LocalConnection;
var name:String;
var req:URLRequest;
var loader:Loader;
var options = _arg1;
DEFAULTS = {com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
clipname = ("_mochiad_com_" + options.id);
if (!MochiAd._isNetworkAvailable()){
return (null);
};
if (clip[clipname]){
return (clip[clipname]);
};
server = (options.com_server + options.id);
MochiAd._allowDomains(server);
delete options.id;
delete options.com_server;
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, clipname, depth);
lv = new URLVariables();
for (k in options) {
lv[k] = options[k];
};
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.name = name;
mc.lc = lc;
lv.lc = name;
mc._id = 0;
mc._queue = [];
mc.rpcResult = function (_arg1:Object):void{
var _local3:Array;
var _local4:Array;
var _local5:Number;
var _local6:Object;
var _local7:Object;
_arg1 = parseInt(_arg1.toString());
_local3 = mc._callbacks[_arg1];
if (typeof(_local3) == "undefined"){
return;
};
delete mc._callbacks[_arg1];
_local4 = [];
_local5 = 2;
while (_local5 < _local3.length) {
_local4.push(_local3[_local5]);
_local5++;
};
_local5 = 1;
while (_local5 < arguments.length) {
_local4.push(arguments[_local5]);
_local5++;
};
_local6 = _local3[1];
_local7 = _local3[0];
if (((_local7) && ((typeof(_local6) == "string")))){
_local6 = _local7[_local6];
};
if (typeof(_local6) == "function"){
_local6.apply(_local7, _local4);
};
};
mc._didConnect = function (_arg1:String):void{
var _local2:Array;
var _local3:Function;
var _local4:Number;
var _local5:Array;
mc._endpoint = _arg1;
_local2 = mc._queue;
delete mc._queue;
_local3 = mc.doSend;
_local4 = 0;
while (_local4 < _local2.length) {
_local5 = _local2[_local4];
_local3.apply(this, _local5);
_local4++;
};
};
mc.doSend = function (_arg1:Array, _arg2:Object, _arg3:Object):void{
var _local5:Number;
var _local6:LocalConnection;
var _local7:Array;
var _local8:Number;
if (mc._endpoint == null){
_local7 = [];
_local8 = 0;
while (_local8 < arguments.length) {
_local7.push(arguments[_local8]);
_local8++;
};
mc._queue.push(_local7);
return;
};
mc._id = (mc._id + 1);
_local5 = mc._id;
mc._callbacks[_local5] = [_arg2, ((_arg3) || (_arg2))];
_local6 = new LocalConnection();
_local6.send(mc._endpoint, "rpc", _local5, _arg1);
};
mc._callbacks = {};
mc._callbacks[0] = [mc, "_didConnect"];
lv.st = getTimer();
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader = new Loader();
loader.load(req);
mc.addChild(loader);
mc._mochiad_com = loader;
return (mc);
}
public static function showPreGameAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var bar:MovieClip;
var bar_color:Number;
var bar_background:Number;
var bar_outline:Number;
var backing_mc:MovieClip;
var backing:Object;
var inside_mc:MovieClip;
var inside:Object;
var outline_mc:MovieClip;
var outline:Object;
var complete:Boolean;
var unloaded:Boolean;
var f:Function;
var r:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, ad_started:function ():void{
this.clip.stop();
}, ad_finished:function ():void{
this.clip.play();
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
var fn:Function;
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
bar = createEmptyMovieClip(chk, "_mochiad_bar", 4);
bar.x = 10;
bar.y = (h - 20);
bar_color = options.color;
delete options.color;
bar_background = options.background;
delete options.background;
bar_outline = options.outline;
delete options.outline;
backing_mc = createEmptyMovieClip(bar, "_outline", 1);
backing = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo((w - 20), 0);
backing.lineTo((w - 20), 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
inside_mc = createEmptyMovieClip(bar, "_inside", 2);
inside = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo((w - 20), 0);
inside.lineTo((w - 20), 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
outline_mc = createEmptyMovieClip(bar, "_outline", 3);
outline = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo((w - 20), 0);
outline.lineTo((w - 20), 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
f = function (_arg1:Event):void{
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
MochiAd.unload(clip);
};
};
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Object;
var _local3:Number;
var _local4:Boolean;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Object;
var _local10:Number;
var _local11:Number;
if (!this.parent.parent){
delete this["onEnterFrame"];
return;
};
_local1 = this.parent.parent.root;
_local2 = this.parent._mochiad_ctr;
_local3 = (getTimer() - this.started);
_local4 = false;
_local5 = _local1.loaderInfo.bytesTotal;
_local6 = _local1.loaderInfo.bytesLoaded;
_local7 = ((100 * _local6) / _local5);
_local8 = ((100 * _local3) / chk.ad_msec);
_local9 = this._mochiad_bar._inside;
_local10 = Math.min(100, Math.min(((_local7) || (0)), _local8));
_local10 = Math.max(this.last_pcnt, _local10);
this.last_pcnt = _local10;
_local9.scaleX = (_local10 * 0.01);
if (!chk.showing){
_local11 = _local2.loaderInfo.bytesTotal;
if ((((_local11 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local3 > chk.ad_timeout){
_local4 = true;
};
};
};
if ((((_local3 > chk.ad_msec)) || (this.parent._mochiad_ctr_failed))){
_local4 = true;
};
if (((complete) && (_local4))){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(_arg1:Object):void{
MochiAd.showPreGameAd(_arg1);
}
public static function fetchHighScores(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip;
_local4 = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["fetchHighScores", _arg1], _arg2, _arg3);
return (true);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var f:Function;
var mc = _arg1;
f = function (_arg1:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
mc.removeEventListener(Event.ENTER_FRAME, f);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package
Section 53
//MochiBot (MochiBot)
package {
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
Section 54
//sndSlap (sndSlap)
package {
import flash.media.*;
public dynamic class sndSlap extends Sound {
}
}//package
Section 55
//Splash (Splash)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public dynamic class Splash extends MovieClip {
public var hand:MovieClip;
public var btnUrl:SimpleButton;
public static var SERVER_URL:String = "http://www.gimme5games.com";
public function Splash(){
this.addEventListener(Event.ENTER_FRAME, splashEnterFrame);
this["btnUrl"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
}
public function splashEnterFrame(_arg1:Event):void{
if (this.currentFrame == this.totalFrames){
this.removeEventListener(Event.ENTER_FRAME, splashEnterFrame);
this.stop();
};
}
public function isComplete():Boolean{
return ((this.currentFrame == this.totalFrames));
}
public function onButtonPress(_arg1:MouseEvent):void{
var _local2:URLRequest;
switch (_arg1.target.name){
case "btnUrl":
_local2 = new URLRequest(SERVER_URL);
navigateToURL(_local2, "_blank");
break;
};
}
}
}//package