Section 1
//Grass_4 (potions_fla.Grass_4)
package potions_fla {
import flash.display.*;
public dynamic class Grass_4 extends MovieClip {
public function Grass_4(){
addFrameScript(0, frame1, 47, frame48);
}
function frame1(){
play();
}
function frame48(){
gotoAndPlay(1);
}
}
}//package potions_fla
Section 2
//BGMusic (BGMusic)
package {
import flash.media.*;
public dynamic class BGMusic extends Sound {
}
}//package
Section 3
//bingBamBoom (bingBamBoom)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
public class bingBamBoom extends MovieClip {
private var burstSprite:MovieClip;
private var animTimer:Timer;
private var parentMC:MovieClip;
static const animStepTime:int = 50;
static const animSteps:int = 10;
public function bingBamBoom(_arg1:MovieClip, _arg2:Number, _arg3:Number){
burstSprite = new smackDown();
burstSprite.x = _arg2;
burstSprite.y = _arg3;
burstSprite.scaleX = 0.5;
burstSprite.scaleY = 0.5;
burstSprite.alpha = 100;
parentMC = _arg1;
parentMC.addChild(burstSprite);
animTimer = new Timer(animStepTime, animSteps);
animTimer.addEventListener(TimerEvent.TIMER, alphaBurst);
animTimer.addEventListener(TimerEvent.TIMER_COMPLETE, removeBurst);
animTimer.start();
}
public function removeBurst(_arg1:TimerEvent){
parentMC.removeChild(burstSprite);
burstSprite = null;
delete ??getglobalscope
[this];
}
public function alphaBurst(_arg1:TimerEvent){
var _local2:Number;
_local2 = (_arg1.target.currentCount / animSteps);
burstSprite.alpha = (1 - _local2);
}
}
}//package
Section 4
//BoisterBlack (BoisterBlack)
package {
import flash.text.*;
public dynamic class BoisterBlack extends Font {
}
}//package
Section 5
//Bottle (Bottle)
package {
import flash.events.*;
import flash.display.*;
public class Bottle extends MovieClip {
public var isMovable:Boolean;// = true
private var bottleParent:MovieClip;
public var bottleRow:Number;
private var origX:Number;
private var origY:Number;
public var bottleColor:String;
public var bottleID:String;
public var bottleShape:String;
public var bottleCol:Number;
public var isSelected:Boolean;// = false
public function Bottle(_arg1:MovieClip, _arg2:String, _arg3:String){
var _local4:*;
isMovable = true;
isSelected = false;
super();
_local4 = ((_arg2 + "_") + _arg3);
bottleColor = _arg3;
bottleShape = _arg2;
bottleParent = _arg1;
this.gotoAndStop(_local4);
this.addEventListener(MouseEvent.MOUSE_DOWN, pickUpBottle);
this.addEventListener(MouseEvent.MOUSE_UP, putDownBottle);
}
private function findClosetTile(){
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
_local1 = 0;
while (_local1 < bottleParent.rows) {
_local2 = 0;
while (_local2 < bottleParent.cols) {
if (this.hitTestPoint(bottleParent.TileArray[_local1][_local2].x, bottleParent.TileArray[_local1][_local2].y)){
if (checkTilesForMatch(_local1, _local2)){
this.x = bottleParent.TileArray[_local1][_local2].x;
this.y = bottleParent.TileArray[_local1][_local2].y;
this.isMovable = false;
bottleParent.BottleArray[_local1][_local2] = this;
bottleRow = _local1;
bottleCol = _local2;
_local3 = getPointValue(_local1, _local2);
bottleParent.updateScore(_local3);
_local4 = new PointBurst(bottleParent, _local3, this.x, this.y);
bottleParent.TileArray[_local1][_local2].Lighten();
_local5 = bottleParent.InvenArray;
for (_local6 in _local5) {
if (_local5[_local6].bottleID == this.bottleID){
_local5.splice(_local6, 1);
};
};
checkRowsColsForCompletion(_local1, _local2);
bottleParent.shiftInventory();
bottleParent.checkForUnsolvableBoard();
bottleParent.checkForEndLevel();
} else {
this.x = this.origX;
this.y = this.origY;
};
};
_local2++;
};
_local1++;
};
}
private function goAway(){
bottleParent.BottleArray[this.bottleRow][this.bottleCol] = false;
bottleParent.removeChild(this);
}
private function checkRowsColsForCompletion(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:*;
var _local5:Boolean;
var _local6:Boolean;
var _local7:Number;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:*;
var _local13:*;
var _local14:*;
var _local15:*;
_local3 = bottleParent.BottleArray;
_local4 = bottleParent.TileArray;
_local5 = false;
_local6 = false;
_local8 = 0;
_local9 = 0;
while (_local9 < bottleParent.rows) {
if (_local3[_local9][_arg2] != false){
_local8++;
};
_local9++;
};
_local10 = 0;
_local11 = 0;
while (_local11 < bottleParent.cols) {
if (_local3[_arg1][_local11] != false){
_local10++;
};
_local11++;
};
if (_local8 == bottleParent.rows){
_local5 = true;
};
if (_local10 == bottleParent.cols){
_local6 = true;
};
if (_local5){
_local12 = 0;
while (_local12 < bottleParent.rows) {
_local4[_local12][_arg2].TurnGold();
if (_local3[_local12][_arg2]){
_local3[_local12][_arg2].goAway();
};
_local12++;
};
};
if (_local6){
_local13 = 0;
while (_local13 < bottleParent.cols) {
_local4[_arg1][_local13].TurnGold();
if (_local3[_arg1][_local13]){
_local3[_arg1][_local13].goAway();
};
_local13++;
};
};
if (((_local5) && (_local6))){
_local14 = new PointBurst(bottleParent, 2500, this.x, this.y);
} else {
if (((_local5) || (_local6))){
_local15 = new PointBurst(bottleParent, 500, this.x, this.y);
};
};
}
private function pickUpBottle(_arg1:MouseEvent){
if (isMovable){
origX = this.x;
origY = this.y;
this.startDrag();
isSelected = true;
};
}
private function putDownBottle(_arg1:MouseEvent){
if (((isMovable) && (isSelected))){
this.stopDrag();
isSelected = false;
if (!checkForFire()){
findClosetTile();
};
};
}
private function checkForFire(){
var _local1:*;
var _local2:*;
if (((this.hitTestPoint(bottleParent.myFire.x, bottleParent.myFire.y)) || (this.hitTestPoint(bottleParent.myBowl.x, bottleParent.myBowl.y)))){
_local1 = bottleParent.InvenArray;
for (_local2 in _local1) {
if (_local1[_local2].bottleID == this.bottleID){
_local1.splice(_local2, 1);
};
};
bottleParent.removeChild(this);
bottleParent.shiftInventory();
bottleParent.checkForUnsolvableBoard();
bottleParent.bottlesDiscarded++;
bottleParent.checkForEndLevel();
bottleParent.myBowl.gotoAndPlay(("bowl_" + bottleParent.bottlesDiscarded));
if (bottleParent.bottlesDiscarded == 4){
bottleParent.endGameFire();
};
return (true);
//unresolved jump
};
return (false);
}
private function getPointValue(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:Array;
_local3 = bottleParent.TileArray[_arg1][_arg2].TileSeen;
_local4 = 0;
_local5 = 0;
_local6 = bottleParent.BottleArray;
if (((_local6[(_arg1 - 1)][_arg2]) && ((((_local6[(_arg1 - 1)][_arg2].bottleShape == this.bottleShape)) && ((_local6[(_arg1 - 1)][_arg2].bottleColor == this.bottleColor)))))){
_local4 = (_local4 + 50);
_local5++;
} else {
if (((_local6[(_arg1 - 1)][_arg2]) && ((_local6[(_arg1 - 1)][_arg2].bottleShape == this.bottleShape)))){
_local4 = (_local4 + 10);
_local5++;
} else {
if (((_local6[(_arg1 - 1)][_arg2]) && ((_local6[(_arg1 - 1)][_arg2].bottleColor == this.bottleColor)))){
_local4 = (_local4 + 10);
_local5++;
};
};
};
if (((_local6[(_arg1 + 1)][_arg2]) && ((((_local6[(_arg1 + 1)][_arg2].bottleShape == this.bottleShape)) && ((_local6[(_arg1 + 1)][_arg2].bottleColor == this.bottleColor)))))){
_local4 = (_local4 + 50);
_local5++;
} else {
if (((_local6[(_arg1 + 1)][_arg2]) && ((_local6[(_arg1 + 1)][_arg2].bottleShape == this.bottleShape)))){
_local4 = (_local4 + 10);
_local5++;
} else {
if (((_local6[(_arg1 + 1)][_arg2]) && ((_local6[(_arg1 + 1)][_arg2].bottleColor == this.bottleColor)))){
_local4 = (_local4 + 10);
_local5++;
};
};
};
if (((_local6[_arg1][(_arg2 - 1)]) && ((((_local6[_arg1][(_arg2 - 1)].bottleShape == this.bottleShape)) && ((_local6[_arg1][(_arg2 - 1)].bottleColor == this.bottleColor)))))){
_local4 = (_local4 + 50);
_local5++;
} else {
if (((_local6[_arg1][(_arg2 - 1)]) && ((_local6[_arg1][(_arg2 - 1)].bottleShape == this.bottleShape)))){
_local4 = (_local4 + 10);
_local5++;
} else {
if (((_local6[_arg1][(_arg2 - 1)]) && ((_local6[_arg1][(_arg2 - 1)].bottleColor == this.bottleColor)))){
_local4 = (_local4 + 10);
_local5++;
};
};
};
if (((_local6[_arg1][(_arg2 + 1)]) && ((((_local6[_arg1][(_arg2 + 1)].bottleShape == this.bottleShape)) && ((_local6[_arg1][(_arg2 + 1)].bottleColor == this.bottleColor)))))){
_local4 = (_local4 + 50);
_local5++;
} else {
if (((_local6[_arg1][(_arg2 + 1)]) && ((_local6[_arg1][(_arg2 + 1)].bottleShape == this.bottleShape)))){
_local4 = (_local4 + 10);
_local5++;
} else {
if (((_local6[_arg1][(_arg2 + 1)]) && ((_local6[_arg1][(_arg2 + 1)].bottleColor == this.bottleColor)))){
_local4 = (_local4 + 10);
_local5++;
};
};
};
_local4 = (_local4 * _local5);
if (!_local3){
_local4 = (_local4 * 2);
};
return (_local4);
}
public function Break(){
var _local1:*;
_local1 = new bingBamBoom(bottleParent, this.x, this.y);
this.goAway();
}
public function checkTilesForMatch(_arg1:Number, _arg2:Number){
var _local3:Array;
var _local4:Boolean;
_local3 = bottleParent.BottleArray;
_local4 = true;
if (_local3[_arg1][_arg2] != false){
_local4 = false;
};
if ((((((((_local3[(_arg1 - 1)][_arg2] == false)) && ((_local3[(_arg1 + 1)][_arg2] == false)))) && ((_local3[_arg1][(_arg2 - 1)] == false)))) && ((_local3[_arg1][(_arg2 + 1)] == false)))){
_local4 = false;
};
if (((!((_local3[(_arg1 - 1)][_arg2] == false))) && (((!((_local3[(_arg1 - 1)][_arg2].bottleColor == this.bottleColor))) && (!((_local3[(_arg1 - 1)][_arg2].bottleShape == this.bottleShape))))))){
_local4 = false;
};
if (((!((_local3[(_arg1 + 1)][_arg2] == false))) && (((!((_local3[(_arg1 + 1)][_arg2].bottleColor == this.bottleColor))) && (!((_local3[(_arg1 + 1)][_arg2].bottleShape == this.bottleShape))))))){
_local4 = false;
};
if (((!((_local3[_arg1][(_arg2 + 1)] == false))) && (((!((_local3[_arg1][(_arg2 + 1)].bottleColor == this.bottleColor))) && (!((_local3[_arg1][(_arg2 + 1)].bottleShape == this.bottleShape))))))){
_local4 = false;
};
if (((!((_local3[_arg1][(_arg2 - 1)] == false))) && (((!((_local3[_arg1][(_arg2 - 1)].bottleColor == this.bottleColor))) && (!((_local3[_arg1][(_arg2 - 1)].bottleShape == this.bottleShape))))))){
_local4 = false;
};
return (_local4);
}
}
}//package
Section 6
//Bowl (Bowl)
package {
import flash.display.*;
public dynamic class Bowl extends MovieClip {
public function Bowl(){
addFrameScript(0, frame1, 24, frame25, 48, frame49, 74, frame75, 88, frame89);
}
function frame75(){
gotoAndPlay("loop_3");
}
function frame89(){
stop();
}
function frame1(){
stop();
}
function frame25(){
gotoAndPlay("loop_1");
}
function frame49(){
gotoAndPlay("loop_2");
}
}
}//package
Section 7
//buttonLevelReset (buttonLevelReset)
package {
import flash.events.*;
import flash.display.*;
public class buttonLevelReset extends MovieClip {
public function buttonLevelReset(_arg1){
this.addEventListener(MouseEvent.MOUSE_OVER, _arg1.startReset);
this.addEventListener(MouseEvent.MOUSE_OUT, _arg1.stopReset);
this.addEventListener(MouseEvent.CLICK, _arg1.resetToLastLevel);
this.useHandCursor = true;
this.buttonMode = true;
}
}
}//package
Section 8
//EndScreen (EndScreen)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
public class EndScreen extends MovieClip {
public var playAgainButtonEnd:MovieClip;
public var myScore:TextField;
private var Main:MovieClip;
public function EndScreen(_arg1:MovieClip){
addFrameScript(0, frame1);
Main = _arg1;
this.myScore.text = String(Main.PlayerScore);
this.playAgainButtonEnd.addEventListener(MouseEvent.CLICK, returnToMain);
this.playAgainButtonEnd.useHandCursor = true;
this.playAgainButtonEnd.buttonMode = true;
}
private function returnToMain(_arg1:MouseEvent){
this.parent.removeChild(this);
Main.playGameAgain();
}
private function showReportScreen(_arg1:MouseEvent){
var _local2:*;
_local2 = new ReportScreen(Main);
_local2.x = this.x;
_local2.y = this.y;
this.parent.addChild(_local2);
this.parent.removeChild(this);
}
function frame1(){
stop();
}
private function showScoresScreen(_arg1){
var _local2:*;
_local2 = new HighScoreScreen(Main);
_local2.x = this.x;
_local2.y = this.y;
this.parent.addChild(_local2);
this.parent.removeChild(this);
}
}
}//package
Section 9
//Fire (Fire)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.filters.*;
public class Fire extends Sprite {
private var _fireWidth:uint;// = 350
private var _fireHeight:uint;// = 200
private var _gradientBox:Sprite;
private var _yoffset2:Number;// = 0
private var _yoffset3:Number;// = 0
private var _yoffset1:Number;// = 0
public function Fire(){
var _local1:Timer;
_yoffset1 = 0;
_yoffset2 = 0;
_yoffset3 = 0;
_fireWidth = 350;
_fireHeight = 200;
super();
_createGradient();
_local1 = new Timer(30);
_local1.addEventListener("timer", _createPerlinDisplacementMap);
_local1.start();
}
private function _createGradient():void{
var _local1:Matrix;
var _local2:Array;
var _local3:Array;
var _local4:Array;
_local1 = new Matrix();
_local1.createGradientBox(_fireWidth, _fireHeight, 4.71, 0, 0);
_local2 = [0xFF, 0xFF, 0xFF3300, 0xFF6600, 0xFFCC00, 0xFFCC00, 0xFFCC00];
_local3 = [0, 0.8, 0.9, 0.95, 1, 0.5, 0];
_local4 = [0, 50, 70, 90, 160, 200, 220];
_gradientBox = new Sprite();
_gradientBox.graphics.lineStyle();
_gradientBox.graphics.beginGradientFill(GradientType.RADIAL, _local2, _local3, _local4, _local1, SpreadMethod.PAD, InterpolationMethod.RGB, -1);
_gradientBox.graphics.drawRect(0, 0, _fireWidth, _fireHeight);
_gradientBox.graphics.endFill();
_gradientBox.cacheAsBitmap = true;
_gradientBox.y = -80;
_gradientBox.x = -120;
_gradientBox.alpha = 0;
addChild(_gradientBox);
}
private function _createPerlinDisplacementMap(_arg1:Event){
var _local2:Point;
var _local3:Point;
var _local4:Point;
var _local5:Point;
var _local6:Array;
var _local7:BitmapData;
var _local8:*;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:DisplacementMapFilter;
_local2 = new Point(0, (_yoffset1 = (_yoffset1 + (Math.random() * 50))));
_local3 = new Point(0, (_yoffset2 = (_yoffset2 + (Math.random() * 50))));
_local4 = new Point(0, (_yoffset3 = (_yoffset3 + (Math.random() * 50))));
_local5 = new Point(0, (_yoffset1 = (_yoffset1 + (Math.random() * 50))));
_local6 = [_local2, _local3, _local4];
_local7 = new BitmapData(_fireWidth, _fireHeight, false, 4278190080);
_local7.perlinNoise(50, 150, 3, 1000, false, false, BitmapDataChannel.RED, false, _local6);
_local8 = BitmapDataChannel.RED;
_local9 = Math.random();
_local10 = (_fireWidth * 0.3);
_local11 = (_fireHeight * 0.8);
_local12 = new DisplacementMapFilter(_local7, new Point(0, 0), _local8, _local8, _local10, _local11, DisplacementMapFilterMode.CLAMP, 0, 1);
_gradientBox.filters = [_local12];
if (_gradientBox.alpha != 100){
_gradientBox.alpha = 100;
};
}
}
}//package
Section 10
//girlStatements (girlStatements)
package {
import flash.display.*;
public class girlStatements extends MovieClip {
public var speech:Object;
public function girlStatements(){
speech = new Object();
super();
speech.StartTalk = "Welcome to Potions.\nThe Rules here are quite simple. You\nmay place a potion on the board by dragging\nit from your inventory to the board and putting\nit next to a potion of similar contents or shape.\n\nYour goal is to use the entire board, and turn all\nthe tiles to gold.\n\nWhen you fill an entire row, or column, that line will\ndisappear, and the tiles beneath will turn gold.\nAlso, there is fire jar next to your tiles, dragging\na tile to that will remove that potion from your inventory.\nBut you can only dispose of so many potions.\n\nClick Here to continue.";
speech.NoMoreMoves = "I'm sorry, there are no more legal moves.\nI'll reset the board.";
speech.CannotPlace = "You cannot place any new bottles.";
speech.level_1 = "Let's make it a little harder.\nI'm adding purple to the colors.";
speech.level_2 = "Let's make it a little harder.\nWe'll use add a Jar to the bottles.";
speech.level_3 = "Let's make it a little harder.\nI'm adding orange to the colors.";
speech.level_4 = "Let's make it a little harder.\nI'm adding the Double Flask to the bottles.";
speech.level_5 = "Let's make it a little harder.\nI'm adding yellow to the colors.";
speech.level_6 = "Let's make it a little harder.\nI'm adding pink to the colors.";
speech.level_7 = "Let's make it a little harder.\nI'm adding black to the colors.";
speech.level_8 = "All my colors and shapes are out.\nLet's see how good you think you are.";
speech.level_9 = "All my colors and shapes are out.\nLet's see how good you think you are.";
speech.level_10 = "All my colors and shapes are out.\nLet's see how good you think you are.";
speech.girlShoes = "Okay, you can have my shoes.";
speech.girlDress = "You've won my dress.\nGood thing it's a nice night.";
speech.girlStockings = "You've had it easy so far,\nso here's my stockings.\nNow it gets harder.";
speech.girlBra = "Yes, they're Natural.\nFew people get to see them.\nCount yourself lucky.";
speech.girlPanties = "I've nothing left to give up.\nCongratulations, you've mastered all my levels.";
speech.EndFire = "I'm sorry. The game is over.\nYou've broken your jar and we can't work\nwithout one.";
}
}
}//package
Section 11
//Gypsy (Gypsy)
package {
import flash.display.*;
public dynamic class Gypsy extends MovieClip {
public var girlNude:MovieClip;
public var girlDress:MovieClip;
public var girlShoes:MovieClip;
public var girlStockings:MovieClip;
public var girlPanties:MovieClip;
public var girlBra:MovieClip;
}
}//package
Section 12
//HighScoreScreen (HighScoreScreen)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
public class HighScoreScreen extends MovieClip {
private var scoreMC:MovieClip;
private var Main:MovieClip;
public var restartButtonScore:MovieClip;
public function HighScoreScreen(_arg1:MovieClip){
var _local2:Responder;
scoreMC = new MovieClip();
super();
addFrameScript(0, frame1);
Main = _arg1;
scoreMC.x = 80;
scoreMC.y = 60;
this.addChild(scoreMC);
_local2 = new Responder(gotHighScore, Main.remotingOnFault);
Main.gateway.call("TRG.getHighScores", _local2, Main.gameID);
this.restartButtonScore.addEventListener(MouseEvent.CLICK, returnToMain);
}
private function gotHighScore(_arg1){
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
_local2 = 0;
_local3 = 0;
_local4 = new TextFormat();
_local4.font = "BoisterBlack";
_local4.size = 14;
_local4.bold = false;
_local4.color = 0;
_local5 = 0;
while (_local5 < _arg1.length) {
_local4.align = "right";
_local6 = new TextField();
_local6.embedFonts = true;
_local6.selectable = false;
_local6.defaultTextFormat = _local4;
_local6.autoSize = TextFieldAutoSize.LEFT;
_local6.text = _arg1[_local5].Score;
_local6.x = -(_local6.width);
_local6.y = _local3;
_local4.align = "left";
_local7 = new TextField();
_local7.embedFonts = true;
_local7.selectable = false;
_local7.defaultTextFormat = _local4;
_local7.autoSize = TextFieldAutoSize.LEFT;
_local7.text = _arg1[_local5].Name;
_local7.x = 20;
_local7.y = _local3;
_local3 = (_local3 + (_local6.height + 3));
scoreMC.addChild(_local6);
scoreMC.addChild(_local7);
_local5++;
};
}
private function returnToMain(_arg1:MouseEvent){
this.parent.removeChild(this);
Main.playGameAgain();
}
function frame1(){
stop();
}
}
}//package
Section 13
//LevelText (LevelText)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
public class LevelText extends Sprite {
private var burstSprite:Sprite;
private var animSteps:int;// = 10
private var animTimer:Timer;
private var parentMC:MovieClip;
private var tField:TextField;
static const fontColor:Number = 0xFFFFFF;
static const animStepTime:int = 50;
static const fontFace:String = "BoisterBlack";
static const fontSize:int = 80;
static const dropTextBy:int = 10;
static const endScale:Number = 2;
static const startScale:Number = 0;
static const fontBold:Boolean = true;
public function LevelText(_arg1:MovieClip, _arg2:Object, _arg3, _arg4:Number){
var _local5:TextFormat;
animSteps = 10;
super();
_local5 = new TextFormat();
_local5.font = fontFace;
_local5.size = fontSize;
_local5.bold = fontBold;
_local5.color = fontColor;
_local5.align = "center";
tField = new TextField();
tField.embedFonts = true;
tField.selectable = false;
tField.defaultTextFormat = _local5;
tField.autoSize = TextFieldAutoSize.CENTER;
tField.text = String(_arg2);
tField.x = -((tField.width / 2));
tField.y = -((tField.height / 2));
burstSprite = new Sprite();
burstSprite.x = _arg3;
burstSprite.y = -((tField.height * 1.5));
burstSprite.alpha = 1;
burstSprite.addChild(tField);
parentMC = _arg1;
parentMC.addChild(burstSprite);
animSteps = (Math.abs((burstSprite.y - _arg4)) / dropTextBy);
trace(animSteps);
animTimer = new Timer(animStepTime, animSteps);
animTimer.addEventListener(TimerEvent.TIMER, dropText);
animTimer.addEventListener(TimerEvent.TIMER_COMPLETE, startFade);
animTimer.start();
}
private function startFade(_arg1:TimerEvent){
var _local2:*;
_local2 = new Timer(10, 25);
_local2.addEventListener(TimerEvent.TIMER, fadeText);
_local2.addEventListener(TimerEvent.TIMER_COMPLETE, removeText);
_local2.start();
}
private function dropText(_arg1:TimerEvent){
burstSprite.y = (burstSprite.y + dropTextBy);
}
private function fadeText(_arg1:TimerEvent){
burstSprite.alpha = (burstSprite.alpha - 0.04);
}
private function removeText(_arg1:TimerEvent){
burstSprite.removeChild(tField);
parentMC.removeChild(burstSprite);
tField = null;
burstSprite = null;
delete ??getglobalscope
[this];
}
}
}//package
Section 14
//OpenScreen (OpenScreen)
package {
import flash.events.*;
import flash.display.*;
public class OpenScreen extends MovieClip {
public var startGameButton:MovieClip;
private var Main:MovieClip;
public function OpenScreen(_arg1:MovieClip){
Main = _arg1;
this.startGameButton.addEventListener(MouseEvent.CLICK, Main.initPotionGame);
this.startGameButton.useHandCursor = true;
this.startGameButton.buttonMode = true;
}
private function showHighScores(_arg1:MouseEvent){
var _local2:*;
_local2 = new HighScoreScreen(Main);
_local2.x = this.x;
_local2.y = this.y;
this.parent.addChild(_local2);
this.parent.removeChild(this);
}
}
}//package
Section 15
//PointBurst (PointBurst)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
public class PointBurst extends Sprite {
private var burstSprite:Sprite;
private var animTimer:Timer;
private var parentMC:MovieClip;
private var tField:TextField;
static const animStepTime:int = 50;
static const fontSize:int = 18;
static const fontFace:String = "BoisterBlack";
static const fontBold:Boolean = false;
static const animSteps:int = 10;
static const startScale:Number = 0;
static const fontColor:Number = 0xFF00FF;
static const endScale:Number = 2;
public function PointBurst(_arg1:MovieClip, _arg2:Object, _arg3, _arg4:Number){
var _local5:TextFormat;
super();
_local5 = new TextFormat();
_local5.font = fontFace;
_local5.size = fontSize;
_local5.bold = fontBold;
_local5.color = fontColor;
_local5.align = "center";
tField = new TextField();
tField.embedFonts = true;
tField.selectable = false;
tField.defaultTextFormat = _local5;
tField.autoSize = TextFieldAutoSize.CENTER;
tField.text = String(_arg2);
tField.x = -((tField.width / 2));
tField.y = -((tField.height / 2));
burstSprite = new Sprite();
burstSprite.x = _arg3;
burstSprite.y = _arg4;
burstSprite.scaleX = startScale;
burstSprite.scaleY = startScale;
burstSprite.alpha = 0;
burstSprite.addChild(tField);
parentMC = _arg1;
parentMC.addChild(burstSprite);
animTimer = new Timer(animStepTime, animSteps);
animTimer.addEventListener(TimerEvent.TIMER, rescaleBurst);
animTimer.addEventListener(TimerEvent.TIMER_COMPLETE, removeBurst);
animTimer.start();
}
public function removeBurst(_arg1:TimerEvent){
burstSprite.removeChild(tField);
parentMC.removeChild(burstSprite);
tField = null;
burstSprite = null;
delete ??getglobalscope
[this];
}
public function rescaleBurst(_arg1:TimerEvent){
var _local2:Number;
_local2 = (_arg1.target.currentCount / animSteps);
burstSprite.scaleX = (((1 - _local2) * startScale) + (_local2 * endScale));
burstSprite.scaleY = (((1 - _local2) * startScale) + (_local2 * endScale));
burstSprite.alpha = (1 - _local2);
}
}
}//package
Section 16
//potionMain (potionMain)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.media.*;
import flash.net.*;
import flash.utils.*;
public class potionMain extends MovieClip {
public var shapeMax:Number;// = 3
private var speechBubbleX:Number;// = 675
private var speechBubbleY:Number;// = 210
private var girlClothes:Array;
public var BottleArray:Array;
public var PlayerScore:Number;// = 0
public var myFire:Fire;
public var music:BGMusic;
public var TileArray:Array;
public var sandLot:MovieClip;
public var playerScore:TextField;
public var InvenArray:Array;
public var gateway:RemotingConnection;
private var musicPlaying:Boolean;// = false
private var BottleShapes:Array;
public var gameID:String;// = "TRGPP21"
private var lastLevel:Number;// = 0
public var TileSpacer;// = 2
public var girl:girlStatements;
public var trans:SoundTransform;
private var gatewayURL:String;// = "http://www.trappedratgames.com/_amfgate/gateway.php"
private var volumeOn:Boolean;// = true
public var gameLevel:Number;// = 0
public var LotSpacer;// = 8
public var skyZoneMC:SkyZone;
public var bottlesDiscarded:Number;// = 0
private var openScreenWindow:MovieClip;
public var bottleCount:Number;// = 0
public var cols:Number;// = 7
private var BottleColors:Array;
public var colorMax:Number;// = 3
public var channel:SoundChannel;
public var sphereZone:SpheresZone;
public var benLink:TextField;
public var mattLink:TextField;
public var clearedTiles:Number;// = 0
public var playerBottles:Number;// = 5
public var LotBounds:MovieClip;
private var resetRunning:Timer;
private var fadingCloth:String;
public var LotZoneX:Number;
public var LotZoneY:Number;
private var resetButton:MovieClip;
public var myPlayerCounter:TextField;
public var TRG_ID;// = "TRGPP21"
public var TileWidth;// = 56
public var TileHeight;// = 56
private var musicVolume:Number;// = 0.4
private var lastScore:Number;// = 0
public var myBowl:MovieClip;
public var seedBottles:Number;// = 4
public var rows:Number;// = 7
public var myVolume:volumeControl;
public var girlMovie:Gypsy;
private var endScreenWindow:MovieClip;
public var TileZoneX:Number;
public var TileZoneY:Number;
static var AreaWidth = 500;
public function potionMain(){
TRG_ID = "TRGPP21";
TileArray = new Array();
BottleArray = new Array();
InvenArray = new Array();
BottleShapes = new Array("flask", "oval", "squat", "jar", "bubble");
BottleColors = new Array("red", "blue", "green", "purple", "orange", "yellow", "pink", "black");
girlClothes = new Array("girlShoes", "girlDress", "girlStockings", "girlBra", "girlPanties");
rows = 7;
cols = 7;
seedBottles = 4;
playerBottles = 5;
bottleCount = 0;
shapeMax = 3;
colorMax = 3;
PlayerScore = 0;
clearedTiles = 0;
gameLevel = 0;
bottlesDiscarded = 0;
TileWidth = 56;
TileHeight = 56;
TileSpacer = 2;
LotSpacer = 8;
lastLevel = 0;
lastScore = 0;
girl = new girlStatements();
speechBubbleX = 675;
speechBubbleY = 210;
musicVolume = 0.4;
gatewayURL = "http://www.trappedratgames.com/_amfgate/gateway.php";
gameID = "TRGPP21";
music = new BGMusic();
trans = new SoundTransform(musicVolume, 0);
musicPlaying = false;
volumeOn = true;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3);
potionMainStartup();
}
public function startReset(_arg1:MouseEvent){
resetRunning = new Timer(10);
resetRunning.addEventListener(TimerEvent.TIMER, spinReset);
resetRunning.start();
}
public function startPotionGame(){
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:SpillZone;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:*;
var _local13:*;
var _local14:*;
var _local15:*;
var _local16:*;
_local1 = -1;
while (_local1 <= rows) {
BottleArray[_local1] = new Array();
_local14 = -1;
while (_local14 <= cols) {
BottleArray[_local1][_local14] = false;
_local14++;
};
_local1++;
};
_local2 = new Fire();
_local2.width = 40;
_local2.height = 60;
_local2.x = 40;
_local2.y = 530;
this.addChild(_local2);
myFire = _local2;
_local3 = new Bowl();
_local3.x = 50;
_local3.y = 550;
this.addChild(_local3);
myBowl = _local3;
_local4 = ((cols * (TileWidth + TileSpacer)) - TileSpacer);
_local5 = ((rows * (TileWidth + TileSpacer)) - TileSpacer);
_local6 = (((4 * LotSpacer) + _local4) - TileSpacer);
_local7 = (((4 * LotSpacer) + _local5) - TileSpacer);
LotZoneY = (LotZoneX = ((AreaWidth / 2) - (_local6 / 2)));
TileZoneY = (TileZoneX = (LotZoneX + LotSpacer));
_local8 = new SpillZone();
_local8.y = LotZoneX;
_local8.x = LotZoneY;
_local8.width = _local6;
_local8.height = _local7;
this.addChild(_local8);
sandLot = _local8;
LotBounds = new MovieClip();
LotBounds.graphics.lineStyle(4, 0, 1);
LotBounds.graphics.moveTo(LotZoneX, LotZoneY);
LotBounds.graphics.lineTo((LotZoneX + _local6), LotZoneY);
LotBounds.graphics.lineTo((LotZoneX + _local6), (LotZoneY + _local7));
LotBounds.graphics.lineTo(LotZoneX, (LotZoneY + _local7));
LotBounds.graphics.lineTo(LotZoneX, LotZoneY);
this.addChild(LotBounds);
_local9 = 0;
while (_local9 < rows) {
TileArray[_local9] = new Array();
_local15 = 0;
while (_local15 < cols) {
_local16 = new Tile(this, _local9, _local15);
_local16.name = ((("tile_" + _local9) + "_") + _local15);
_local16.x = ((TileZoneX + (TileWidth / 2)) + (_local15 * (TileWidth + (2 * TileSpacer))));
_local16.y = ((TileZoneX + (TileHeight / 2)) + (_local9 * (TileHeight + (2 * TileSpacer))));
_local16.width = TileWidth;
_local16.height = TileHeight;
this.addChild(_local16);
TileArray[_local9][_local15] = _local16;
_local15++;
};
_local9++;
};
_local10 = 0;
while (_local10 < seedBottles) {
placeStartingBottle();
_local10++;
};
setupBottleInventory();
_local11 = new SpeechBubble(this, girl.speech.StartTalk, speechBubbleX, speechBubbleY, 15);
_local12 = new buttonLevelReset(this);
_local12.x = 760;
_local12.y = 560;
resetButton = _local12;
this.addChild(_local12);
_local13 = new LevelText(this, ("LEVEL " + (gameLevel + 1)), 250, 250);
}
private function spinReset(_arg1:TimerEvent){
resetButton.rotation = (resetButton.rotation - 6);
}
private function showFinalScreen(_arg1:TimerEvent){
var _local2:*;
_local2 = new EndScreen(this);
_local2.x = 490;
_local2.y = 250;
this.addChild(_local2);
endScreenWindow = _local2;
}
function frame3(){
stop();
}
function frame1(){
stop();
}
public function stopReset(_arg1:MouseEvent){
resetRunning.stop();
resetRunning.removeEventListener(TimerEvent.TIMER, spinReset);
}
function frame2(){
stop();
}
public function remotingOnFault(_arg1:String):void{
trace("onFault invoked");
trace(_arg1);
}
public function checkForUnsolvableBoard(){
var _local1:Boolean;
var _local2:Boolean;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:*;
_local1 = true;
_local2 = true;
_local3 = 0;
while (_local3 < rows) {
_local4 = 0;
while (_local4 < cols) {
if (!TileArray[_local3][_local4].TileSeen){
_local1 = false;
};
if (BottleArray[_local3][_local4] != false){
_local2 = false;
};
_local4++;
};
_local3++;
};
if ((((_local1 == false)) && ((_local2 == true)))){
_local5 = new SpeechBubble(this, girl.speech.CannotPlace, speechBubbleX, speechBubbleY, 15);
PlayerScore = lastScore;
updateScore(0);
resetTiles();
} else {
_local6 = false;
_local7 = 0;
_local8 = 0;
while (_local8 < rows) {
_local9 = 0;
while (_local9 < cols) {
_local10 = 0;
while (_local10 < InvenArray.length) {
_local11 = InvenArray[_local10].checkTilesForMatch(_local8, _local9);
if (_local11){
_local6 = true;
break;
};
if (TileArray[_local8][_local9].TileSeen){
_local7++;
};
_local10++;
};
if (_local6){
break;
};
_local9++;
};
if (_local6){
break;
};
_local8++;
};
if (((!(_local6)) && ((_local7 < (rows * cols))))){
_local12 = new SpeechBubble(this, girl.speech.NoMoreMoves, speechBubbleX, speechBubbleY, 15);
PlayerScore = lastScore;
updateScore(0);
resetTiles();
};
};
}
public function clearBoard(){
var _local1:Boolean;
var _local2:Boolean;
var _local3:*;
var _local4:Boolean;
var _local5:String;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
_local1 = true;
_local2 = true;
_local3 = 0;
while (_local3 < rows) {
_local7 = 0;
while (_local7 < cols) {
if (BottleArray[_local3][_local7]){
_local1 = false;
};
if (!TileArray[_local3][_local7].TileGold){
_local2 = false;
};
_local7++;
};
_local3++;
};
if (((_local1) && (_local2))){
updateScore(2500);
_local8 = new PointBurst(this, "Double Bonus! +2500", (sandLot.x + (sandLot.width / 2)), (sandLot.y + (sandLot.height / 2)));
} else {
if (_local1){
updateScore(500);
_local9 = new PointBurst(this, "No Bottles +500", (sandLot.x + (sandLot.width / 2)), (sandLot.y + (sandLot.height / 2)));
} else {
if (_local2){
updateScore(500);
_local10 = new PointBurst(this, "All Gold +500", (sandLot.x + (sandLot.width / 2)), (sandLot.y + (sandLot.height / 2)));
};
};
};
lastLevel = gameLevel;
lastScore = PlayerScore;
gameLevel++;
_local4 = false;
if (((((gameLevel % 2) == 1)) || ((_local4 == true)))){
colorMax++;
if (colorMax >= BottleColors.length){
colorMax = BottleColors.length;
};
};
if ((gameLevel % 2) == 0){
shapeMax++;
if (shapeMax >= BottleShapes.length){
shapeMax = BottleShapes.length;
};
if (shapeMax == BottleShapes.length){
_local4 = true;
};
};
fadingCloth = girlClothes.shift();
_local5 = girl.speech[fadingCloth];
clothesFadeOut(fadingCloth);
_local6 = new SpeechBubble(this, _local5, speechBubbleX, speechBubbleY, 8);
resetTiles();
}
public function resetBoard(){
var _local1:*;
clearedTiles = 0;
_local1 = 0;
while (_local1 < seedBottles) {
placeStartingBottle();
_local1++;
};
setupBottleInventory();
}
public function potionMainStartup(){
var _local1:*;
_local1 = new OpenScreen(this);
_local1.x = 150;
_local1.y = 160;
openScreenWindow = _local1;
if (!musicPlaying){
channel = music.play(0, 150, trans);
musicPlaying = true;
};
this.addChild(_local1);
this.myVolume.addEventListener(MouseEvent.CLICK, soundOnOff);
}
private function fadeCloth(_arg1:TimerEvent){
var _local2:*;
_local2 = root["girlMovie"][fadingCloth];
_local2.alpha = (_local2.alpha - 0.02);
}
public function shiftInventory(){
var _local1:*;
var _local2:*;
var _local3:*;
_local1 = 150;
_local2 = 0;
while (_local2 < InvenArray.length) {
_local3 = (_local1 + (_local2 * 72));
InvenArray[_local2].x = _local3;
_local2++;
};
if (InvenArray.length < playerBottles){
setupBottleInventory();
};
}
private function placeStartingBottle(){
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
_local1 = Math.floor((Math.random() * rows));
_local2 = Math.floor((Math.random() * cols));
if (!BottleArray[_local1][_local2]){
_local3 = BottleShapes[Math.floor((Math.random() * shapeMax))];
_local4 = BottleColors[Math.floor((Math.random() * colorMax))];
_local5 = new Bottle(this, _local3, _local4);
_local5.x = TileArray[_local1][_local2].x;
_local5.y = TileArray[_local1][_local2].y;
_local5.isMovable = false;
_local5.bottleID = ("b_" + bottleCount);
_local5.bottleRow = _local1;
_local5.bottleCol = _local2;
_local5.width = (TileWidth - (TileSpacer * 3));
_local5.height = (TileHeight - (TileSpacer * 3));
bottleCount++;
this.addChild(_local5);
BottleArray[_local1][_local2] = _local5;
TileArray[_local1][_local2].Lighten();
} else {
placeStartingBottle();
};
}
private function cleanInventory(){
var _local1:*;
for (_local1 in InvenArray) {
if (InvenArray[_local1]){
this.removeChild(InvenArray[_local1]);
InvenArray.splice(_local1, 1);
};
};
if (InvenArray.length > 0){
cleanInventory();
};
}
public function checkForEndLevel(){
var _local1:Boolean;
var _local2:*;
var _local3:*;
_local1 = true;
_local2 = 0;
while (_local2 < rows) {
_local3 = 0;
while (_local3 < cols) {
if (!TileArray[_local2][_local3].TileSeen){
_local1 = false;
};
_local3++;
};
_local2++;
};
if (_local1){
clearBoard();
};
}
public function soundOnOff(_arg1:MouseEvent){
var _local2:*;
var _local3:*;
if (volumeOn == true){
_local2 = new SoundTransform(0, 0);
channel.soundTransform = _local2;
volumeOn = false;
myVolume.gotoAndStop(2);
} else {
_local3 = new SoundTransform(musicVolume, 0);
channel.soundTransform = _local3;
volumeOn = true;
myVolume.gotoAndStop(1);
};
}
public function updateScore(_arg1:Number){
PlayerScore = (PlayerScore + _arg1);
this.playerScore.text = String(PlayerScore);
}
public function endGameFire(){
var _local1:*;
_local1 = new SpeechBubble(this, girl.speech.EndFire, speechBubbleX, speechBubbleY, 10);
winGame();
}
public function initPotionGame(_arg1:MouseEvent){
BottleShapes = new Array("flask", "oval", "squat", "jar", "bubble");
BottleColors = new Array("red", "blue", "green", "purple", "orange", "yellow", "pink", "black");
girlClothes = new Array("girlShoes", "girlDress", "girlStockings", "girlBra", "girlPanties");
PlayerScore = 0;
clearedTiles = 0;
gameLevel = 0;
bottlesDiscarded = 0;
shapeMax = 3;
colorMax = 3;
this.removeChild(openScreenWindow);
this.gotoAndStop("Game Screen");
startPotionGame();
}
private function scrollGirlEnd(_arg1:TimerEvent){
var _local2:*;
_local2 = root["girlMovie"];
_local2.y = (_local2.y + 2);
}
public function launchTRGSite(_arg1:MouseEvent){
var _local2:String;
var _local3:URLVariables;
var _local4:URLRequest;
_local2 = "http://www.trappedratgames.com";
_local3 = new URLVariables();
_local4 = new URLRequest(_local2);
_local4.data = _local3;
navigateToURL(_local4);
}
public function resetTiles(){
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
_local1 = 0;
while (_local1 < rows) {
_local4 = 0;
while (_local4 < cols) {
if (BottleArray[_local1][_local4]){
this.removeChild(BottleArray[_local1][_local4]);
BottleArray[_local1][_local4] = false;
};
TileArray[_local1][_local4].gotoAndPlay("FadeBack");
TileArray[_local1][_local4].TileSeen = false;
TileArray[_local1][_local4].TileGold = false;
_local4++;
};
_local1++;
};
_local2 = new LevelText(this, ("LEVEL " + (gameLevel + 1)), 250, 250);
_local3 = new Timer(3000, 1);
_local3.addEventListener(TimerEvent.TIMER_COMPLETE, tempReset);
_local3.start();
}
private function checkForWin(_arg1:TimerEvent){
if (girlClothes.length == 0){
winGame();
};
}
public function resetToLastLevel(_arg1:MouseEvent){
PlayerScore = lastScore;
updateScore(0);
resetTiles();
}
private function keyBoardListener(_arg1:KeyboardEvent){
var _local2:*;
var _local3:*;
if (_arg1.keyCode == 88){
_local2 = root["girlMovie"];
this.removeChild(openScreenWindow);
_local3 = 0;
while (_local3 < girlClothes.length) {
_local2[girlClothes[_local3]].visible = false;
_local3++;
};
winGame();
};
}
public function playGameAgain(){
var _local1:*;
var _local2:*;
var _local3:*;
_local1 = root["girlMovie"];
_local1.scaleX = (_local1.scaleY = 0.664962768554688);
_local1.x = 542;
_local1.y = 32;
_local2 = new Array("girlShoes", "girlDress", "girlStockings", "girlBra", "girlPanties");
for (_local3 in _local2) {
_local1[_local2[_local3]].alpha = 1;
_local1[_local2[_local3]].visible = true;
};
this.gotoAndStop(1);
potionMainStartup();
}
private function quickEnd(_arg1:TimerEvent){
winGame();
}
private function clothesFadeOut(_arg1){
var _local2:*;
_local2 = new Timer(5, 50);
_local2.addEventListener(TimerEvent.TIMER, fadeCloth);
_local2.addEventListener(TimerEvent.TIMER_COMPLETE, checkForWin);
_local2.start();
}
private function tempReset(_arg1:TimerEvent){
resetBoard();
}
public function setupBottleInventory(){
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
_local1 = 550;
_local2 = 150;
_local3 = InvenArray.length;
while (_local3 < playerBottles) {
_local4 = (_local2 + (_local3 * 72));
_local5 = BottleShapes[Math.floor((Math.random() * shapeMax))];
_local6 = BottleColors[Math.floor((Math.random() * colorMax))];
_local7 = new Bottle(this, _local5, _local6);
_local7.x = _local4;
_local7.y = _local1;
_local7.isMovable = true;
_local7.bottleID = ("b_" + bottleCount);
_local7.width = (TileWidth - (TileSpacer * 3));
_local7.height = (TileHeight - (TileSpacer * 3));
this.addChild(_local7);
InvenArray.push(_local7);
bottleCount++;
_local3++;
};
}
public function winGame(){
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
_local1 = 0;
while (_local1 < rows) {
_local4 = 0;
while (_local4 < cols) {
if (((((BottleArray) && (BottleArray[_local1]))) && (BottleArray[_local1][_local4]))){
this.removeChild(BottleArray[_local1][_local4]);
};
if (((((TileArray) && (TileArray[_local1]))) && (TileArray[_local1][_local4]))){
TileArray[_local1][_local4].TileSeen = false;
TileArray[_local1][_local4].TileGold = false;
this.removeChild(TileArray[_local1][_local4]);
};
_local4++;
};
_local1++;
};
if (sandLot){
this.removeChild(sandLot);
};
if (LotBounds){
this.removeChild(LotBounds);
};
if (myFire){
this.removeChild(myFire);
};
if (myBowl){
this.removeChild(myBowl);
};
if (resetButton){
this.removeChild(resetButton);
};
cleanInventory();
this.gotoAndStop("End Screen");
_local2 = root["girlMovie"];
_local2.oldScale = _local2.scaleX;
_local2.oldX = _local2.x;
_local2.oldY = _local2.y;
_local2.scaleX = (_local2.scaleY = 2.25);
_local2.x = 15;
_local2.y = -1200;
_local3 = new Timer(1, 610);
_local3.addEventListener(TimerEvent.TIMER, scrollGirlEnd);
_local3.addEventListener(TimerEvent.TIMER_COMPLETE, showFinalScreen);
_local3.start();
}
}
}//package
Section 17
//RemotingConnection (RemotingConnection)
package {
import flash.net.*;
public class RemotingConnection extends NetConnection {
public var Connected:Boolean;// = false
public function RemotingConnection(_arg1:String){
var _local2:Responder;
Connected = false;
super();
objectEncoding = ObjectEncoding.AMF0;
if (_arg1){
connect(_arg1);
};
_local2 = new Responder(isAlive, remotingOnFault);
this.call("TRG.getAlive", _local2);
}
private function isAlive(_arg1){
Connected = true;
}
public function remotingOnFault(_arg1:String):void{
trace("onFault invoked");
trace(_arg1);
}
}
}//package
Section 18
//ReportScreen (ReportScreen)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
public class ReportScreen extends MovieClip {
public var reportButtonReport:MovieClip;
public var reportUserName:TextField;
public var myScore:TextField;
private var Main:MovieClip;
public function ReportScreen(_arg1:MovieClip){
addFrameScript(0, frame1);
Main = _arg1;
this.myScore.text = String(Main.PlayerScore);
reportButtonReport.addEventListener(MouseEvent.CLICK, submitReportScore);
reportButtonReport.useHandCursor = true;
}
private function sentHighScore(_arg1){
var _local2:*;
_local2 = new HighScoreScreen(Main);
_local2.x = this.x;
_local2.y = this.y;
this.parent.addChild(_local2);
this.parent.removeChild(this);
}
function frame1(){
stop();
}
private function submitReportScore(_arg1:MouseEvent){
var _local2:Responder;
_local2 = new Responder(sentHighScore, Main.remotingOnFault);
Main.gateway.call("TRG.writeHighScore", _local2, Main.gameID, this.reportUserName.text.toString(), Main.PlayerScore);
}
}
}//package
Section 19
//skyStar (skyStar)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class skyStar extends MovieClip {
private var Main;
private var alphaTrans;// = 1
public function skyStar(_arg1, _arg2, _arg3){
var _local4:*;
var _local5:Timer;
alphaTrans = 1;
super();
this.alpha = 0.01;
_local4 = ((Math.random() * 0.4) + 0.6);
this.scaleX = (this.scaleY = _local4);
this.x = _arg2;
this.y = _arg3;
Main = _arg1;
_local5 = new Timer(15, Math.floor((Math.random() * 1000)));
_local5.addEventListener(TimerEvent.TIMER, blinkStar);
_local5.addEventListener(TimerEvent.TIMER_COMPLETE, fadeStar);
_local5.start();
}
private function shrinkStar(_arg1){
var _local2:*;
this.alpha = (this.alpha - 0.05);
_local2 = (this.scaleX * 0.8);
this.scaleX = (this.scaleY = _local2);
}
private function blinkStar(_arg1){
this.alpha = (this.alpha + (0.01 * alphaTrans));
if (this.alpha >= 1){
alphaTrans = -1;
} else {
if (this.alpha <= 0.4){
alphaTrans = 1;
};
};
}
private function fadeStar(_arg1){
var _local2:Timer;
_local2 = new Timer(10, Math.floor((Math.random() * 3000)));
_local2.addEventListener(TimerEvent.TIMER, shrinkStar);
_local2.addEventListener(TimerEvent.TIMER_COMPLETE, removeStar);
_local2.start();
}
private function removeStar(_arg1){
Main.currentStar--;
this.parent.removeChild(this);
}
}
}//package
Section 20
//SkyZone (SkyZone)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class SkyZone extends MovieClip {
private var maxStars;// = 10
public var currentStar;// = 0
private var randTime;
public function SkyZone(){
maxStars = 10;
currentStar = 0;
super();
randTime = Math.floor((Math.random() * 1000));
}
private function createStar(_arg1){
var _local2:*;
var _local3:Timer;
var _local4:*;
var _local5:*;
var _local6:*;
if (currentStar < maxStars){
_local4 = (Math.floor((Math.random() * 760)) + 20);
_local5 = (Math.floor((Math.random() * 300)) + 20);
_local6 = new skyStar(this, _local4, _local5);
new skyStar(this, _local4, _local5).width = (_local6.height = 2);
this.addChild(_local6);
currentStar++;
};
_local2 = Math.floor((Math.random() * 3000));
_local3 = new Timer(_local2, 100);
randTime = Math.floor((Math.random() * 10000));
_local3.addEventListener(TimerEvent.TIMER_COMPLETE, createStar);
_local3.start();
}
}
}//package
Section 21
//smackDown (smackDown)
package {
import flash.display.*;
public dynamic class smackDown extends MovieClip {
}
}//package
Section 22
//SpeechBubble (SpeechBubble)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
public class SpeechBubble extends Sprite {
private var burstSprite:Sprite;
private var bubbleZone:MovieClip;
private var animTimer:Timer;
private var parentMC:MovieClip;
private var tField:TextField;
private var animStepTime:int;// = 200
static const bubbleColor:Number = 0xFFFFFF;
static const startScale:Number = 1;
static const maxWidth:Number = 250;
static const fontSize:int = 12;
static const fontFace:String = "BoisterBlack";
static const fontBold:Boolean = false;
static const animSteps:int = 50;
static const fontColor:Number = 0;
static const endScale:Number = 1;
public function SpeechBubble(_arg1:MovieClip, _arg2:String, _arg3, _arg4:Number, _arg5:Number){
var _local6:TextFormat;
var _local7:Shape;
var _local8:Shape;
animStepTime = 200;
super();
animStepTime = ((_arg5 * 1000) / animSteps);
_local6 = new TextFormat();
_local6.font = fontFace;
_local6.size = fontSize;
_local6.bold = fontBold;
_local6.color = fontColor;
_local6.align = "center";
tField = new TextField();
tField.embedFonts = true;
tField.selectable = false;
tField.defaultTextFormat = _local6;
tField.autoSize = TextFieldAutoSize.CENTER;
tField.text = _arg2.toString();
tField.x = -((tField.width / 2));
tField.y = -((tField.height / 2));
_local7 = new Shape();
_local7.graphics.lineStyle(3, bubbleColor, 1);
_local7.graphics.beginFill(bubbleColor, 1);
_local7.graphics.drawEllipse(0, 0, (tField.width * 1.25), (tField.height * 1.25));
_local7.graphics.endFill();
_local7.x = -((_local7.width / 2));
_local7.y = -((_local7.height / 2));
burstSprite = new Sprite();
burstSprite.x = -((_local7.width / 3));
burstSprite.y = (_local7.height / 4);
burstSprite.addChild(_local7);
burstSprite.addChild(tField);
_local8 = new Shape();
_local8.graphics.lineStyle(3, bubbleColor, 1);
_local8.graphics.beginFill(bubbleColor);
_local8.graphics.moveTo((burstSprite.x / 2), (burstSprite.y / 2));
_local8.graphics.curveTo(((burstSprite.x / 2) + 175), ((burstSprite.y / 2) - 50), 0, -100);
_local8.graphics.curveTo(((burstSprite.x / 2) + 200), ((burstSprite.y / 2) - 50), ((burstSprite.x / 2) + 50), (burstSprite.y / 2));
_local8.graphics.endFill();
bubbleZone = new MovieClip();
bubbleZone.x = _arg3;
bubbleZone.y = _arg4;
bubbleZone.scaleX = startScale;
bubbleZone.scaleY = startScale;
bubbleZone.alpha = 1;
bubbleZone.addChild(_local8);
bubbleZone.addChild(burstSprite);
parentMC = _arg1;
parentMC.addChild(bubbleZone);
animTimer = new Timer(animStepTime, animSteps);
animTimer.addEventListener(TimerEvent.TIMER_COMPLETE, removeBurst);
animTimer.start();
bubbleZone.addEventListener(MouseEvent.CLICK, removeBurst);
}
public function removeBurst(_arg1){
animTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, removeBurst);
bubbleZone.removeEventListener(MouseEvent.CLICK, removeBurst);
burstSprite.removeChild(tField);
bubbleZone.removeChild(burstSprite);
parentMC.removeChild(bubbleZone);
tField = null;
burstSprite = null;
bubbleZone = null;
delete ??getglobalscope
[this];
}
}
}//package
Section 23
//SpheresZone (SpheresZone)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class SpheresZone extends MovieClip {
private var randTime;
private var maxWisps;// = 10
public var currentWisp;// = 0
public function SpheresZone(){
var _local1:Timer;
maxWisps = 10;
currentWisp = 0;
super();
randTime = Math.floor((Math.random() * 6000));
_local1 = new Timer(randTime);
_local1.addEventListener(TimerEvent.TIMER, createWisp);
_local1.start();
}
private function createWisp(_arg1){
var _local2:*;
var _local3:Timer;
var _local4:*;
var _local5:*;
var _local6:*;
if (currentWisp < maxWisps){
_local4 = Math.floor((Math.random() * 280));
_local5 = (Math.floor((Math.random() * 150)) + 300);
_local6 = new willoWisp(this, _local4, _local5);
this.addChild(_local6);
currentWisp++;
};
_local2 = Math.floor((Math.random() * 3000));
_local3 = new Timer(_local2, 100);
randTime = Math.floor((Math.random() * 10000));
_local3.addEventListener(TimerEvent.TIMER_COMPLETE, createWisp);
_local3.start();
}
}
}//package
Section 24
//spilledGoo (spilledGoo)
package {
import flash.display.*;
import flash.geom.*;
public class spilledGoo extends MovieClip {
public var Goo:MovieClip;
private var Colors:Object;
public function spilledGoo(_arg1:MovieClip, _arg2:Number, _arg3:Number){
var _local4:*;
var _local5:ColorTransform;
Colors = new Object();
super();
addFrameScript(54, frame55);
Colors.blue = 153;
Colors.red = 0x990000;
Colors.pink = 16751052;
Colors.green = 0xFF00;
Colors.purple = 0x990099;
Colors.orange = 0xFF6600;
Colors.yellow = 0xFF00FF;
Colors.black = 0;
trace(((("Creating spilled goo at: " + _arg2) + " ") + _arg3));
this.alpha = 0.5;
this.x = ((_arg1.TileArray[_arg2][_arg3].x - _arg1.sandLot.x) + _arg1.TileWidth);
this.y = ((_arg1.TileArray[_arg2][_arg3].y - _arg1.sandLot.y) + _arg1.TileHeight);
_local4 = _arg1.BottleArray[_arg2][_arg3].bottleColor;
_local5 = this.transform.colorTransform;
_local5.color = Colors[_local4];
this.transform.colorTransform = _local5;
this.play();
}
function frame55(){
stop();
}
}
}//package
Section 25
//SpillZone (SpillZone)
package {
import flash.display.*;
public dynamic class SpillZone extends MovieClip {
}
}//package
Section 26
//Tile (Tile)
package {
import flash.display.*;
public class Tile extends MovieClip {
public var TileGold:Boolean;// = false
public var TileSeen:Boolean;// = false
public var Col:Number;
public var Row:Number;
private var tileParent:MovieClip;
public function Tile(_arg1:MovieClip, _arg2:Number, _arg3:Number){
TileSeen = false;
TileGold = false;
super();
addFrameScript(0, frame1, 1, frame2, 24, frame25);
Row = _arg2;
Col = _arg3;
tileParent = _arg1;
}
public function Lighten(){
if (((!(TileGold)) && (!(TileSeen)))){
this.gotoAndStop("Seen");
TileSeen = true;
};
}
function frame1(){
stop();
}
function frame25(){
stop();
}
function frame2(){
stop();
}
public function TurnGold(){
if (((!(TileGold)) && (TileSeen))){
this.gotoAndPlay("Gold");
TileGold = true;
};
}
}
}//package
Section 27
//willoWisp (willoWisp)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class willoWisp extends MovieClip {
private var Main;
private var alphaTrans;// = 1
public function willoWisp(_arg1, _arg2, _arg3){
var _local4:*;
var _local5:Timer;
alphaTrans = 1;
super();
this.alpha = 0.01;
_local4 = ((Math.random() * 0.3) + 0.7);
this.scaleX = (this.scaleY = _local4);
this.x = _arg2;
this.y = _arg3;
Main = _arg1;
_local5 = new Timer(15, Math.floor((Math.random() * 1000)));
_local5.addEventListener(TimerEvent.TIMER, blinkWisp);
_local5.addEventListener(TimerEvent.TIMER_COMPLETE, fadeWisp);
_local5.start();
}
private function blinkWisp(_arg1){
this.alpha = (this.alpha + (0.01 * alphaTrans));
if (this.alpha >= 1){
alphaTrans = -1;
} else {
if (this.alpha <= 0.4){
alphaTrans = 1;
};
};
}
private function shrinkWisp(_arg1){
var _local2:*;
this.alpha = (this.alpha - 0.05);
_local2 = (this.scaleX * 0.8);
this.scaleX = (this.scaleY = _local2);
}
private function fadeWisp(_arg1){
var _local2:Timer;
_local2 = new Timer(10, Math.floor((Math.random() * 3000)));
_local2.addEventListener(TimerEvent.TIMER, shrinkWisp);
_local2.addEventListener(TimerEvent.TIMER_COMPLETE, removeWisp);
_local2.start();
}
private function removeWisp(_arg1){
Main.currentWisp--;
this.parent.removeChild(this);
}
}
}//package
Section 28
//volumeControl (volumeControl)
package {
import flash.display.*;
public dynamic class volumeControl extends MovieClip {
public function volumeControl(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package