Frame 1
function GlobalParent() {
this.ypos = 9000;
this._score = 0;
this._highscore = 0;
this._level = 1;
this.Depth_Count = 0;
this.Ball_Count = 0;
this.BallTypes = 10;
this.BallScale = 275;
this.ActiveBallTypes = 3;
this.Max_x = 480;
this.Max_y = 480;
this.WorldScale = 0;
this._state = "LoadBar";
this.Cur_Ball = 0;
this.Flight_Ball = 0;
this.Reload_Ball = 0;
this.ReloadScale = 0;
this.ReloadRadiius = 20;
this.Radius = 40;
this.ActiveBallCount = 0;
this.Min_x = 0;
this.Min_y = 0;
this.BallValue = 10;
this.Bonus = 100;
this.Cur_Bonus = 0;
this.Level = 1;
this.LevelCounter = 0;
this.BallsPerLevel = 20;
this.BallWidth = 0;
this.Ball_halfheight = 0;
this.Ball_halfwidth = 0;
this.BaseRotationSpeed = 6;
this.RotationSpeed = 0;
this.MaxRotationSpeed = 15;
this.Platform = 0;
this.DefaultBallSpeed = 10;
this.BallSpeed = 0;
this.LevelWindowTimer = 0;
this.Background_Count = 0;
this.CurrentBackground = 0;
this.PiCalculation = (Math.PI/180);
this.BallHolder_Count = 0;
this.ballhandler_mathx = 0;
this.ballhandler_mathy = 0;
this.HighScores_Count = 0;
this.GameOver_Count = 0;
this.MainMenu_Count = 0;
this.MainUI_Count = 0;
this.LoadingData_Count = 0;
this.SavingData_Count = 0;
this.Mute_Count = 0;
this.Instructions_Count = 0;
this.LoadBar_Count = 0;
this.CurrentTrack = 1;
this.BallLoadedStamp = 0;
this.PenaltySpeed = 0;
this.MaxTracks = 3;
this._mute = false;
this.InitLoadTime = 0;
this._slidestep = 0.25;
this.Game_ID = 7;
this.BasePath = "http://games.smallzworld.com/";
this.InitLoadTime = 0;
this.SpecialLinkURL = "";
this.SpecialMessage = "";
this._username = "Default";
this._submitState = false;
}
function SpriteParent(id) {
Global.Sprite_Count++;
this._id = int(id);
this._spriteid = int(Global.Sprite_Count);
this._state = "Inactive";
this._color = 0;
this._xpos = 0;
this._ypos = 0;
this._xspeed = 0;
this._yspeed = 0;
this._targetx = 0;
this._targety = 0;
this._scale = 100;
this._rotation = 0;
this._speed = 0;
this._xslot = 0;
this.JumpCounter = 0;
this._shakecounter = 0;
this._bumpcounter = 0;
this._counter = 0;
this._type = 0;
}
function BallParent(b_id, b_color) {
this._id = b_id;
this._type = b_color;
this._state = 0;
this._scale = Global.BallScale;
this._xspeed = 0;
this._yspeed = 0;
this._rotation = 0;
this._rotating = 0;
this.yspeed = 0;
this.animationstate = 0;
}
function Preloader_Status() {
myLoaded = Math.round(getBytesLoaded());
myTotal = Math.round(getBytesTotal());
myPercent = myLoaded / myTotal;
return(myPercent * 100);
}
function Process_Control_Input(KeyCode) {
if (Mute_1.hitTest(_root._xmouse, _root._ymouse)) {
if (Global._mute) {
Audio_Music.setVolume(100);
Mute_1.gotoAndStop(1);
Global._mute = false;
} else {
Audio_Music.setVolume(0);
Mute_1.gotoAndStop(2);
Global._mute = true;
}
}
if (KeyCode == 0) {
switch (Global._state) {
case "Loading" :
break;
case "MainMenu" :
if (MainMenu_1.StartGame.hitTest(_root._xmouse, _root._ymouse)) {
MC_tween(MainMenu_1, "_xscale", "Regular", 100, 0, 0.75);
MC_tween(MainMenu_1, "_yscale", "Regular", 100, 0, 0.75);
reset_game();
Global._state = "Core";
}
if (MainMenu_1.Instructions.hitTest(_root._xmouse, _root._ymouse)) {
MC_tween(MainMenu_1, "_xscale", "Regular", 100, 0, 0.75);
MC_tween(MainMenu_1, "_yscale", "Regular", 100, 0, 0.75);
Global._state = "Instructions";
}
if (MainMenu_1.HighScores.hitTest(_root._xmouse, _root._ymouse)) {
MC_tween(MainMenu_1, "_xscale", "Regular", 100, 0, 0.75);
MC_tween(MainMenu_1, "_yscale", "Regular", 100, 0, 0.75);
LoadHighScores(Global.Game_ID);
}
if (MainMenu_1.ADDButton.hitTest(_root._xmouse, _root._ymouse)) {
getURL ("http://games.smallzworld.com/Main.php?PageType=DisplayHighScores&Game_ID=7", "_blank");
}
break;
case "Core" :
if (Global.Flight_Ball == 0) {
Global.PenaltySpeed = 0;
release_ball();
}
break;
case "GameOver" :
if (GameOver_1.Back.hitTest(_root._xmouse, _root._ymouse)) {
MC_hide(GameOver_1);
MC_tween(GameOver_1, "_xscale", "Regular", 100, 0, 0.75);
MC_tween(GameOver_1, "_yscale", "Regular", 100, 0, 0.75);
MC_tween(MainUI_1, "_xscale", "Regular", 100, 0, 0.75);
MC_tween(MainUI_1, "_yscale", "Regular", 100, 0, 0.75);
Global._state = "MainMenu";
}
if ((GameOver_1.Submit.hitTest(_root._xmouse, _root._ymouse) && (Global._submitState == false)) && (KeyCode == 0)) {
Global._submitState = true;
Global._username = _root.GameOver_1.UserName.text;
MC_hide(GameOver_1.Submit);
MC_hide(GameOver_1.UserName);
MC_hide(GameOver_1.Label);
SaveHighScore(Global.Game_ID, 0, Global._username, 0, Global._score, 0, "No Comment");
}
break;
case "HighScores" :
if (HighScores_1.Back.hitTest(_root._xmouse, _root._ymouse)) {
MC_hide(HighScores_1);
Global._state = "MainMenu";
}
break;
case "Instructions" :
if (!Instructions_1.Back.hitTest(_root._xmouse, _root._ymouse)) {
break;
}
MC_tween(Instructions_1, "_xscale", "Regular", 100, 0, 0.75);
MC_tween(Instructions_1, "_yscale", "Regular", 100, 0, 0.75);
Global._state = "MainMenu";
}
}
}
function reset_balls() {
b = 1;
while (b <= Global.Ball_Count) {
_root["BallInfo_" + b]._state = "Inactive";
_root["BallInfo_" + b]._xpos = -500;
_root["BallInfo_" + b]._scale = Global.BallScale;
_root["Ball_" + b].gotoAndStop(20);
MC_pos("Ball_" + b, _root["BallInfo_" + b]._xpos, _root["BallInfo_" + b]._ypos);
MC_scale("Ball_" + b, _root["BallInfo_" + b]._scale);
b++;
}
}
function reset_game() {
reset_balls();
Global.Cur_Ball = 0;
Global.Reload_Ball = 0;
Global.Flight_Ball = 0;
Global._score = 0;
Global._level = 1;
Global.LevelCounter = Global.BallsPerLevel;
Global.Cur_Bonus = Global.Bonus;
Global.DeadBallFlag_1 = 0;
Global.DeadBallFlag_2 = 0;
Global.FinishedBall_1 = 0;
Global.FinishedBall_2 = 0;
BallHolderData_InitTime = getTimer();
Global.RotationSpeed = Global.BaseRotationSpeed;
Global.ActiveBallTypes = 3;
Global.Cur_Bonus = Global.Bonus;
Global.BallSpeed = Global.DefaultBallSpeed;
MC_rotate(BallHolder_1, 0);
}
function update_ball(ball_id, xpos, ypos) {
MC_pos(_root["Ball_" + ball_id], xpos, ypos);
}
function release_ball() {
if ((_root["BallInfo_" + Global.Cur_Ball]._state == "Loaded") && (Global.Flight_Ball == 0)) {
_root["BallInfo_" + Global.Cur_Ball]._state = "Flying";
FireAngle = (BallHolderInfo_1._rotation * (Math.PI/180)) + 90;
_root["BallInfo_" + Global.Cur_Ball]._xspeed = Global.BallSpeed * Math.cos(FireAngle);
_root["BallInfo_" + Global.Cur_Ball]._yspeed = Global.BallSpeed * Math.sin(FireAngle);
Global.Flight_Ball = Global.Cur_Ball;
Global.Cur_Ball = 0;
}
}
function check_collision(ball_1, ball_2) {
Global.Ball_halfwidth = _root["Ball_" + ball_1]._width / 2;
Global.Ball_halfheight = _root["Ball_" + ball_1]._height / 2;
BallWidthSquared = _root["Ball_" + ball_1]._width * _root["Ball_" + ball_1]._width;
cx = _root["BallInfo_" + ball_1]._xpos;
cy = _root["BallInfo_" + ball_1]._ypos;
px = cx - Global.Ball_halfwidth;
py = cy - Global.Ball_halfheight;
tcx = _root["BallInfo_" + ball_2]._xpos;
tcy = _root["BallInfo_" + ball_2]._ypos;
x1 = tcx - Global.Ball_halfwidth;
y1 = tcy - Global.Ball_halfheight;
delta_x = x1 - px;
delta_y = y1 - py;
if (((delta_x * delta_x) + (delta_y * delta_y)) <= BallWidthSquared) {
collision_check = 1;
} else {
collision_check = 0;
}
return(collision_check);
}
function update_balls() {
c_ball = 1;
while (c_ball <= Global.Ball_Count) {
BallState = _root["BallInfo_" + c_ball]._state;
switch (BallState) {
case "Loading" :
_root["BallInfo_" + c_ball]._xpos = int(_root.BallHolderInfo_1._xpos + Global.ballhandler_mathx);
_root["BallInfo_" + c_ball]._ypos = int(_root.BallHolderInfo_1._ypos + Global.ballhandler_mathy);
_root["BallInfo_" + c_ball]._scale = _root["BallInfo_" + c_ball]._scale + 15;
if (_root["BallInfo_" + c_ball]._scale >= Global.BallScale) {
_root["BallInfo_" + c_ball]._scale = Global.BallScale;
_root["BallInfo_" + c_ball]._state = "Loaded";
Global.BallLoadedStamp = getTimer();
}
MC_pos(_root["Ball_" + c_ball], _root["BallInfo_" + c_ball]._xpos, _root["BallInfo_" + c_ball]._ypos);
MC_scale(_root["Ball_" + c_ball], _root["BallInfo_" + c_ball]._scale);
break;
case "Loaded" :
_root["BallInfo_" + c_ball]._xpos = int(_root.BallHolderInfo_1._xpos + Global.ballhandler_mathx);
_root["BallInfo_" + c_ball]._ypos = int(_root.BallHolderInfo_1._ypos + Global.ballhandler_mathy);
MC_pos(_root["Ball_" + c_ball], _root["BallInfo_" + c_ball]._xpos, _root["BallInfo_" + c_ball]._ypos);
check_current_ball_collision();
break;
case "Flying" :
_root["BallInfo_" + c_ball]._xpos = _root["BallInfo_" + c_ball]._xpos + _root["BallInfo_" + c_ball]._xspeed;
_root["BallInfo_" + c_ball]._ypos = _root["BallInfo_" + c_ball]._ypos + _root["BallInfo_" + c_ball]._yspeed;
MC_pos(_root["Ball_" + c_ball], _root["BallInfo_" + c_ball]._xpos, _root["BallInfo_" + c_ball]._ypos);
check_flight_ball_collision(c_ball);
if (_root["BallInfo_" + c_ball]._state == "Flying") {
check_for_boundary_collision(c_ball);
}
break;
case "Stuck" :
MC_pos(_root["Ball_" + c_ball], _root["BallInfo_" + c_ball]._xpos, _root["BallInfo_" + c_ball]._ypos);
break;
case "Exploding" :
_root["BallInfo_" + c_ball]._rotation = _root["BallInfo_" + c_ball]._rotation + 35;
_root["BallInfo_" + c_ball]._scale = _root["BallInfo_" + c_ball]._scale - 20;
_root["BallInfo_" + c_ball]._xpos = _root["BallInfo_" + c_ball]._xpos + (random(11) - 5);
_root["BallInfo_" + c_ball]._ypos = _root["BallInfo_" + c_ball]._ypos + (random(11) - 5);
if (_root["BallInfo_" + c_ball]._scale < 1) {
_root["BallInfo_" + c_ball]._state = "Inactive";
_root["BallInfo_" + c_ball]._xpos = -500;
_root["BallInfo_" + c_ball]._scale = Global.BallScale;
_root["BallInfo_" + c_ball]._rotation = 0;
}
MC_pos(_root["Ball_" + c_ball], _root["BallInfo_" + c_ball]._xpos, _root["BallInfo_" + c_ball]._ypos);
MC_rotate(_root["Ball_" + c_ball], _root["BallInfo_" + c_ball]._rotation);
MC_scale(_root["Ball_" + c_ball], _root["BallInfo_" + c_ball]._scale);
}
c_ball++;
}
if (_root["BallInfo_" + Global.Flight_Ball]._state != "Flying") {
Global.Flight_Ball = 0;
}
}
function check_flight_ball_collision(FlightBall_ID) {
cb = 1;
while (cb <= Global.Ball_Count) {
if ((_root["BallInfo_" + cb]._state == "Stuck") && (cb != FlightBall_ID)) {
collision_check = check_collision(FlightBall_ID, cb);
if (collision_check == 1) {
if (_root["BallInfo_" + cb]._type == _root["BallInfo_" + FlightBall_ID]._type) {
trace((_root["BallInfo_" + cb]._type + " : ") + _root["BallInfo_" + FlightBall_ID]._type);
_root["BallInfo_" + cb]._state = "Exploding";
_root["BallInfo_" + FlightBall_ID]._state = "Exploding";
Global._score = Global._score + int(Global.BallValue + (int(Global.Cur_Bonus) * 10));
Global.Cur_Bonus = Global.Cur_Bonus + (Global._level * Global.Bonus);
Global.LevelCounter = Global.LevelCounter - 2;
if (Global.LevelCounter < 1) {
increment_level();
}
break;
}
_root["BallInfo_" + FlightBall_ID]._state = "Stuck";
}
}
cb++;
}
}
function check_for_boundary_collision(FlightBall_ID) {
Global.BallWidth = _root["Ball_" + FlightBall_ID]._width;
Ball_x = _root["BallInfo_" + FlightBall_ID]._xpos;
if (_root["BallInfo_" + FlightBall_ID]._xpos > (Global.Max_x - (Global.BallWidth / 2))) {
_root["BallInfo_" + FlightBall_ID]._xpos = Global.Max_x - (Global.BallWidth / 2);
_root["BallInfo_" + FlightBall_ID]._state = "Stuck";
}
if (_root["BallInfo_" + FlightBall_ID]._xpos < (Global.Min_x + (Global.BallWidth / 2))) {
_root["BallInfo_" + FlightBall_ID]._xpos = Global.Min_x + (Global.BallWidth / 2);
_root["BallInfo_" + FlightBall_ID]._state = "Stuck";
}
if (_root["BallInfo_" + FlightBall_ID]._ypos > (Global.Max_y - (Global.BallWidth / 2))) {
_root["BallInfo_" + FlightBall_ID]._ypos = Global.Max_y - (Global.BallWidth / 2);
_root["BallInfo_" + FlightBall_ID]._state = "Stuck";
}
if (_root["BallInfo_" + FlightBall_ID]._ypos < (Global.Min_y + (Global.BallWidth / 2))) {
_root["BallInfo_" + FlightBall_ID]._ypos = Global.Min_y + (Global.BallWidth / 2);
_root["BallInfo_" + FlightBall_ID]._state = "Stuck";
}
}
function update_ballholder() {
LoadedTime = (getTimer() - Global.BallLoadedStamp) / 1000;
if (LoadedTime > 3) {
Global.PenaltySpeed = Global.PenaltySpeed + 0.05;
if (Global.PenaltySpeed > 10) {
Global.PenaltySpeed = 10;
}
}
New_rotation = (BallHolderInfo_1._rotation + Global.RotationSpeed) + Global.PenaltySpeed;
if (New_rotation > 360) {
New_rotation = New_rotation - 360;
}
BallHolderInfo_1._rotation = New_rotation;
BallHolderInfo_1._xpos = Global.Max_x / 2;
BallHolderInfo_1._ypos = Global.Max_y / 2;
ballholder_rotation = New_rotation + 90;
Global.ballhandler_mathx = Global.Radius * Math.cos(ballholder_rotation * Global.PiCalculation);
Global.ballhandler_mathy = Global.Radius * Math.sin(ballholder_rotation * Global.PiCalculation);
MC_rotate(BallHolder_1, BallHolderInfo_1._rotation);
MC_pos(BallHolder_1, BallHolderInfo_1._xpos, BallHolderInfo_1._ypos);
}
function select_new_ball() {
MC_scale(BallHolder_1, 100);
NewBallType = random(Global.ActiveBallTypes) + 1;
BallFound_Flag = 0;
c_ball = 1;
while (c_ball <= Global.Ball_Count) {
ball_state = _root["BallInfo_" + c_ball]._state;
if (ball_state == "Inactive") {
Global.Cur_Ball = c_ball;
Global.Reload_Ball = c_ball;
Global.ActiveBallCount++;
_root["BallInfo_" + c_ball]._state = "Loading";
_root["BallInfo_" + c_ball]._type = NewBallType;
_root["BallInfo_" + c_ball]._scale = 0;
_root["Ball_" + c_ball].gotoAndStop(NewBallType);
Global.ReloadScale = 0;
break;
}
c_ball++;
}
}
function reload_ball() {
if (Global.Platform == 1) {
_root["BallInfo_" + Global.Reload_Ball]._state = "Loaded";
Global.Reload_Ball = 0;
BallHolderData_InitTime = getTimer();
} else {
Global.ReloadRadius = 20;
_root["BallInfo_" + Global.Reload_Ball]._xpos = int(BallHolderInfo_1._xpos + Global.ballhandler_mathx);
_root["BallInfo_" + Global.Reload_Ball]._ypos = int(BallHolderInfo_1._ypos + Global.ballhandler_mathy);
Global.ReloadScale = Global.ReloadScale + 15;
MC_scale(_root["Ball_" + Global.Reload_Ball], _root["BallInfo_" + Global.Reload_Ball]._scale);
if (Global.ReloadScale >= Global.BallScale) {
trace("done reloading");
_root["BallInfo_" + Global.Reload_Ball]._state = 1;
MC_scale(_root["Ball_" + Global.Reload_Ball], Global.BallScale);
Global.Reload_Ball = 0;
BallHolderData_InitTime = getTimer();
}
}
}
function update_dead_ball(Datastruct) {
Datastruct._scale = Datastruct._scale - 25;
Datastruct._rotation = Datastruct._rotation + 25;
setProperty("Ball_" + Datastruct._id, _xscale , Datastruct._scale);
setProperty("Ball_" + Datastruct._id, _yscale , Datastruct._scale);
setProperty("Ball_" + Datastruct._id, _rotation , Datastruct._rotation);
if (Datastruct._scale < 10) {
Datastruct._state = 0;
setProperty("Ball_" + Datastruct._id, _x , -150);
setProperty("Ball_" + Datastruct._id, _y , -150);
Datastruct._scale = Global.BallScale;
Datastruct._rotation = 0;
if (Global.FinishedBall_1 == 0) {
Global.FinishedBall_1 = Datastruct._id;
} else {
Global.FinishedBall_2 = Datastruct._id;
}
if (Global.DeadBallFlag_1 == Datastruct._id) {
Global.DeadBallFlag_1 = 0;
}
if (Global.DeadBallFlag_2 == Datastruct._id) {
Global.DeadBallFlag_2 = 0;
}
setProperty("Ball_" + Datastruct._id, _xscale , Datastruct._scale);
setProperty("Ball_" + Datastruct._id, _yscale , Datastruct._scale);
setProperty("Ball_" + Datastruct._id, _rotation , Datastruct._rotation);
}
}
function check_current_ball_collision() {
cb = 1;
while (cb <= Global.Ball_Count) {
if (((((_root["BallInfo_" + cb]._state == "Stuck") && (_root["BallInfo_" + cb]._xpos > 150)) && (_root["BallInfo_" + cb]._xpos < 330)) && (_root["BallInfo_" + cb]._ypos > 150)) && (_root["BallInfo_" + cb]._ypos < 330)) {
c_check = check_collision(Global.Cur_Ball, cb);
if (c_check == 1) {
Global._state = "GameOver";
add_high_score();
Global.GameOverTimer = 250;
}
}
cb++;
}
}
function update_current_ball() {
New_X = int(_root.BallHolderInfo_1._xpos + Global.ballhandler_mathx);
New_Y = int(_root.BallHolderInfo_1._ypos + Global.ballhandler_mathy);
MC_pos(_root["Ball_" + Global.Cur_Ball], New_X, New_Y);
cx = _root["BallInfo_" + Global.Cur_Ball]._xpos;
cy = _root["BallInfo_" + Global.Cur_Ball]._ypos;
px1 = int(cx - Global.Ball_halfwidth);
py1 = int(cy - Global.Ball_halfheight);
cb = 1;
while (cb <= Global.ActiveBallCount) {
tempball_id = _root["BallList" + cb];
tcx = _root["BallInfo_" + tempball_id]._xpos;
tcy = _root["BallInfo_" + tempball_id]._ypos;
xdiff = tcx - cx;
ydiff = tcy - cy;
if (xdiff < 0) {
xdiff = -xdiff;
}
if (ydiff < 0) {
ydiff = -ydiff;
}
x1 = tcx - Global.Ball_halfwidth;
y1 = tcy - Global.Ball_halfheight;
delta_x = x1 - px1;
delta_y = y1 - py1;
Exclude = 1;
if ((tempball_id != Global.Flight_Ball) && (Global.Reload_Ball == 0)) {
if (tempball_id != Global.Cur_Ball) {
if (xdiff <= Global.BallWidth) {
if (ydiff <= Global.BallWidth) {
Exclude = 0;
}
}
}
}
if (Exclude == 0) {
if (((delta_x * delta_x) + (delta_y * delta_y)) <= BallWidthSquared) {
collision_check = 1;
} else {
collision_check = 0;
}
if (collision_check == 1) {
Global._state = 3;
add_high_score();
Global.GameOverTimer = 150;
}
}
cb++;
}
}
function update_release_timer() {
Cur_Time = getTimer();
Elapsed_Time = (Cur_Time - BallHolderData_InitTime) / 1000;
if ((Elapsed_Time > 5) && (BallHolderData_InitTime != 0)) {
BallHolderData_InitTime = 0;
release_ball();
}
}
function kill_finished_ball(ball_id) {
z = 1;
while (z <= Global.ActiveBallCount) {
if (_root["BallList" + z] == ball_id) {
_root["BallList" + z] = _root["BallList" + Global.ActiveBallCount];
_root["BallList" + Global.ActiveBallCount] = 0;
Global.ActiveBallCount--;
break;
}
z++;
}
}
function finished_ball_check() {
if (Global.FinishedBall_1 > 0) {
kill_finished_ball(Global.FinishedBall_1);
}
if (Global.FinishedBall_2 > 0) {
kill_finished_ball(Global.FinishedBall_2);
}
}
function dead_ball_check() {
if (Global.DeadBallFlag_1 > 0) {
update_dead_ball(_root["BallInfo_" + Global.DeadBallFlag_1]);
}
if (Global.DeadBallFlag_2 > 0) {
update_dead_ball(_root["BallInfo_" + Global.DeadBallFlag_2]);
}
}
function update_background() {
}
function increment_level() {
Global._level++;
Global.ActiveBallTypes++;
if (Global.ActiveBallTypes > Global.BallTypes) {
Global.ActiveBallTypes = Global.BallTypes;
}
Global.LevelCounter = Global.BallsPerLevel;
Global.RotationSpeed = Global.RotationSpeed + 0.5;
if (Global.RotationSpeed > Global.MaxRotationSpeed) {
Global.RotatationSpeed = Global.MaxRotationSpeed;
}
switch (Global._level) {
case 2 :
break;
case 3 :
}
display_new_level();
new_background();
update_background();
}
function increment_background() {
Global.CurrentBackground++;
if (Global.CurrentBackground > Global.Background_Count) {
Global.CurrentBackground = 1;
}
_root[Background_1].gotoAndStop(Global.Background_Count);
}
function Create_MovieClip(ObjectName, Instance) {
Global.Depth_Count++;
Global[Instance + "_Count"]++;
Index = Global[Instance + "_Count"];
InstanceName = (Instance + "_") + Index;
InstanceInfoName = (Instance + "Info_") + Index;
SymbolName = ObjectName + "Symbol";
_root[InstanceInfoName] = new SpriteParent(Index);
_root.attachMovie(SymbolName, InstanceName, Global.Depth_Count);
_root[InstanceName].cacheAsBitmap;
_root[InstanceName].gotoAndStop(1);
return(Index);
}
function create_instances(ObjectName, Instance, amount) {
c_instance = 1;
while (c_instance <= amount) {
trace((ObjectName + " : ") + c_instance);
New_Index = Create_MovieClip(ObjectName, Instance);
c_instance++;
}
}
function initialize_balls(amount) {
TypeCount = int(amount / Global.BallTypes);
c_type = 1;
while (c_type <= Global.BallTypes) {
c_count = 1;
while (c_count <= TypeCount) {
Global.Depth_Count++;
Global.Ball_Count++;
BallTypeNum = c_type;
BallType = _root["BallType_" + c_type];
trace(BallType);
_root.createEmptyMovieClip("Ball_" + Global.Ball_Count, Global.Depth_Count);
_root.attachMovie(BallType + "BallSymbol", "Ball_" + Global.Ball_Count, Global.Depth_Count);
setProperty(_root["Ball_" + Global.Ball_Count], _x , ((Global.Ball_Count - 1) * 5) + 5);
setProperty(_root["Ball_" + Global.Ball_Count], _y , 800);
setProperty(_root["Ball_" + Global.Ball_Count], _xscale , Global.BallScale);
setProperty(_root["Ball_" + Global.Ball_Count], _yscale , Global.BallScale);
setProperty(_root["Ball_" + Global.Ball_Count], _alpha , 80);
b_color = BallTypeNum;
_root["BallInfo_" + Global.Ball_Count] = new BallParent(Global.Ball_Count, b_color);
trace(("Ball # " + Global.Ball_Count) + " Created");
c_count++;
}
c_type++;
}
Global.BallWidth = Ball_1._width;
Global.Ball_halfheight = Ball_1._height / 2;
Global.Ball_halfwidth = Ball_1._width / 2;
BallWidthSquared = Global.BallWidth * Global.BallWidth;
PiCalculation = (Math.PI/180);
}
function initialize_ballholder() {
BallHolder._x = 240;
BallHolder._y = 240;
}
function MC_alpha(InstanceName, pct) {
setProperty(InstanceName, _alpha , pct);
}
function MC_rotate(InstanceName, angle) {
setProperty(InstanceName, _rotation , angle);
}
function MC_pos(InstanceName, loc_x, loc_y) {
setProperty(InstanceName, _x , loc_x);
setProperty(InstanceName, _y , loc_y);
}
function MC_scale(InstanceName, newscale) {
setProperty(InstanceName, _xscale , newscale);
setProperty(InstanceName, _yscale , newscale);
}
function MC_size(InstanceName, new_width, new_height) {
setProperty(InstanceName, _width , new_width);
setProperty(InstanceName, _height , new_height);
}
function MC_show(InstanceName) {
setProperty(InstanceName, _visible , 1);
}
function MC_hide(InstanceName) {
setProperty(InstanceName, _visible , 0);
}
function MC_tween(ObjectName, Property, tweenType, Begin, End, Time) {
switch (tweenType) {
case "Bounce" :
easeType = mx.transitions.easing.Bounce.easeOut;
break;
case "Strong" :
easeType = mx.transitions.easing.Strong.easeOut;
break;
case "Back" :
easeType = mx.transitions.easing.Back.easeOut;
break;
case "Elastic" :
easeType = mx.transitions.easing.Elastic.easeOut;
break;
case "Regular" :
easeType = mx.transitions.easing.Regular.easeOut;
break;
case "None" :
easeType = mx.transitions.easing.None.easeOut;
}
Tween = new mx.transitions.Tween(ObjectName, Property, easeType, Begin, End, Time, true);
}
function display_prompt(PromptText, loc_x, loc_y) {
Prompt.PromptText.text = PromptText;
MC_pos("Prompt", loc_x, loc_y);
MC_show("Prompt");
}
function main_loop() {
check_rollovers(ButtonList, Global._state);
switch (Global._state) {
case "MainMenu" :
if ((MainMenu_1._visible == 0) || (MainMenu_1._xscale == 0)) {
MC_tween(MainMenu_1, "_xscale", "Regular", 5, 100, 0.75);
MC_tween(MainMenu_1, "_yscale", "Regular", 5, 100, 0.75);
MC_show(MainMenu_1);
if (Global.SpecialMessage != undefined) {
MainMenu_1.Message.MessageText.text = Global.SpecialMessage;
}
}
return;
case "Core" :
if ((MainUI_1._visible == 0) || (MainUI_1._xscale == 0)) {
MC_tween(MainUI_1, "_xscale", "Regular", 5, 100, 0.75);
MC_tween(MainUI_1, "_yscale", "Regular", 5, 100, 0.75);
MC_show(MainUI_1);
MC_show(BallHolder_1);
}
update_ballholder();
update_background();
update_balls();
if (Global.Flight_Ball > 0) {
}
if (Global.Cur_Ball == 0) {
select_new_ball();
Global.ReloadScale = 0;
}
dead_ball_check();
if (Global.Reload_Ball > 0) {
}
if (Global.Cur_Ball > 0) {
}
finished_ball_check();
update_score_UI();
return;
case "GameOver" :
if ((GameOver_1._visible == 0) || (GameOver_1._xscale == 0)) {
MC_tween(GameOver_1, "_xscale", "Regular", 5, 100, 0.75);
MC_tween(GameOver_1, "_yscale", "Regular", 5, 100, 0.75);
Global._submitState = false;
MC_show(GameOver_1);
if (Global._score > Global._highscore) {
Global._highscore = Global._score;
}
GameOver_1.ScoreText.text = "Score\r" + Global._score;
GameOver_1.HighScoreText.text = "High Score\r" + Global._highscore;
GameOver_1.UserName.text = Global._username;
MC_show(GameOver_1.Submit);
MC_show(GameOver_1.UserName);
MC_show(GameOver_1.Label);
MC_hide(BallHolder_1);
}
return;
case "LevelChange" :
update_background();
return;
case "Instructions" :
if ((Instructions_1._visible == 0) || (Instructions_1._xscale == 0)) {
MC_tween(Instructions_1, "_xscale", "Regular", 5, 100, 0.75);
MC_tween(Instructions_1, "_yscale", "Regular", 5, 100, 0.75);
MC_show(Instructions_1);
}
return;
case "HighScores" :
update_background();
if (HighScores_1._visible == 0) {
MC_show(HighScores_1);
index = 1;
while (index <= 10) {
MC_hide(HighScores_1["Listing_" + index]);
index++;
}
output_high_scores();
}
return;
case "LoadingData" :
if (LoadingData_1._visible == 0) {
Global.InitLoadTime = getTimer();
MC_show(LoadingData_1);
}
elapsedTime = update_timer(Global.InitLoadTime);
if (elapsedTime > 45) {
MC_hide(LoadingData_1);
Global._state = "MainMenu";
}
return;
case "SavingData" :
if (SavingData_1._visible != 0) {
break;
}
MC_show(SavingData_1);
}
}
function update_score_UI() {
var _local2;
MainUI_1.Score.text = int(_root.Global._score);
if (Global._score > Global._highscore) {
Global._highscore = Global._score;
}
MainUI_1.HighScore.text = int(_root.Global._highscore);
MainUI_1.Level.text = "Level " + Global._level;
if (Global.Cur_Bonus > 0) {
MainUI_1.BonusLabel.text = "Bonus ";
MainUI_1.Bonus.text = "Bonus " + (int(Global.Cur_Bonus) * 10);
} else {
MainUI_1.BonusLabel.text = "";
MainUI_1.Bonus.text = "";
}
}
function Init_ui() {
create_instances("Instructions", "Instructions", 1);
create_instances("MainMenu", "MainMenu", 1);
create_instances("MainUI", "MainUI", 1);
create_instances("GameOver", "GameOver", 1);
create_instances("HighScores", "HighScores", 1);
create_instances("LoadingData", "LoadingData", 1);
create_instances("SavingData", "SavingData", 1);
create_instances("Mute", "Mute", 1);
MC_hide(Instructions_1);
MC_hide(MainUI_1);
MC_hide(GameOver_1);
MC_hide(LoadingData_1);
MC_hide(SavingData_1);
MC_hide(HighScores_1);
MC_pos(MainUI_1, 240, 240);
ButtonList = button_setup(ButtonList);
MC_pos(Mute_1, 10, 440);
}
function button_setup(button_array) {
button_array = init_button(button_array, MainMenu_1.StartGame, "MainMenu", 100, 125);
button_array = init_button(button_array, MainMenu_1.HighScores, "MainMenu", 100, 125);
button_array = init_button(button_array, MainMenu_1.Instructions, "MainMenu", 100, 125);
button_array = init_button(button_array, MainMenu_1.ADDButton, "MainMenu", 100, 125);
button_array = init_button(button_array, MainMenu_1.Message, "MainMenu", 100, 125);
button_array = init_button(button_array, Instructions_1.Back, "Instructions", 100, 125);
button_array = init_button(button_array, GameOver_1.Back, "GameOver", 100, 125);
button_array = init_button(button_array, GameOver_1.Submit, "GameOver", 100, 125);
button_array = init_button(button_array, HighScores_1.Back, "HighScores", 100, 125);
return(button_array);
}
function Init_Background() {
cb = 1;
while (cb <= Global.Background_Count) {
_root["BackgroundInfo_" + cb]._x = 0;
_root["BackgroundInfo_" + cb]._y = 0;
_root["BackgroundInfo_" + cb]._width = Global.Max_x;
_root["BackgroundInfo_" + cb]._height = Global.Max_y;
cb++;
}
}
function Init_Ballholder() {
BallHolderInfo_1._xpos = Global.Max_x / 2;
BallHolderInfo_1._ypos = (Global.Max_y - (ScorePanel_1._height + 2)) / 2;
}
function LoadHighScores(game_id) {
clear_high_scores();
Global._phpRoutine = "LoadHighScores";
PHPSendData.Routine = "LoadHighScores";
PHPSendData.Game_ID = game_id;
PHPSendData.sendAndLoad(Global.BasePath + "RecordManagement.php", PHPLoadData, "GET");
Global.InitLoadTime = getTimer();
Global._state = "LoadingData";
}
function SaveHighScore(game_id, profile_id, user_name, level, score, time_score, comment) {
Global._phpRoutine = "AddHighScore";
PHPSendData.Routine = "AddHighScore";
PHPSendData.Game_ID = game_id;
PHPSendData.Profile_ID = profile_id;
PHPSendData.UserName = user_name;
PHPSendData.Level = level;
PHPSendData.Score = score;
PHPSendData.TimeScore = time_score;
PHPSendData.Comment = comment;
trace("User Name : " + user_name);
PHPSendData.sendAndLoad(Global.BasePath + "RecordManagement.php", PHPLoadData, "GET");
Global.InitLoadTime = getTimer();
Global._state = "SavingData";
}
function process_php_data(Routine) {
switch (Routine) {
case "AddHighScore" :
MC_hide(SavingData_1);
Global._state = "GameOver";
break;
case "LoadHighScores" :
Global.SpecialMessage = PHPLoadData.SpecialMessage;
Global.SpecialLinkURL = PHPLoadData.SpecialLinkURL;
MC_hide(LoadingData_1);
Global._state = "HighScores";
break;
case "LoadSomeText" :
Global.SpecialMessage = PHPLoadData.SpecialMessage;
Global.SpecialLinkURL = PHPLoadData.SpecialLinkURL;
MC_hide(LoadingData_1);
Global._state = "MainMenu";
}
}
function ButtonInfo(instance_name, game_state, min_scale, max_scale) {
this._instance = instance_name;
this._state = game_state;
this._min = min_scale;
this._max = max_scale;
}
function init_button(button_array, instance_name, game_state, min_scale, max_scale) {
button_array[button_array.length] = new ButtonInfo(instance_name, game_state, min_scale, max_scale);
return(button_array);
}
function check_rollovers(button_array, game_state) {
var index;
for (index in button_array) {
with (button_array[index]) {
if (_state == game_state) {
if (_instance.hitTest(_root._xmouse, _root._ymouse)) {
MC_scale(_instance, _max);
} else {
MC_scale(_instance, _min);
}
}
}
}
}
function output_high_scores() {
var _local1;
_local1 = 1;
while (_local1 <= 10) {
if (PHPLoadData["Score_" + _local1]) {
HighScores_1["Listing_" + _local1].Rank.text = _local1;
HighScores_1["Listing_" + _local1].Score.text = PHPLoadData["Score_" + _local1];
HighScores_1["Listing_" + _local1].User.text = PHPLoadData["User_" + _local1];
MC_show(HighScores_1["Listing_" + _local1]);
}
_local1++;
}
}
System.security.loadPolicyFile("http://games.smallzworld.com/crossdomain.xml");
Global = new GlobalParent();
ButtonList = new Array();
create_instances("Load", "LoadBar", 1);
LoadBar_1._x = Global.Max_x / 2;
LoadBar_1._y = 100;
mouseObj = new Object();
Mouse.addListener(mouseObj);
mouseObj.onMouseUp = function () {
Process_Control_Input(0);
};
userKey = new Object();
userKey.onKeyDown = function () {
KeyCode = Number(Key.getCode());
Process_Control_Input(KeyCode);
};
Key.addListener(userKey);
var PHPSendData = new LoadVars();
var PHPLoadData = new LoadVars();
PHPLoadData.onLoad = function (success) {
if (success) {
process_php_data(Global._phpRoutine);
}
};
Frame 2
MochiAd.showPreloaderAd({id:"3ffc2c9f857831bc", res:"480x480"});
Frame 3
LoadBar_1.LoadText.text = ("Loading : " + int(Preloader_Status())) + "%";
if (Preloader_Status() < 100) {
gotoAndPlay (2);
}
Frame 5
MC_hide(LoadBar_1);
create_instances("Background", "Background", 1);
create_instances("BallHolder", "BallHolder", 1);
create_instances("ColoredSphere", "Ball", 50);
Init_ui();
MC_alpha(Background_1, 60);
MC_hide(BallHolder_1);
Frame 6
Audio_Music = new Sound();
Audio_Music.attachSound("Orbit");
Audio_Music.start();
Audio_Music.onSoundComplete = function () {
Audio_Music.start();
};
if ((MuteFlag != undefined) && (MuteFlag.toUpperCase() == "TRUE")) {
Audio_Music.setVolume(0);
Mute_1.gotoAndStop(2);
Global._mute = true;
} else {
Audio_Music.start();
}
Init_Background();
Init_Ballholder();
Global._state = "MainMenu";
reset_game();
Background_1._x = -40;
Frame 7
Background_1._x = Background_1._x + Global._slidestep;
if ((Background_1._x > -5) || (Background_1._x < -50)) {
Global._slidestep = -Global._slidestep;
}
main_loop();
Frame 8
Global.Cur_Bonus = Global.Cur_Bonus - ((Global._level * Global.Bonus) / 95);
if (Global.Cur_Bonus < 0) {
Global.Cur_Bonus = 0;
}
gotoAndPlay (7);
Symbol 90 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 91 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 92 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 93 MovieClip [__Packages.mx.transitions.easing.Elastic] Frame 0
class mx.transitions.easing.Elastic
{
function Elastic () {
}
static function easeIn(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / d;
if (t == 1) {
return(b + c);
}
if (!p) {
p = d * 0.3;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
t = t - 1;
return((-((a * Math.pow(2, 10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p))) + b);
}
static function easeOut(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / d;
if (t == 1) {
return(b + c);
}
if (!p) {
p = d * 0.3;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
return((((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p)) + c) + b);
}
static function easeInOut(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / (d / 2);
if (t == 2) {
return(b + c);
}
if (!p) {
p = d * 0.45;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
if (t < 1) {
t = t - 1;
return((-0.5 * ((a * Math.pow(2, 10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p))) + b);
}
t = t - 1;
return(((((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p)) * 0.5) + c) + b);
}
static var version = "1.1.0.52";
}
Symbol 94 MovieClip [__Packages.mx.transitions.easing.Strong] Frame 0
class mx.transitions.easing.Strong
{
function Strong () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return((((((c * t) * t) * t) * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = (t / d) - 1;
return((c * (((((t * t) * t) * t) * t) + 1)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return(((((((c / 2) * t) * t) * t) * t) * t) + b);
}
t = t - 2;
return(((c / 2) * (((((t * t) * t) * t) * t) + 2)) + b);
}
static var version = "1.1.0.52";
}
Symbol 95 MovieClip [__Packages.mx.transitions.easing.Back] Frame 0
class mx.transitions.easing.Back
{
function Back () {
}
static function easeIn(t, b, c, d, s) {
if (s == undefined) {
s = 1.70158;
}
t = t / d;
return((((c * t) * t) * (((s + 1) * t) - s)) + b);
}
static function easeOut(t, b, c, d, s) {
if (s == undefined) {
s = 1.70158;
}
t = (t / d) - 1;
return((c * (((t * t) * (((s + 1) * t) + s)) + 1)) + b);
}
static function easeInOut(t, b, c, d, s) {
if (s == undefined) {
s = 1.70158;
}
t = t / (d / 2);
if (t < 1) {
s = s * 1.525;
return(((c / 2) * ((t * t) * (((s + 1) * t) - s))) + b);
}
t = t - 2;
s = s * 1.525;
return(((c / 2) * (((t * t) * (((s + 1) * t) + s)) + 2)) + b);
}
static var version = "1.1.0.52";
}
Symbol 96 MovieClip [__Packages.mx.transitions.easing.Bounce] Frame 0
class mx.transitions.easing.Bounce
{
function Bounce () {
}
static function easeOut(t, b, c, d) {
t = t / d;
if (t < 0.363636363636364) {
return((c * ((7.5625 * t) * t)) + b);
}
if (t < 0.727272727272727) {
t = t - 0.545454545454545;
return((c * (((7.5625 * t) * t) + 0.75)) + b);
}
if (t < 0.909090909090909) {
t = t - 0.818181818181818;
return((c * (((7.5625 * t) * t) + 0.9375)) + b);
}
t = t - 0.954545454545455;
return((c * (((7.5625 * t) * t) + 0.984375)) + b);
}
static function easeIn(t, b, c, d) {
return((c - easeOut(d - t, 0, c, d)) + b);
}
static function easeInOut(t, b, c, d) {
if (t < (d / 2)) {
return((easeIn(t * 2, 0, c, d) * 0.5) + b);
}
return(((easeOut((t * 2) - d, 0, c, d) * 0.5) + (c * 0.5)) + b);
}
static var version = "1.1.0.52";
}
Symbol 97 MovieClip [__Packages.mx.transitions.easing.Regular] Frame 0
class mx.transitions.easing.Regular
{
function Regular () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return(((c * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = t / d;
return((((-c) * t) * (t - 2)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * t) * t) + b);
}
t--;
return((((-c) / 2) * ((t * (t - 2)) - 1)) + b);
}
static var version = "1.1.0.52";
}
Symbol 98 MovieClip [__Packages.mx.transitions.easing.None] Frame 0
class mx.transitions.easing.None
{
function None () {
}
static function easeNone(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeIn(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeOut(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeInOut(t, b, c, d) {
return(((c * t) / d) + b);
}
static var version = "1.1.0.52";
}
Symbol 99 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("1.5");
}
static function showPreloaderAd(options) {
var _local27 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local27);
var clip = options.clip;
var _local23 = 11000;
var _local26 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local7 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local7._x = 10;
_local7._y = _local13 - 20;
var _local22 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local24 = options.outline;
delete options.outline;
var _local5 = _local7.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local7.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local22);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local6 = _local7.createEmptyMovieClip("_outline", 3);
_local6.lineStyle(0, _local24, 100);
_local6.moveTo(0, 0);
_local6.lineTo(_local4 - 20, 0);
_local6.lineTo(_local4 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
chk.ad_msec = _local23;
chk.ad_timeout = _local26;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local12 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local10 = (100 * _local8) / _local4;
var _local11 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local2 = Math.min(100, Math.min(_local10 || 0, _local11));
_local2 = Math.max(this.last_pcnt, _local2);
this.last_pcnt = _local2;
_local9._xscale = _local2;
if (!chk.showing) {
var _local7 = _local12.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local5 > chk.ad_timeout) {
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showTimedAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function _loadCommunicator(options) {
var _local25 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = _parseOptions(options, _local25);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local18 = options.clip;
var _local20 = "_mochiad_com_" + options.id;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local18[_local20]) {
return(_local18[_local20].lc);
}
var _local21 = options.com_server + options.id;
_allowDomains(_local21);
delete options.id;
delete options.com_server;
var _local24 = options.depth;
delete options.depth;
var _local17 = _local18.createEmptyMovieClip(_local20, _local24);
var _local11 = _local17.createEmptyMovieClip("_mochiad_com", 1);
for (var _local15 in options) {
_local11[_local15] = options[_local15];
}
var _local6 = new LocalConnection();
var _local16 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local6.mc = _local17;
_local6.name = _local16;
_local6.allowDomain = function (d) {
return(true);
};
_local6.allowInsecureDomain = _local6.allowDomain;
_local6.connect(_local16);
_local17.lc = _local6;
_local11.lc = _local16;
_local6._id = 0;
_local6._queue = [];
_local6.rpcResult = function (cb) {
cb = parseInt(cb);
var _local4 = this._callbacks[cb];
if (!_local4) {
return(undefined);
}
delete this._callbacks[cb];
var _local5 = [];
var _local3 = 2;
while (_local3 < _local4.length) {
_local5.push(_local4[_local3]);
_local3++;
}
_local3 = 1;
while (_local3 < arguments.length) {
_local5.push(arguments[_local3]);
_local3++;
}
var _local6 = _local4[1];
var _local7 = _local4[0];
if (_local7 && (typeof(_local6) == "string")) {
_local6 = _local7[_local6];
}
if (_local6) {
_local6.apply(_local7, _local5);
}
};
_local6._didConnect = function (endpoint) {
this._endpoint = endpoint;
var _local4 = this._queue;
delete this._queue;
var _local5 = this.doSend;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local5.apply(this, _local3);
_local2++;
}
};
_local6.doSend = function (args, cbobj, cbfn) {
if (this._endpoint == null) {
var _local4 = [];
var _local3 = 0;
while (_local3 < arguments.length) {
_local4.push(arguments[_local3]);
_local3++;
}
this._queue.push(_local4);
return(undefined);
}
this._id = this._id + 1;
var _local5 = this._id;
if ((cbfn === undefined) || (cbfn === null)) {
cbfn = cbobj;
}
this._callbacks[_local5] = [cbobj, cbfn];
var _local7 = new LocalConnection();
var _local9 = _local7.send(this._endpoint, "rpc", _local5, args);
};
_local6._callbacks = {};
_local6._callbacks[0] = [_local6, "_didConnect"];
_local11.st = getTimer();
_local11.loadMovie(_local21 + ".swf", "POST");
return(_local6);
}
static function fetchHighScores(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["fetchHighScores", options];
_local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod);
return(true);
}
static function sendHighScore(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["sendHighScore", options];
_local1.doSend(["sendHighScore", options], callbackObj, callbackMethod);
return(true);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local7 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local7._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local7.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local7._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
if (_local7._url.indexOf("http") != 0) {
options.no_page = true;
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local9 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local9;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local9);
_local6.lc = _local5;
_local4.lc = _local9;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local4);
}
}
Instance of Symbol 51 MovieClip [LinkSymbol] "Message" in Symbol 52 MovieClip [MainMenuSymbol] Frame 1
on (release) {
if (_root.Global.SpecialLinkURL != "") {
getURL (_root.Global.SpecialLinkURL, _blank);
}
}
Symbol 89 MovieClip Frame 1
this.stop();