Section 1
//FRateLimiter (game.FRateLimiter)
package game {
import flash.utils.*;
public class FRateLimiter {
private static var newT:uint = oldT;
private static var oldT:uint = getTimer();
public static function limitFrame(_arg1:uint):void{
var _local2:uint;
_local2 = (1000 / _arg1);
while (Math.abs((newT - oldT)) < _local2) {
newT = getTimer();
};
oldT = getTimer();
}
}
}//package game
Section 2
//Game (game.Game)
package game {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import VO.*;
import flash.utils.*;
public class Game extends MovieClip {
private const GREEN_COLOR:uint = 1;
private var counter:uint;// = 6
public var arrow:MovieClip;
private var a_i:Number;
private var leftHit:Number;// = 400
private var a_j:Number;
private var sdManager:SoundManager;
private var colorTable:Object;
private var speed:Number;// = 3
private var balls:Array;
private var moving:Boolean;// = false
private var yRadius:Number;// = 12
private var container:MovieClip;
private var __x:Number;
public var score:uint;
private var plantAmount:Number;
private var stubAmount:Number;
private var ballKinds:Array;
private var xSpeed:Number;
private var __y:Number;
private var mushAmount:Number;
private var shot:Boolean;
private var containerMask:Sprite;
private var leftBorder:Number;// = 33
private var xRadius:Number;// = 13
private var currentBall:Ball;
public var counterText:MovieClip;
private var ySpeed:Number;
private var t_j:Number;
private var lockAmount:Number;
private var drops:Array;
private var t_i:Number;
private var stageWidth:Number;// = 429
private var maxLine:uint;// = 15
private var stubs:Array;
public var currentLevel:Number;// = 1
private var sameBalls:Array;
private var nextBall:Ball;
private var bombAmount:Number;
private var stubTable:Object;
private var stageHeight:Number;// = 410
private var maxRow:uint;// = 16
private var checking:Boolean;
private var topBorder:Number;// = 18
private var gameOver:Boolean;
private var tempLine:uint;// = 7
private var topHit:Number;// = 400
public function Game():void{
currentLevel = 1;
xRadius = 13;
yRadius = 12;
tempLine = 7;
maxLine = 15;
maxRow = 16;
speed = 3;
leftBorder = 33;
stageWidth = 429;
topBorder = 18;
leftHit = 400;
topHit = 400;
stageHeight = 410;
counter = 6;
moving = false;
super();
maxLine = (maxLine + 1);
sdManager = SoundManager.getInstance();
drops = new Array();
this.addEventListener(Event.ENTER_FRAME, check);
this.addEventListener(MouseEvent.CLICK, tryToShot);
}
private function dropAction(_arg1:Point):void{
var _local2:Number;
var _local3:MovieClip;
_local2 = 0;
while (_local2 < 4) {
_local3 = new Drop();
_local3.x = _arg1.x;
_local3.y = _arg1.y;
this.addChild(_local3);
drops.push({obj:_local3, xs:((Math.random() - 0.5) * 5), ys:((Math.random() - 0.5) * 2), a:0.08});
_local2++;
};
}
private function checkDrop(_arg1:Boolean=false):void{
var _local2:Number;
var _local3:*;
_local2 = 0;
while (_local2 < maxRow) {
checkForDrop(0, _local2);
_local2++;
};
for each (_local3 in stubs) {
checkForDrop(_local3.i, _local3.j);
};
updateView(_arg1);
}
private function aroundLoop(_arg1:Number, _arg2:Number, _arg3:Function):void{
var _local4:Number;
_local4 = (((_arg1 % 2) == 0)) ? -1 : 1;
_arg3(_arg1, (_arg2 - 1));
_arg3(_arg1, (_arg2 + 1));
_arg3((_arg1 - 1), _arg2);
_arg3((_arg1 - 1), (_arg2 + _local4));
_arg3((_arg1 + 1), _arg2);
_arg3((_arg1 + 1), (_arg2 + _local4));
}
private function moveDown(_arg1):void{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
if (_arg1 <= 14){
_local2 = 0;
while (_local2 < maxLine) {
_local3 = (((_local2 % 2) == 0)) ? -1 : 1;
_local4 = 0;
while (_local4 < maxRow) {
if (((!((balls[_local2][_local4] == null))) && (!((stubTable[_local4] == true))))){
balls[_local2][_local4].x = (balls[_local2][_local4].x + ((_local3 * xRadius) / 14));
balls[_local2][_local4].y = (balls[_local2][_local4].y + ((yRadius * 2) / 14));
};
_local4++;
};
_local2++;
};
setTimeout(moveDown, 30, (_arg1 + 1));
} else {
_local5 = 0;
while (_local5 < maxLine) {
_local6 = 0;
while (_local6 < maxRow) {
if (((!((balls[_local5][_local6] == null))) && (!((stubTable[_local6] == true))))){
balls[_local5][_local6].x = ((((_local6 * xRadius) * 2) + xRadius) + (xRadius * (_local5 % 2)));
balls[_local5][_local6].y = (((_local5 * yRadius) * 2) + yRadius);
} else {
if ((((_local5 < (maxLine - 1))) && ((stubTable[_local6] == true)))){
balls[_local5][_local6] = balls[(_local5 + 1)][_local6];
};
};
_local6++;
};
_local5++;
};
getNextBall();
checkDrop();
};
}
private function action(_arg1:TimerEvent=null):void{
var _local2:*;
_local2 = 0;
while (_local2 < drops.length) {
drops[_local2].obj.x = (drops[_local2].obj.x + drops[_local2].xs);
drops[_local2].obj.y = (drops[_local2].obj.y + drops[_local2].ys);
drops[_local2].ys = (drops[_local2].ys - drops[_local2].a);
drops[_local2].xs = (drops[_local2].xs * 0.95);
if (drops[_local2].obj.loaderInfo == null){
drops.splice(_local2, 1);
_local2--;
};
_local2++;
};
}
private function checkId(_arg1:Number, _arg2:Number):Boolean{
if ((((((((_arg1 >= 0)) && ((_arg2 >= 0)))) && ((_arg1 < (maxLine - 1))))) && ((_arg2 < maxRow)))){
return (true);
};
return (false);
}
private function checkPosition():String{
var _local1:Number;
var _local2:Number;
var _local3:Number;
_local1 = __x;
_local2 = __y;
__x = (__x + xSpeed);
__y = (__y + ySpeed);
if (__x < (xRadius + leftBorder)){
__x = (((leftBorder + xRadius) * 2) - __x);
xSpeed = (xSpeed * -1);
} else {
if (__x > ((leftBorder + stageWidth) - xRadius)){
__x = ((((leftBorder + stageWidth) - xRadius) * 2) - __x);
xSpeed = (xSpeed * -1);
};
};
if (__y <= (yRadius + topBorder)){
return ("arrive");
};
a_i = Math.round((((__y - yRadius) - topBorder) / (yRadius * 2)));
a_j = Math.round(((((__x - xRadius) - leftBorder) - (xRadius * (a_i % 2))) / (xRadius * 2)));
if (a_i >= maxLine){
return ("moving");
};
if (((checkId(a_i, a_j)) && (!((balls[a_i][a_j] == null))))){
__x = _local1;
__y = _local2;
if ((((balls[a_i][a_j]._type == "plant")) && ((currentBall._color == GREEN_COLOR)))){
return ("ate");
};
if (balls[a_i][a_j]._type == "bomb"){
return ("explode");
};
if ((((((balls[a_i][a_j]._type == "L")) || ((balls[a_i][a_j]._type == "R")))) || ((balls[a_i][a_j]._type == "T")))){
return ("mush");
};
return ("arrive");
};
_local3 = (((a_i % 2) == 0)) ? -1 : 1;
if ((((((((((((getDistance(a_i, (a_j - 1)) < leftHit)) || ((getDistance(a_i, (a_j + 1)) < leftHit)))) || ((getDistance((a_i - 1), a_j) < topHit)))) || ((getDistance((a_i - 1), (a_j + _local3)) < topHit)))) || ((getDistance((a_i + 1), a_j) < topHit)))) || ((getDistance((a_i + 1), (a_j + _local3)) < topHit)))){
a_i = t_i;
a_j = t_j;
if ((((balls[a_i][a_j]._type == "plant")) && ((currentBall._color == GREEN_COLOR)))){
return ("ate");
};
if (balls[a_i][a_j]._type == "bomb"){
return ("explode");
};
if ((((((balls[a_i][a_j]._type == "L")) || ((balls[a_i][a_j]._type == "R")))) || ((balls[a_i][a_j]._type == "T")))){
return ("mush");
};
return ("arrive");
};
return ("moving");
}
public function start(_arg1:String):void{
switch (_arg1){
case "easy":
ballKinds = [RedBall, GreenBall, BlueBall, YellowBall];
stubAmount = 1;
plantAmount = 2;
lockAmount = 1;
bombAmount = 3;
mushAmount = 1;
break;
case "normal":
ballKinds = [RedBall, GreenBall, BlueBall, YellowBall, PinkBall];
stubAmount = 2;
plantAmount = 3;
lockAmount = 3;
bombAmount = 3;
mushAmount = 2;
break;
case "hard":
ballKinds = [RedBall, GreenBall, BlueBall, YellowBall, PinkBall, CyanBall];
stubAmount = 4;
plantAmount = 5;
lockAmount = 5;
bombAmount = 2;
mushAmount = 3;
break;
};
startGame();
}
private function ballShake(_arg1:Number, _arg2:Number):void{
var _local3:Point;
var _local4:Number;
if (((checkId(_arg1, _arg2)) && (!((balls[_arg1][_arg2] == null))))){
_local3 = balls[_arg1][_arg2].localToGlobal(new Point(0, 0));
_local4 = Math.atan2((__y - _local3.y), (__x - _local3.x));
balls[_arg1][_arg2].shake(_local4);
};
}
private function onBallExplode():void{
checking = true;
shot = false;
sdManager.playSeSounds("explode");
currentBall.remove();
expldeBall(a_i, a_j);
checkDrop(true);
setCounter(true);
}
private function onEcho():void{
var _local1:*;
switch (balls[a_i][a_j]._type){
case "L":
if (((checkId(a_i, (a_j + 1))) && ((balls[a_i][(a_j + 1)] == null)))){
sdManager.playSeSounds("mush");
balls[a_i][a_j].jounce();
__x = ((((((a_j + 1) * xRadius) * 2) + xRadius) + (xRadius * (a_i % 2))) + leftBorder);
__y = ((((a_i * yRadius) * 2) + yRadius) + topBorder);
currentBall.x = __x;
currentBall.y = __y;
if ((a_j + 1) == (maxRow - 1)){
onBallArrive();
break;
};
xSpeed = (speed * Math.cos((-(Math.PI) / 12)));
ySpeed = (speed * Math.sin((-(Math.PI) / 12)));
} else {
onBallArrive();
};
break;
case "R":
if (((checkId(a_i, (a_j - 1))) && ((balls[a_i][(a_j - 1)] == null)))){
sdManager.playSeSounds("mush");
balls[a_i][a_j].jounce();
__x = ((((((a_j - 1) * xRadius) * 2) + xRadius) + (xRadius * (a_i % 2))) + leftBorder);
__y = ((((a_i * yRadius) * 2) + yRadius) + topBorder);
currentBall.x = __x;
currentBall.y = __y;
if ((a_j - 1) == 0){
onBallArrive();
break;
};
xSpeed = (speed * Math.cos(((-11 * Math.PI) / 12)));
ySpeed = (speed * Math.sin(((-11 * Math.PI) / 12)));
} else {
onBallArrive();
};
break;
case "T":
if (((checkId((a_i - 1), a_j)) && ((balls[(a_i - 1)][a_j] == null)))){
sdManager.playSeSounds("mush");
balls[a_i][a_j].jounce();
__x = (((((a_j * xRadius) * 2) + xRadius) + (xRadius * ((a_i - 1) % 2))) + leftBorder);
__y = (((((a_i - 1) * yRadius) * 2) + yRadius) + topBorder);
currentBall.x = __x;
currentBall.y = __y;
_local1 = ((((a_i - 1) % 2) == 0)) ? -1 : 1;
xSpeed = (speed * Math.cos((((3 * Math.PI) / 2) + ((_local1 * Math.PI) / 12))));
ySpeed = (speed * Math.sin((((3 * Math.PI) / 2) + ((_local1 * Math.PI) / 12))));
} else {
onBallArrive();
};
break;
};
}
private function expldeBall(_arg1:Number, _arg2:Number):void{
if (((((checkId(_arg1, _arg2)) && (!((balls[_arg1][_arg2] == null))))) && (!((balls[_arg1][_arg2]._type == "stub"))))){
score++;
if (balls[_arg1][_arg2]._type == "bomb"){
balls[_arg1][_arg2].explode();
balls[_arg1][_arg2] = null;
expldeBall(_arg1, (_arg2 - 1));
expldeBall(_arg1, (_arg2 - 2));
expldeBall(_arg1, (_arg2 + 1));
expldeBall(_arg1, (_arg2 + 2));
expldeBall((_arg1 - 1), _arg2);
expldeBall((_arg1 - 1), (_arg2 + 1));
expldeBall((_arg1 - 1), (_arg2 - 1));
expldeBall((_arg1 + 1), _arg2);
expldeBall((_arg1 + 1), (_arg2 + 1));
expldeBall((_arg1 + 1), (_arg2 - 1));
} else {
dropAction(balls[_arg1][_arg2].localToGlobal(new Point(0, 0)));
balls[_arg1][_arg2].remove();
balls[_arg1][_arg2] = null;
};
};
}
private function onGameOver(_arg1:String):void{
this.dispatchEvent(new DataEvent("onGameOver", false, false, _arg1));
gameOver = true;
}
private function onBallArrive():void{
var _local1:*;
shot = false;
checking = true;
a_i = Math.round((((__y - yRadius) - topBorder) / (yRadius * 2)));
a_j = Math.round(((((__x - xRadius) - leftBorder) - (xRadius * (a_i % 2))) / (xRadius * 2)));
container.addChild(currentBall);
currentBall.x = ((((((a_j * xRadius) * 2) + xRadius) + (xRadius * (a_i % 2))) + leftBorder) - container.x);
currentBall.y = (((((a_i * yRadius) * 2) + yRadius) + topBorder) - container.y);
balls[a_i][a_j] = currentBall;
sdManager.playSeSounds("hit");
sameBalls = new Array();
checkSame(a_i, a_j);
if (sameBalls.length >= 3){
checkDrop();
setCounter(true);
} else {
for each (_local1 in sameBalls) {
_local1.same = false;
};
checkGameOver(true);
if (!gameOver){
setCounter(true);
aroundLoop(a_i, a_j, ballShake);
};
};
}
private function check(_arg1:Event):void{
FRateLimiter.limitFrame(60);
action();
if (!gameOver){
this.arrow.rotation = ((Math.atan2((this.mouseY - this.arrow.y), (this.mouseX - this.arrow.x)) * 180) / Math.PI);
};
if (shot){
checkGame(7);
};
}
private function checkGameOver(_arg1:Boolean=false):void{
var _local2:int;
var _local3:*;
if (a_i >= (maxLine - 2)){
onGameOver("lose");
gameOver = true;
return;
};
_local2 = 0;
while (_local2 < ballKinds.length) {
if (colorTable[_local2] == true){
gameOver = false;
break;
} else {
gameOver = true;
};
_local2++;
};
if (gameOver){
onGameOver("win");
return;
};
for each (_local3 in balls[(maxLine - 2)]) {
if (_local3 != null){
gameOver = true;
break;
} else {
gameOver = false;
};
};
if (gameOver){
onGameOver("lose");
return;
};
}
private function updateView(_arg1:Boolean=false):void{
var _local2:Number;
var _local3:uint;
var _local4:uint;
colorTable = new Object();
moving = false;
_local2 = 0;
_local3 = 0;
while (_local3 < maxLine) {
_local4 = 0;
while (_local4 < maxRow) {
if (balls[_local3][_local4] != null){
if ((((balls[_local3][_local4].same == true)) || ((balls[_local3][_local4].dropCheck == false)))){
if (balls[_local3][_local4].dropCheck == false){
_local2++;
};
score++;
dropAction(balls[_local3][_local4].localToGlobal(new Point(0, 0)));
balls[_local3][_local4].remove();
balls[_local3][_local4] = null;
} else {
balls[_local3][_local4].same = false;
colorTable[balls[_local3][_local4]._color] = true;
balls[_local3][_local4].dropCheck = false;
};
};
_local4++;
};
_local3++;
};
if ((((_local2 > 0)) && (!(_arg1)))){
sdManager.playSeSounds("drop");
};
checkGameOver();
this.dispatchEvent(new Event("onUpdateScore"));
}
private function getNextBall():void{
if (!gameOver){
checking = false;
currentBall = nextBall;
currentBall.x = this.arrow.x;
currentBall.y = this.arrow.y;
nextBall = getRandomBall(colorTable);
nextBall.x = (this.arrow.x - 150);
nextBall.y = this.arrow.y;
this.addChild(nextBall);
};
}
private function checkGame(_arg1:Number):void{
if (_arg1 > 0){
switch (checkPosition()){
case "arrive":
onBallArrive();
break;
case "moving":
checkGame((_arg1 - 1));
break;
case "ate":
onBallAte();
break;
case "explode":
onBallExplode();
break;
case "mush":
onEcho();
break;
};
} else {
if (shot){
currentBall.x = __x;
currentBall.y = __y;
};
};
}
public function continueGame():void{
var i:Number;
var l:Number;
var j:Number;
var b:Ball;
currentLevel++;
sdManager.playBgSounds(("level" + (Math.floor((Math.random() * 3)) + 1)));
balls = new Array();
colorTable = new Object();
stubTable = new Object();
stubs = new Array();
gameOver = false;
checking = false;
shot = false;
counter = 6;
if (containerMask == null){
containerMask = new Sprite();
containerMask.graphics.beginFill(0xFFFFFF);
containerMask.graphics.drawRect(leftBorder, topBorder, stageWidth, stageHeight);
addChild(containerMask);
};
try {
this.removeChild(container);
} catch(e:Error) {
};
container = new MovieClip();
container.x = leftBorder;
container.y = topBorder;
this.addChild(container);
container.mask = containerMask;
i = 0;
while (i < maxLine) {
balls[i] = new Array();
if (i < tempLine){
j = 0;
while (j < maxRow) {
b = getRandomBall();
colorTable[b._color] = true;
this.container.addChild(b);
b.x = ((((j * xRadius) * 2) + xRadius) + (xRadius * (i % 2)));
b.y = (((i * yRadius) * 2) + yRadius);
balls[i][j] = b;
j = (j + 1);
};
};
i = (i + 1);
};
try {
this.removeChild(currentBall);
} catch(e:Error) {
};
try {
this.removeChild(nextBall);
} catch(e:Error) {
};
currentBall = getRandomBall();
currentBall.x = this.arrow.x;
currentBall.y = this.arrow.y;
this.addChild(currentBall);
nextBall = getRandomBall();
nextBall.x = (this.arrow.x - 150);
nextBall.y = this.arrow.y;
this.addChild(nextBall);
addItem(Stub, stubAmount, "stub");
addItem(Plant, plantAmount, "plant");
addItem(Bomb, bombAmount, "bomb");
addItem(Lock, lockAmount, "lock");
l = 0;
while (l < mushAmount) {
switch (Math.floor((Math.random() * 3))){
case 0:
addItem(MushRoomL, 1, "L");
break;
case 1:
addItem(MushRoomR, 1, "R");
break;
case 2:
addItem(MushRoomT, 1, "T");
break;
};
l = (l + 1);
};
this.counterText.gotoAndStop(6);
this.dispatchEvent(new Event("onUpdateScore"));
}
private function checkForDrop(_arg1:Number, _arg2:Number):void{
if (((((((checkId(_arg1, _arg2)) && (!((balls[_arg1][_arg2] == null))))) && ((balls[_arg1][_arg2].dropCheck == false)))) && ((balls[_arg1][_arg2].same == false)))){
balls[_arg1][_arg2].dropCheck = true;
aroundLoop(_arg1, _arg2, checkForDrop);
};
}
private function onBallAte():void{
checking = true;
shot = false;
currentBall.remove();
dropAction(balls[a_i][a_j].localToGlobal(new Point(0, 0)));
balls[a_i][a_j].life--;
if (balls[a_i][a_j].life == 0){
sdManager.playSeSounds("killPlant");
score++;
balls[a_i][a_j] = null;
checkDrop();
} else {
sdManager.playSeSounds("plantEat");
};
setCounter(true);
}
private function setCounter(_arg1:Boolean):void{
if (_arg1){
counter--;
};
if (counter == 0){
addNewLine();
counter = 6;
} else {
getNextBall();
};
this.counterText.gotoAndStop(counter);
}
private function addItem(_arg1, _arg2:Number, _arg3:String):void{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:*;
_local4 = _arg2;
while (_local4 > 0) {
_local5 = (Math.floor((Math.random() * (tempLine - 1))) + 1);
_local6 = Math.floor((Math.random() * maxRow));
if (balls[_local5][_local6]._type == "ball"){
if ((((_arg3 == "lock")) && ((stubTable[_local6] == true)))){
continue;
} else {
if (_arg3 == "stub"){
stubTable[_local6] = true;
stubs.push({i:_local5, j:_local6});
};
};
_local7 = new (_arg1);
_local7.x = balls[_local5][_local6].x;
_local7.y = balls[_local5][_local6].y;
_local7._type = _arg3;
balls[_local5][_local6].remove();
if (_arg3 == "plant"){
_local7._color = GREEN_COLOR;
};
this.container.addChild(_local7);
balls[_local5][_local6] = _local7;
_local4--;
};
};
}
private function getRandomBall(_arg1:Object=null){
var _local2:Number;
var _local3:*;
if (_arg1 == null){
_local2 = Math.floor((Math.random() * ballKinds.length));
_local3 = new (ballKinds[_local2]);
_local3._color = _local2;
return (_local3);
};
_local2 = Math.floor((Math.random() * ballKinds.length));
while (_arg1[_local2] != true) {
_local2 = Math.floor((Math.random() * ballKinds.length));
};
_local3 = new (ballKinds[_local2]);
_local3._color = _local2;
return (_local3);
}
private function getDistance(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
var _local4:Number;
if (((checkId(_arg1, _arg2)) && (!((balls[_arg1][_arg2] == null))))){
_local3 = (((((_arg2 * xRadius) * 2) + xRadius) + (xRadius * (_arg1 % 2))) + leftBorder);
_local4 = ((((_arg1 * yRadius) * 2) + yRadius) + topBorder);
t_i = _arg1;
t_j = _arg2;
return ((Math.pow((__x - _local3), 2) + Math.pow((__y - _local4), 2)));
};
return (9999);
}
public function startGame():void{
currentLevel = 0;
score = 0;
continueGame();
}
private function checkSame(_arg1:Number, _arg2:Number):void{
if (((((checkId(_arg1, _arg2)) && (!((balls[_arg1][_arg2] == null))))) && ((balls[_arg1][_arg2]._type == "ball")))){
if ((((balls[_arg1][_arg2]._color == currentBall._color)) && ((balls[_arg1][_arg2].same == false)))){
sameBalls.push(balls[_arg1][_arg2]);
balls[_arg1][_arg2].same = true;
aroundLoop(_arg1, _arg2, checkSame);
};
};
}
public function tryToShot(_arg1:MouseEvent):void{
var _local2:Number;
if (((((((((!(moving)) && (!(gameOver)))) && (!(shot)))) && (!(checking)))) && (((this.mouseY - this.arrow.y) < 0)))){
_local2 = Math.atan2((this.mouseY - this.arrow.y), (this.mouseX - this.arrow.x));
shot = true;
__x = currentBall.x;
__y = currentBall.y;
xSpeed = (speed * Math.cos(_local2));
ySpeed = (speed * Math.sin(_local2));
};
}
private function addNewLine():void{
var _local1:Array;
var _local2:*;
var _local3:Ball;
_local1 = new Array();
_local2 = 0;
while (_local2 < maxRow) {
if (stubTable[_local2] != true){
_local3 = getRandomBall(colorTable);
this.container.addChild(_local3);
_local3.x = ((((_local2 * xRadius) * 2) + xRadius) + xRadius);
_local3.y = -(yRadius);
_local1[_local2] = _local3;
};
_local2++;
};
balls.unshift(_local1);
balls.pop();
setTimeout(moveDown, 30, 0);
}
}
}//package game
Section 3
//Main (game.Main)
package game {
import flash.events.*;
import flash.net.*;
import flash.display.*;
import flash.utils.*;
public class Main extends MovieClip {
public var notice:MovieClip;
private var sdManager:SoundManager;
public var gameStage:Game;
public var loading:LoadingPage;
public var toolBar:ToolBar;
public var dioLogo:MovieClip;
public var logoBtn:MovieClip;
public var mainMenu:MainMenu;
public function Main():void{
addFrameScript(0, frame1, 2, frame3);
removeChild(notice);
stop();
stage.showDefaultContextMenu = false;
stage.scaleMode = StageScaleMode.NO_SCALE;
loading.maskBar.x = -100;
loading.logoBtn.addEventListener(MouseEvent.CLICK, jumpgamesgames, false, 0, true);
loading.logoBtn.buttonMode = true;
this.addEventListener(Event.ENTER_FRAME, onProgress);
}
public function init():void{
removeChild(loading);
sdManager = SoundManager.getInstance();
sdManager.loadSounds();
this.logoBtn.addEventListener(MouseEvent.CLICK, jumpgamesgames);
logoBtn.buttonMode = true;
showMainMenu();
stage.addEventListener(MouseEvent.MOUSE_UP, applySettings);
this.toolBar.addEventListener("restart", restarGame);
this.toolBar.addEventListener("continue", continueGame);
this.toolBar.addEventListener("showMainMenu", showMainMenu);
this.gameStage.addEventListener("onUpdateScore", updateScore);
this.gameStage.addEventListener("onGameOver", onGameOver);
this.mainMenu.addEventListener("onChooseLevel", startGame);
this.mainMenu.addEventListener("showSettings", showSettings);
this.dioLogo.addEventListener(MouseEvent.CLICK, gotoGameDio);
this.dioLogo.buttonMode = true;
}
private function onProgress(_arg1:Event):void{
loading.maskBar.x = (-100 + ((265 * loaderInfo.bytesLoaded) / loaderInfo.bytesTotal));
if (loaderInfo.bytesLoaded >= loaderInfo.bytesTotal){
this.removeEventListener(Event.ENTER_FRAME, onProgress);
setTimeout(gotoAndStop, 500, 3);
};
}
private function continueGame(_arg1):void{
this.toolBar.visible = true;
this.gameStage.continueGame();
}
private function updateScore(_arg1:Event):void{
this.toolBar.setScore((this.gameStage.score * 10));
}
private function jumpgamesgames(_arg1):void{
navigateToURL(new URLRequest("http://www.gamesgames.com/moregames/?utm_source=brandedgames&utm_medium=bubble_elements_earth"), "_blank");
}
function frame3(){
stop();
init();
}
function frame1(){
stop();
}
private function gotoGameDio(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.gamedino.com/"), "_blank");
}
private function startGame(_arg1:DataEvent):void{
this.toolBar.resetScore();
this.toolBar.visible = true;
this.gameStage.visible = true;
this.mainMenu.visible = false;
this.gameStage.start(_arg1.data);
}
private function restarGame(_arg1):void{
this.toolBar.visible = true;
this.gameStage.startGame();
}
private function showSettings(_arg1):void{
this.toolBar.showSettings(this);
}
private function applySettings(_arg1):void{
this.toolBar.applyTempSettings();
}
private function showMainMenu(_arg1:Event=null):void{
sdManager.playBgSounds("mainMusic");
this.gameStage.visible = false;
this.mainMenu.visible = true;
this.toolBar.visible = false;
}
private function onGameOver(_arg1:DataEvent):void{
this.toolBar.onGameOver(_arg1.data, String((this.gameStage.score * 10)));
}
}
}//package game
Section 4
//MainMenu (game.MainMenu)
package game {
import flash.events.*;
import flash.net.*;
import flash.display.*;
public class MainMenu extends MovieClip {
public var btn_normal:Btn_normal;
public var btn_easy:Btn_easy;
public var btn_more:Btn_more;
public var btn_site:Btn_site;
public var btn_mode:Btn_mode;
public var btn_back:Btn_back;
public var btn_set:Btn_settings;
public function MainMenu(){
addFrameScript(0, frame1, 6, frame7, 7, frame8, 13, frame14);
}
private function easyGame(_arg1:MouseEvent):void{
this.dispatchEvent(new DataEvent("onChooseLevel", false, false, "easy"));
}
private function enterModel(_arg1:MouseEvent):void{
this.gotoAndPlay("model");
}
private function setMain():void{
this.btn_mode.addEventListener(MouseEvent.CLICK, enterModel);
this.btn_set.addEventListener(MouseEvent.CLICK, enterSet);
this.btn_more.addEventListener(MouseEvent.CLICK, enterMore);
this.btn_site.addEventListener(MouseEvent.CLICK, enterSite);
}
private function enterSite(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.gamesgames.com/freegames/?utm_source=brandedgames&utm_medium=bubble_elements_earth"), "_blank");
}
function frame14(){
stop();
}
private function enterSet(_arg1:MouseEvent):void{
this.dispatchEvent(new Event("showSettings"));
}
function frame1(){
setMain();
}
public function reset():void{
this.gotoAndPlay("main");
}
function frame8(){
setModel();
}
private function normalGame(_arg1:MouseEvent):void{
this.dispatchEvent(new DataEvent("onChooseLevel", false, false, "normal"));
}
function frame7(){
stop();
}
private function enterMore(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.gamesgames.com/moregames/?utm_source=brandedgames&utm_medium=bubble_elements_earth"), "_blank");
}
private function backToMain(_arg1:MouseEvent):void{
this.gotoAndPlay("main");
}
override public function set visible(_arg1:Boolean):void{
super.visible = _arg1;
this.gotoAndPlay("main");
}
private function setModel():void{
this.btn_easy.addEventListener(MouseEvent.CLICK, easyGame, false, 0, true);
this.btn_normal.addEventListener(MouseEvent.CLICK, normalGame, false, 0, true);
this.btn_back.addEventListener(MouseEvent.CLICK, backToMain, false, 0, true);
}
}
}//package game
Section 5
//SoundManager (game.SoundManager)
package game {
import flash.events.*;
import flash.media.*;
import flash.net.*;
import flash.utils.*;
public class SoundManager {
private var soundTable:Object;
public var seVolume:Number;// = 0.35
private var currentBgSound:SoundChannel;
private var tBgVolume:Number;// = 0.75
private var nextBg:String;
private var currentBg:String;
private var tSeVolume:Number;// = 0.35
private var currentSeSound:SoundChannel;
private var cookie:SharedObject;
private var bgTimer:Number;
public var bgVolume:Number;// = 0.75
public static var _instance:SoundManager;
public function SoundManager():void{
bgVolume = 0.75;
seVolume = 0.35;
tBgVolume = 0.75;
tSeVolume = 0.35;
super();
cookie = SharedObject.getLocal("bubbles_settings", "/");
if (cookie.data.bgVolume != null){
bgVolume = (tBgVolume = cookie.data.bgVolume);
};
if (cookie.data.seVolume != null){
seVolume = (tSeVolume = cookie.data.seVolume);
};
soundTable = new Object();
}
private function onBgSoundComplete(_arg1:Event):void{
if ((((Number(currentBg.split("level")[1]) > 0)) || ((currentBg == "mainMusic")))){
currentBgSound.removeEventListener(Event.SOUND_COMPLETE, onBgSoundComplete);
currentBgSound.stop();
currentBgSound = null;
playBgSounds(currentBg);
} else {
currentBgSound.removeEventListener(Event.SOUND_COMPLETE, onBgSoundComplete);
currentBgSound = null;
};
}
private function onSoundComplete(_arg1:Event):void{
currentSeSound.removeEventListener(Event.SOUND_COMPLETE, onSoundComplete);
currentSeSound = null;
}
public function loadSounds():void{
addNewSound("hit", BallHit);
addNewSound("mouseOn", MouseOn);
addNewSound("mouseUp", MouseUp);
addNewSound("mush", MushSound);
addNewSound("explode", Explode);
addNewSound("drop", BallDrop);
addNewSound("killPlant", killPlant);
addNewSound("plantEat", plantEat);
addNewSound("mainMusic", MainMusic);
addNewSound("levelComplete", LevelComplete);
addNewSound("levelFailed", LevelFailed);
addNewSound("level1", LevelA);
addNewSound("level2", LevelB);
addNewSound("level3", LevelC);
}
public function setSeVolume(_arg1:Number, _arg2:Boolean):void{
if (_arg2){
tSeVolume = seVolume;
cookie.data.seVolume = seVolume;
cookie.flush();
} else {
seVolume = _arg1;
};
if (currentSeSound != null){
currentSeSound.soundTransform = new SoundTransform(seVolume);
};
}
public function addNewSound(_arg1:String, _arg2):void{
var _local3:Sound;
_local3 = new (_arg2);
soundTable[_arg1] = _local3;
}
public function setBgVolume(_arg1:Number, _arg2:Boolean):void{
if (_arg2){
tBgVolume = bgVolume;
cookie.data.bgVolume = bgVolume;
cookie.flush();
} else {
bgVolume = _arg1;
};
if (currentBgSound != null){
currentBgSound.soundTransform = new SoundTransform(bgVolume);
};
}
public function playSeSounds(_arg1:String):void{
var _local2:SoundChannel;
if (soundTable[_arg1] != null){
if (currentSeSound != null){
currentSeSound.stop();
currentSeSound.removeEventListener(Event.SOUND_COMPLETE, onSoundComplete);
};
_local2 = soundTable[_arg1].play();
_local2.addEventListener(Event.SOUND_COMPLETE, onSoundComplete);
currentSeSound = _local2;
_local2.soundTransform = new SoundTransform(seVolume);
};
}
private function soundLouder(_arg1:Number):void{
clearTimeout(bgTimer);
if (_arg1 >= bgVolume){
currentBgSound.soundTransform = new SoundTransform(bgVolume);
} else {
currentBgSound.soundTransform = new SoundTransform(_arg1);
bgTimer = setTimeout(soundLouder, 100, (_arg1 + 0.05));
};
}
private function voiceDown(_arg1:Number):void{
var s = _arg1;
try {
clearTimeout(bgTimer);
} catch(e:Error) {
};
try {
if (s <= 0){
currentBgSound.stop();
currentBgSound.soundTransform = new SoundTransform(0);
currentBgSound = null;
playBgSounds(nextBg);
} else {
currentBgSound.soundTransform = new SoundTransform(s);
bgTimer = setTimeout(voiceDown, 100, (s - 0.05));
};
} catch(e:Error) {
};
}
public function cancelSetting():void{
bgVolume = tBgVolume;
seVolume = tSeVolume;
if (currentBgSound != null){
currentBgSound.soundTransform = new SoundTransform(bgVolume);
};
if (currentSeSound != null){
currentSeSound.soundTransform = new SoundTransform(seVolume);
};
}
public function playBgSounds(_arg1:String, _arg2:Boolean=false):void{
var chanel:SoundChannel;
var sign = _arg1;
var n = _arg2;
try {
clearTimeout(bgTimer);
} catch(e:Error) {
};
if (soundTable[sign] != null){
if (currentBgSound != null){
nextBg = sign;
if (n){
currentBgSound.removeEventListener(Event.SOUND_COMPLETE, onBgSoundComplete);
voiceDown(0);
} else {
currentBgSound.removeEventListener(Event.SOUND_COMPLETE, onBgSoundComplete);
setTimeout(voiceDown, 100, bgVolume);
};
} else {
currentBg = sign;
chanel = soundTable[sign].play();
currentBgSound = chanel;
currentBgSound.addEventListener(Event.SOUND_COMPLETE, onBgSoundComplete);
if (n){
soundLouder(100);
} else {
chanel.soundTransform = new SoundTransform(0);
setTimeout(soundLouder, 100, 0);
};
};
};
}
public static function getInstance():SoundManager{
if (_instance == null){
_instance = new (SoundManager);
};
return (_instance);
}
}
}//package game
Section 6
//ToolBar (game.ToolBar)
package game {
import flash.events.*;
import flash.geom.*;
import flash.net.*;
import flash.display.*;
public class ToolBar extends MovieClip {
public var tipsBtn:Btn_tips;
private var win:MovieClip;
private var itemHeight:Number;// = 25
private var sdManager:SoundManager;
private var cscore:Number;// = 0
private var scores:Array;
private var top10:MovieClip;
public var highBtn:Btn_HighScores;
private var _name:String;// = "player1"
private var splash:MovieClip;
private var numbers:Array;
public var scoreBoard:MovieClip;
private var state:String;// = "normal"
public var scoreField:MovieClip;
public var setBtn:Btn_setting;
private var scoreCookie:SharedObject;
public var fullBtn:Btn_full_version;
public var disableMc:MovieClip;
private var _set:MovieClip;
public var moreBtn:Btn_moreGame;
private var tscore:Number;// = 0
public function ToolBar(){
state = "normal";
_name = "player1";
itemHeight = 25;
cscore = 0;
tscore = 0;
super();
sdManager = SoundManager.getInstance();
numbers = new Array();
scoreCookie = SharedObject.getLocal("bubbles_settings", "/");
if (scoreCookie.data.scores == null){
scores = new Array();
} else {
scores = scoreCookie.data.scores;
};
if (scoreCookie.data.name != null){
_name = scoreCookie.data.name;
};
scoreField.nameTxt.text = _name;
this.tipsBtn.addEventListener(MouseEvent.CLICK, showTips);
this.highBtn.addEventListener(MouseEvent.CLICK, showScoreBoard);
this.moreBtn.addEventListener(MouseEvent.CLICK, getMoreGames);
this.setBtn.addEventListener(MouseEvent.CLICK, showSet);
this.fullBtn.addEventListener(MouseEvent.CLICK, getFullGames);
}
private function showMainMenu(_arg1:MouseEvent):void{
this.dispatchEvent(new Event("showMainMenu"));
}
private function showGameOver(_arg1=null):void{
if (win == null){
clearStage();
disableMc.visible = true;
win = new GameWin();
win.moreBtn.addEventListener(MouseEvent.CLICK, getMoreGames, false, 0, true);
win.fullBtn.addEventListener(MouseEvent.CLICK, getFullGames, false, 0, true);
win.mv.addEventListener(MouseEvent.CLICK, getFullGames, false, 0, true);
win.mv.buttonMode = true;
win.subBtn.addEventListener(MouseEvent.CLICK, setScoreBoard, false, 0, true);
if (_arg1 == null){
win.wellDone.visible = false;
} else {
win.gameOver.visible = false;
};
win.nameTxt.text = _name;
this.addChild(win);
};
}
private function showScoreBoard(_arg1:MouseEvent=null):void{
var _local2:*;
var _local3:*;
var _local4:*;
if (scoreBoard == null){
clearStage();
disableMc.visible = true;
scoreBoard = new ScoreBoard();
if (state == "normal"){
scoreBoard.backMainBtn.visible = false;
scoreBoard.continueBtn.visible = false;
scoreBoard.backBtn.addEventListener(MouseEvent.CLICK, clearStage, false, 0, true);
} else {
if (state == "lose"){
scoreBoard.backBtn.visible = false;
scoreBoard.continueBtn.visible = false;
scoreBoard.backMainBtn.addEventListener(MouseEvent.CLICK, showMainMenu, false, 0, true);
} else {
if (state == "win"){
scoreBoard.backMainBtn.visible = false;
scoreBoard.backBtn.visible = false;
scoreBoard.continueBtn.addEventListener(MouseEvent.CLICK, continueGame, false, 0, true);
};
};
};
scoreBoard.moreBtn.addEventListener(MouseEvent.CLICK, getMoreGames, false, 0, true);
this.addChild(scoreBoard);
_local2 = 0;
while (_local2 < scores.length) {
_local3 = scoreBoard.getChildByName(("t" + (_local2 + 1)));
_local3.text = scores[_local2].name;
_local4 = scoreBoard.getChildByName((("t" + (_local2 + 1)) + "s"));
_local4.text = String(scores[_local2].score);
_local2++;
};
};
}
private function setS(_arg1):void{
if (cscore < tscore){
numbers[0].nextFrame();
cscore++;
} else {
this.removeEventListener(Event.ENTER_FRAME, setS);
};
}
private function continueGame(_arg1:MouseEvent):void{
state = "normal";
clearStage();
this.dispatchEvent(new Event("continue"));
}
public function setScore(_arg1:Number):void{
tscore = _arg1;
if (!this.hasEventListener(Event.ENTER_FRAME)){
this.addEventListener(Event.ENTER_FRAME, setS);
};
}
private function goPrev(_arg1:MouseEvent):void{
top10.nextBtn.visible = true;
if ((top10.currentFrame - 1) <= 1){
top10.prevBtn.visible = false;
};
top10.prevFrame();
}
private function showSet(_arg1:MouseEvent):void{
showSettings(this);
}
public function showSettings(_arg1):void{
if (_set == null){
clearStage();
disableMc.visible = true;
_set = new SettingBoard();
_set.nameTxt.text = _name;
_set.seVolumeBtn.x = (270 + (sdManager.seVolume * 125));
_set.bgVolumeBtn.x = (270 + (sdManager.bgVolume * 125));
_set.seVolumeBtn.addEventListener(MouseEvent.MOUSE_DOWN, onSetVolume, false, 0, true);
_set.bgVolumeBtn.addEventListener(MouseEvent.MOUSE_DOWN, onSetVolume, false, 0, true);
_set.OKBtn.addEventListener(MouseEvent.CLICK, applySettings, false, 0, true);
_set.backBtn.addEventListener(MouseEvent.CLICK, cancelSettings, false, 0, true);
_arg1.addChild(_set);
};
}
private function carryOn(_arg1:Event):void{
var _local2:*;
var _local3:*;
_local2 = Number(_arg1.target.name.split("score")[1]);
if (numbers[(_local2 + 1)] == null){
_local3 = new Numbers();
_local3.name = ("score" + (_local2 + 1));
_local3.stop();
_local3.addEventListener("carry", carryOn, false, 0, true);
_local3.x = (92 - ((_local2 + 1) * 11));
_local3.y = 65;
numbers.push(_local3);
this.scoreField.addChild(_local3);
};
numbers[(_local2 + 1)].nextFrame();
}
private function setScoreBoard(_arg1):void{
scores.push({name:String(this.win.nameTxt.text), score:tscore});
scores.sortOn("score", Array.NUMERIC);
if (scores.length > 10){
scores.splice(0, (scores.length - 10));
};
scores.reverse();
scoreCookie.data.scores = scores;
scoreCookie.flush();
showScoreBoard();
}
private function restartGame(_arg1:MouseEvent):void{
state = "normal";
clearStage();
this.dispatchEvent(new Event("restart"));
resetScore();
}
public function resetScore():void{
var _local1:*;
var _local2:*;
state = "normal";
clearStage();
cscore = 0;
for each (_local1 in numbers) {
this.scoreField.removeChild(_local1);
};
numbers = new Array();
_local2 = new Numbers();
_local2.stop();
_local2.name = "score0";
_local2.x = 92;
_local2.y = 65;
_local2.addEventListener("carry", carryOn, false, 0, true);
numbers.push(_local2);
this.scoreField.addChild(_local2);
}
private function clearStage(_arg1=null):void{
var e = _arg1;
disableMc.visible = false;
if (top10 != null){
this.removeChild(top10);
top10 = null;
};
if (splash != null){
try {
this.removeChild(splash);
} catch(e:Error) {
splash = null;
};
};
if (scoreBoard != null){
this.removeChild(scoreBoard);
scoreBoard = null;
};
if (_set != null){
_set.parent.removeChild(_set);
_set = null;
};
if (win != null){
this.removeChild(win);
win = null;
};
}
public function applyTempSettings():void{
if (_set != null){
_set.bgVolumeBtn.stopDrag();
_set.seVolumeBtn.stopDrag();
sdManager.setBgVolume(((_set.bgVolumeBtn.x - 270) / 125), false);
sdManager.setSeVolume(((_set.seVolumeBtn.x - 270) / 125), false);
};
}
private function getFullGames(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www8.agame.com/buyfullversion/b/bubble_elements_flash.html"), "_blank");
}
private function applySettings(_arg1:MouseEvent):void{
_name = _set.nameTxt.text;
scoreCookie.data.name = _name;
scoreCookie.flush();
scoreField.nameTxt.text = _name;
sdManager.setBgVolume(((_set.bgVolumeBtn.x - 270) / 125), true);
sdManager.setSeVolume(((_set.seVolumeBtn.x - 270) / 125), true);
clearStage();
}
private function cancelSettings(_arg1:MouseEvent):void{
sdManager.cancelSetting();
clearStage();
}
private function goNext(_arg1:MouseEvent):void{
top10.prevBtn.visible = true;
if ((top10.currentFrame + 1) >= top10.totalFrames){
top10.nextBtn.visible = false;
};
top10.nextFrame();
}
public function onGameOver(_arg1:String, _arg2:String):void{
state = _arg1;
clearStage();
if (_arg1 == "win"){
disableMc.visible = true;
sdManager.playBgSounds("levelComplete", true);
splash = new YouWin();
splash.x = 250;
splash.y = 200;
splash.addEventListener("splashDone", showGameOver, false, 0, true);
this.addChild(splash);
} else {
sdManager.playBgSounds("levelFailed", true);
showGameOver();
};
}
private function showTips(_arg1:MouseEvent):void{
if (top10 == null){
clearStage();
disableMc.visible = true;
top10 = new Tips();
top10.stop();
top10.prevBtn.visible = false;
this.addChild(top10);
top10.prevBtn.addEventListener(MouseEvent.CLICK, goPrev, false, 0, true);
top10.nextBtn.addEventListener(MouseEvent.CLICK, goNext, false, 0, true);
top10.closeBtn.addEventListener(MouseEvent.CLICK, clearStage, false, 0, true);
};
}
private function getMoreGames(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.gamesgames.com/moregames/?utm_source=brandedgames&utm_medium=bubble_elements_earth"), "_blank");
}
private function onSetVolume(_arg1:MouseEvent):void{
_arg1.currentTarget.startDrag(false, new Rectangle(270, _arg1.currentTarget.y, 125, 0));
}
}
}//package game
Section 7
//full_game_pic_56 (popo_fla.full_game_pic_56)
package popo_fla {
import flash.display.*;
import flash.utils.*;
public dynamic class full_game_pic_56 extends MovieClip {
public function full_game_pic_56(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
}
function frame3(){
setTimeout(nextFrame, 2000);
}
function frame1(){
stop();
setTimeout(nextFrame, 2000);
}
function frame4(){
gotoAndStop(1);
}
function frame2(){
setTimeout(nextFrame, 2000);
}
}
}//package popo_fla
Section 8
//item_bomb_animation_23 (popo_fla.item_bomb_animation_23)
package popo_fla {
import flash.display.*;
import flash.utils.*;
public dynamic class item_bomb_animation_23 extends MovieClip {
public function item_bomb_animation_23(){
addFrameScript(0, frame1, 31, frame32, 61, frame62);
}
function frame1(){
stop();
setTimeout(play, (2000 + (Math.random() * 2000)));
}
function frame32(){
if (this.loaderInfo != null){
gotoAndStop(1);
} else {
stop();
};
}
function frame62(){
stop();
this.parent.parent.removeChild(this.parent);
}
}
}//package popo_fla
Section 9
//item_lock_animation_26 (popo_fla.item_lock_animation_26)
package popo_fla {
import flash.events.*;
import flash.display.*;
public dynamic class item_lock_animation_26 extends MovieClip {
public function item_lock_animation_26(){
addFrameScript(0, frame1, 8, frame9, 17, frame18);
}
function frame18(){
stop();
this.dispatchEvent(new Event("remove"));
}
function frame1(){
stop();
}
function frame9(){
stop();
this.dispatchEvent(new Event("remove"));
}
}
}//package popo_fla
Section 10
//item_plant_animation_28 (popo_fla.item_plant_animation_28)
package popo_fla {
import flash.display.*;
import flash.text.*;
import flash.utils.*;
public dynamic class item_plant_animation_28 extends MovieClip {
public var txt:TextField;
public function item_plant_animation_28(){
addFrameScript(0, frame1, 105, frame106, 155, frame156, 244, frame245);
}
function frame156(){
stop();
if (loaderInfo != null){
this.parent.parent.removeChild(this.parent);
};
}
function frame106(){
stop();
if (this.loaderInfo != null){
gotoAndStop("reset");
};
}
function frame1(){
setTimeout(play, (4000 * Math.random()));
}
function frame245(){
stop();
if (this.loaderInfo != null){
gotoAndStop("reset");
};
}
}
}//package popo_fla
Section 11
//scoreField_67 (popo_fla.scoreField_67)
package popo_fla {
import flash.display.*;
import flash.text.*;
public dynamic class scoreField_67 extends MovieClip {
public var nameTxt:TextField;
}
}//package popo_fla
Section 12
//Timeline_31 (popo_fla.Timeline_31)
package popo_fla {
import flash.display.*;
public dynamic class Timeline_31 extends MovieClip {
public function Timeline_31(){
addFrameScript(0, frame1, 19, frame20);
}
function frame1(){
stop();
}
function frame20(){
gotoAndStop(1);
}
}
}//package popo_fla
Section 13
//Timeline_33 (popo_fla.Timeline_33)
package popo_fla {
import flash.display.*;
public dynamic class Timeline_33 extends MovieClip {
public function Timeline_33(){
addFrameScript(0, frame1, 19, frame20);
}
function frame1(){
stop();
}
function frame20(){
gotoAndStop(1);
}
}
}//package popo_fla
Section 14
//Timeline_35 (popo_fla.Timeline_35)
package popo_fla {
import flash.display.*;
public dynamic class Timeline_35 extends MovieClip {
public function Timeline_35(){
addFrameScript(0, frame1, 20, frame21);
}
function frame1(){
stop();
}
function frame21(){
gotoAndStop(1);
}
}
}//package popo_fla
Section 15
//x1to6_63 (popo_fla.x1to6_63)
package popo_fla {
import flash.display.*;
public dynamic class x1to6_63 extends MovieClip {
public function x1to6_63(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6);
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame2(){
stop();
}
}
}//package popo_fla
Section 16
//Button (ui.Button)
package ui {
import game.*;
import flash.events.*;
import flash.display.*;
public class Button extends MovieClip {
public function Button(){
this.buttonMode = true;
this.addEventListener(MouseEvent.MOUSE_OVER, onOver);
this.addEventListener(MouseEvent.MOUSE_UP, onUp);
this.addEventListener(MouseEvent.MOUSE_DOWN, onDown);
this.addEventListener(MouseEvent.MOUSE_OUT, onOut);
}
private function onDown(_arg1:MouseEvent):void{
this.gotoAndPlay("down");
}
private function onOver(_arg1:MouseEvent):void{
SoundManager.getInstance().playSeSounds("mouseOn");
this.gotoAndPlay("over");
}
private function onUp(_arg1:MouseEvent):void{
this.gotoAndPlay("up");
SoundManager.getInstance().playSeSounds("mouseUp");
}
private function onOut(_arg1:MouseEvent):void{
this.gotoAndPlay("up");
}
}
}//package ui
Section 17
//Ball (VO.Ball)
package VO {
import flash.events.*;
import flash.display.*;
public class Ball extends MovieClip {
private var counter:Number;
public var _type:String;// = "ball"
public var same:Boolean;
public var _color:Number;// = -1
private var shakeAngle:Number;
public var dropCheck:Boolean;
private var _life:Number;// = 2
private var shakeSpeed:Number;
public var ball:MovieClip;
public function Ball():void{
_color = -1;
_type = "ball";
_life = 2;
super();
try {
this.ball.stop();
} catch(e:Error) {
};
same = false;
dropCheck = false;
}
public function shake(_arg1:Number):void{
var angle = _arg1;
if ((((_type == "ball")) || ((_type == "bomb")))){
try {
this.ball.x = 0;
this.ball.y = 0;
this.removeEventListener(Event.ENTER_FRAME, shakeMotion);
} catch(e:Error) {
};
shakeSpeed = 4;
counter = 0;
shakeAngle = angle;
this.addEventListener(Event.ENTER_FRAME, shakeMotion);
};
}
public function set life(_arg1:Number):void{
_life = _arg1;
this.ball.txt.text = ("x" + String(_life));
if (_life == 1){
this.ball.gotoAndPlay("firstHit");
} else {
if (_life == 0){
this.ball.gotoAndPlay("died");
};
};
}
public function get life():Number{
return (_life);
}
private function shakeMotion(_arg1:Event):void{
if (((!((this.ball == null))) && (!((loaderInfo == null))))){
counter++;
this.ball.x = ((-(shakeSpeed) * Math.cos(shakeAngle)) * Math.sin(((Math.PI * counter) / 8)));
this.ball.y = ((-(shakeSpeed) * Math.sin(shakeAngle)) * Math.sin(((Math.PI * counter) / 8)));
if ((counter % 8) == 0){
shakeSpeed = (shakeSpeed * 0.8);
};
if ((((shakeSpeed <= 0.8)) && (((counter % 8) == 0)))){
this.ball.x = 0;
this.ball.y = 0;
this.removeEventListener(Event.ENTER_FRAME, shakeMotion);
};
} else {
this.removeEventListener(Event.ENTER_FRAME, shakeMotion);
};
}
public function remove():void{
this.parent.removeChild(this);
}
public function jounce():void{
this.ball.gotoAndPlay(1);
}
public function explode():void{
this.ball.gotoAndPlay("explode");
}
}
}//package VO
Section 18
//BACK_ (BACK_)
package {
import ui.*;
public dynamic class BACK_ extends Button {
public function BACK_(){
addFrameScript(0, frame1, 4, frame5, 8, frame9, 13, frame14);
}
function frame14(){
stop();
}
function frame1(){
stop();
}
function frame5(){
stop();
}
function frame9(){
stop();
}
}
}//package
Section 19
//backtomainscreen (backtomainscreen)
package {
import ui.*;
public dynamic class backtomainscreen extends Button {
public function backtomainscreen(){
addFrameScript(4, frame5, 8, frame9, 13, frame14);
}
function frame14(){
stop();
}
function frame5(){
stop();
}
function frame9(){
stop();
}
}
}//package
Section 20
//BallDrop (BallDrop)
package {
import flash.media.*;
public dynamic class BallDrop extends Sound {
}
}//package
Section 21
//BallHit (BallHit)
package {
import flash.media.*;
public dynamic class BallHit extends Sound {
}
}//package
Section 22
//BlueBall (BlueBall)
package {
import VO.*;
public dynamic class BlueBall extends Ball {
}
}//package
Section 23
//Bomb (Bomb)
package {
import VO.*;
public dynamic class Bomb extends Ball {
}
}//package
Section 24
//Btn_back (Btn_back)
package {
import ui.*;
public dynamic class Btn_back extends Button {
public function Btn_back(){
addFrameScript(4, frame5, 10, frame11, 17, frame18);
}
function frame18(){
stop();
}
function frame5(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 25
//btn_close (btn_close)
package {
import ui.*;
public dynamic class btn_close extends Button {
public function btn_close(){
addFrameScript(4, frame5, 8, frame9, 13, frame14);
}
function frame14(){
stop();
}
function frame5(){
stop();
}
function frame9(){
stop();
}
}
}//package
Section 26
//Btn_easy (Btn_easy)
package {
import ui.*;
public dynamic class Btn_easy extends Button {
public function Btn_easy(){
addFrameScript(4, frame5, 10, frame11, 17, frame18);
}
function frame18(){
stop();
}
function frame5(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 27
//Btn_full_version (Btn_full_version)
package {
import ui.*;
public dynamic class Btn_full_version extends Button {
public function Btn_full_version(){
addFrameScript(4, frame5, 10, frame11, 17, frame18);
}
function frame18(){
stop();
}
function frame5(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 28
//Btn_HighScores (Btn_HighScores)
package {
import ui.*;
public dynamic class Btn_HighScores extends Button {
public function Btn_HighScores(){
addFrameScript(4, frame5, 10, frame11, 17, frame18);
}
function frame18(){
stop();
}
function frame5(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 29
//Btn_mode (Btn_mode)
package {
import ui.*;
public dynamic class Btn_mode extends Button {
public function Btn_mode(){
addFrameScript(4, frame5, 10, frame11, 17, frame18);
}
function frame18(){
stop();
}
function frame5(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 30
//Btn_more (Btn_more)
package {
import ui.*;
public dynamic class Btn_more extends Button {
public function Btn_more(){
addFrameScript(4, frame5, 10, frame11, 17, frame18);
}
function frame18(){
stop();
}
function frame5(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 31
//Btn_moreGame (Btn_moreGame)
package {
import ui.*;
public dynamic class Btn_moreGame extends Button {
public function Btn_moreGame(){
addFrameScript(4, frame5, 10, frame11, 17, frame18);
}
function frame18(){
stop();
}
function frame5(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 32
//Btn_nextPg (Btn_nextPg)
package {
import ui.*;
public dynamic class Btn_nextPg extends Button {
}
}//package
Section 33
//Btn_normal (Btn_normal)
package {
import ui.*;
public dynamic class Btn_normal extends Button {
public function Btn_normal(){
addFrameScript(4, frame5, 10, frame11, 17, frame18);
}
function frame18(){
stop();
}
function frame5(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 34
//Btn_setting (Btn_setting)
package {
import ui.*;
public dynamic class Btn_setting extends Button {
public function Btn_setting(){
addFrameScript(4, frame5, 10, frame11, 17, frame18);
}
function frame18(){
stop();
}
function frame5(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 35
//Btn_settings (Btn_settings)
package {
import ui.*;
public dynamic class Btn_settings extends Button {
public function Btn_settings(){
addFrameScript(4, frame5, 10, frame11, 17, frame18);
}
function frame18(){
stop();
}
function frame5(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 36
//Btn_site (Btn_site)
package {
import ui.*;
public dynamic class Btn_site extends Button {
public function Btn_site(){
addFrameScript(4, frame5, 10, frame11, 17, frame18);
}
function frame18(){
stop();
}
function frame5(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 37
//Btn_tips (Btn_tips)
package {
import ui.*;
public dynamic class Btn_tips extends Button {
public function Btn_tips(){
addFrameScript(4, frame5, 10, frame11, 17, frame18);
}
function frame18(){
stop();
}
function frame5(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 38
//buyfullversion (buyfullversion)
package {
import ui.*;
public dynamic class buyfullversion extends Button {
public function buyfullversion(){
addFrameScript(4, frame5, 8, frame9, 13, frame14);
}
function frame14(){
stop();
}
function frame5(){
stop();
}
function frame9(){
stop();
}
}
}//package
Section 39
//continuetonextlevel (continuetonextlevel)
package {
import ui.*;
public dynamic class continuetonextlevel extends Button {
public function continuetonextlevel(){
addFrameScript(4, frame5, 8, frame9, 13, frame14);
}
function frame14(){
stop();
}
function frame5(){
stop();
}
function frame9(){
stop();
}
}
}//package
Section 40
//CyanBall (CyanBall)
package {
import VO.*;
public dynamic class CyanBall extends Ball {
}
}//package
Section 41
//Drop (Drop)
package {
import flash.display.*;
public dynamic class Drop extends MovieClip {
public function Drop(){
addFrameScript(50, frame51);
}
function frame51(){
stop();
this.parent.removeChild(this);
}
}
}//package
Section 42
//Explode (Explode)
package {
import flash.media.*;
public dynamic class Explode extends Sound {
}
}//package
Section 43
//GameWin (GameWin)
package {
import flash.display.*;
import flash.text.*;
public dynamic class GameWin extends MovieClip {
public var subBtn:SUBMIT;
public var wellDone:MovieClip;
public var fullBtn:buyfullversion;
public var mv:MovieClip;
public var moreBtn:MOREGAMES;
public var nameTxt:TextField;
public var gameOver:MovieClip;
}
}//package
Section 44
//GreenBall (GreenBall)
package {
import VO.*;
public dynamic class GreenBall extends Ball {
}
}//package
Section 45
//killPlant (killPlant)
package {
import flash.media.*;
public dynamic class killPlant extends Sound {
}
}//package
Section 46
//LevelA (LevelA)
package {
import flash.media.*;
public dynamic class LevelA extends Sound {
}
}//package
Section 47
//LevelB (LevelB)
package {
import flash.media.*;
public dynamic class LevelB extends Sound {
}
}//package
Section 48
//LevelC (LevelC)
package {
import flash.media.*;
public dynamic class LevelC extends Sound {
}
}//package
Section 49
//LevelComplete (LevelComplete)
package {
import flash.media.*;
public dynamic class LevelComplete extends Sound {
}
}//package
Section 50
//LevelFailed (LevelFailed)
package {
import flash.media.*;
public dynamic class LevelFailed extends Sound {
}
}//package
Section 51
//LoadingPage (LoadingPage)
package {
import flash.display.*;
public dynamic class LoadingPage extends MovieClip {
public var maskBar:MovieClip;
public var logoBtn:MovieClip;
}
}//package
Section 52
//Lock (Lock)
package {
import flash.events.*;
import VO.*;
public dynamic class Lock extends Ball {
public function Lock(){
addFrameScript(0, frame1, 11, frame12, 18, frame19);
}
function frame12(){
stop();
this.dispatchEvent(new Event("remove"));
}
function frame19(){
stop();
this.dispatchEvent(new Event("remove"));
}
function frame1(){
stop();
}
}
}//package
Section 53
//MainMusic (MainMusic)
package {
import flash.media.*;
public dynamic class MainMusic extends Sound {
}
}//package
Section 54
//moreGame (moreGame)
package {
import ui.*;
public dynamic class moreGame extends Button {
public function moreGame(){
addFrameScript(4, frame5, 8, frame9, 13, frame14);
}
function frame14(){
stop();
}
function frame5(){
stop();
}
function frame9(){
stop();
}
}
}//package
Section 55
//MOREGAMES (MOREGAMES)
package {
import ui.*;
public dynamic class MOREGAMES extends Button {
public function MOREGAMES(){
addFrameScript(4, frame5, 8, frame9, 13, frame14);
}
function frame14(){
stop();
}
function frame5(){
stop();
}
function frame9(){
stop();
}
}
}//package
Section 56
//MouseOn (MouseOn)
package {
import flash.media.*;
public dynamic class MouseOn extends Sound {
}
}//package
Section 57
//MouseUp (MouseUp)
package {
import flash.media.*;
public dynamic class MouseUp extends Sound {
}
}//package
Section 58
//MushRoomL (MushRoomL)
package {
import VO.*;
public dynamic class MushRoomL extends Ball {
}
}//package
Section 59
//MushRoomR (MushRoomR)
package {
import VO.*;
public dynamic class MushRoomR extends Ball {
}
}//package
Section 60
//MushRoomT (MushRoomT)
package {
import VO.*;
public dynamic class MushRoomT extends Ball {
}
}//package
Section 61
//MushSound (MushSound)
package {
import flash.media.*;
public dynamic class MushSound extends Sound {
}
}//package
Section 62
//Numbers (Numbers)
package {
import flash.events.*;
import flash.display.*;
public dynamic class Numbers extends MovieClip {
public function Numbers(){
addFrameScript(10, frame11);
}
function frame11(){
gotoAndStop(1);
this.dispatchEvent(new Event("carry"));
}
}
}//package
Section 63
//OK (OK)
package {
import ui.*;
public dynamic class OK extends Button {
public function OK(){
addFrameScript(4, frame5, 8, frame9, 13, frame14);
}
function frame14(){
stop();
}
function frame5(){
stop();
}
function frame9(){
stop();
}
}
}//package
Section 64
//PinkBall (PinkBall)
package {
import VO.*;
public dynamic class PinkBall extends Ball {
}
}//package
Section 65
//Plant (Plant)
package {
import VO.*;
public dynamic class Plant extends Ball {
}
}//package
Section 66
//plantEat (plantEat)
package {
import flash.media.*;
public dynamic class plantEat extends Sound {
}
}//package
Section 67
//RedBall (RedBall)
package {
import VO.*;
public dynamic class RedBall extends Ball {
}
}//package
Section 68
//ScoreBoard (ScoreBoard)
package {
import flash.display.*;
import flash.text.*;
public dynamic class ScoreBoard extends MovieClip {
public var backBtn:BACK_;
public var backMainBtn:backtomainscreen;
public var t2s:TextField;
public var t3s:TextField;
public var t4s:TextField;
public var continueBtn:continuetonextlevel;
public var t2:TextField;
public var t3:TextField;
public var t7:TextField;
public var t1:TextField;
public var t9:TextField;
public var t5:TextField;
public var t5s:TextField;
public var t4:TextField;
public var t6s:TextField;
public var t6:TextField;
public var t8:TextField;
public var t7s:TextField;
public var t10:TextField;
public var t8s:TextField;
public var moreBtn:moreGame;
public var t9s:TextField;
public var t1s:TextField;
public var t10s:TextField;
}
}//package
Section 69
//SettingBoard (SettingBoard)
package {
import flash.display.*;
import flash.text.*;
public dynamic class SettingBoard extends MovieClip {
public var backBtn:BACK_;
public var bgVolumeBtn:MovieClip;
public var seVolumeBtn:MovieClip;
public var OKBtn:OK;
public var nameTxt:TextField;
}
}//package
Section 70
//Stub (Stub)
package {
import VO.*;
public dynamic class Stub extends Ball {
}
}//package
Section 71
//SUBMIT (SUBMIT)
package {
import ui.*;
public dynamic class SUBMIT extends Button {
public function SUBMIT(){
addFrameScript(4, frame5, 8, frame9, 13, frame14);
}
function frame14(){
stop();
}
function frame5(){
stop();
}
function frame9(){
stop();
}
}
}//package
Section 72
//Tips (Tips)
package {
import flash.display.*;
public dynamic class Tips extends MovieClip {
public var prevBtn:Btn_nextPg;
public var closeBtn:btn_close;
public var nextBtn:Btn_nextPg;
public function Tips(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 73
//YellowBall (YellowBall)
package {
import VO.*;
public dynamic class YellowBall extends Ball {
}
}//package
Section 74
//YouWin (YouWin)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public dynamic class YouWin extends MovieClip {
public function YouWin(){
addFrameScript(6, frame7);
}
function frame7(){
stop();
setTimeout(remove, 3000);
}
public function remove(){
try {
this.parent.removeChild(this);
this.dispatchEvent(new Event("splashDone"));
} catch(e:Error) {
};
}
}
}//package