Frame 1
function GlobalParent() {
this._state = "Loading";
this.Max_x = 480;
this.Max_y = 480;
this.Score = 0;
this._bestTime = 0;
this._theme = 1;
this._level = 1;
this.Depth_Count = 0;
this.Object_Count = 0;
this.PiCalculation = (Math.PI/180);
this._radius = 20;
this.LoadBar_Count = 0;
this.Sprite_Count = 0;
this._initTime = 0;
this._chosen1 = 0;
this._chosen2 = 0;
this._finalTime = 0;
this.BallScale = 40;
this._bestTime1 = 0;
this._bestTime2 = 0;
this._bestTime3 = 0;
this._bestTime4 = 0;
this._bestTime5 = 0;
this._bestTime6 = 0;
this._bestTime7 = 0;
this._curBackground = 1;
this.Theme_Count = 4;
this.Level_Count = 5;
this.MaxBubbles = 25;
this.Game_ID = 6;
this.BasePath = "http://games.smallzworld.com/";
this.InitLoadTime = 0;
this.SpecialLinkURL = "";
this.SpecialMessage = "";
this._username = "Default";
this._submitState = false;
}
function SpriteParent(id, instanceName) {
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._text = "#";
this._instance = instanceName;
this._scalestep = 0;
this._rotatestep = 0;
this._ballType = 0;
}
function Preloader_Status() {
myLoaded = Math.round(getBytesLoaded());
myTotal = Math.round(getBytesTotal());
myPercent = myLoaded / myTotal;
return(myPercent * 100);
}
function Create_MovieClip(ObjectName, Instance, NewLevel) {
if (isNaN(Global[Instance + "_Count"])) {
Global[Instance + "_Count"] = 0;
}
Global[Instance + "_Count"]++;
Index = Global[Instance + "_Count"];
InstanceName = (Instance + "_") + Index;
InstanceInfoName = (Instance + "Info_") + Index;
SymbolName = ObjectName + "Symbol";
_root[InstanceInfoName] = new SpriteParent(Index, InstanceName);
_root.attachMovie(SymbolName, InstanceName, NewLevel);
_root[InstanceName].cacheAsBitmap;
MC_hide(InstanceName);
return(Index);
}
function create_instance(ObjectName, amount, Instance, TargetLevel) {
c_instance = 1;
while (c_instance <= amount) {
New_Index = Create_MovieClip(ObjectName, Instance, (TargetLevel + c_instance) - 1);
c_instance++;
}
}
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 display_prompt(PromptText, loc_x, loc_y) {
Prompt.PromptText.text = PromptText;
MC_pos("Prompt", loc_x, loc_y);
MC_show("Prompt");
}
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 Process_Control_Input(KeyCode) {
var _local2;
switch (Global._state) {
case "Loading" :
break;
case "MainMenu" :
levelbox_click();
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";
}
break;
case "Core" :
check_click();
break;
case "LevelOver" :
if (LevelOver_1.Back.hitTest(_root._xmouse, _root._ymouse)) {
MC_tween(LevelOver_1, "_xscale", "Regular", 100, 0, 0.75);
MC_tween(LevelOver_1, "_yscale", "Regular", 100, 0, 0.75);
Global._state = "MainMenu";
}
if ((LevelOver_1.Submit.hitTest(_root._xmouse, _root._ymouse) && (Global._submitState == false)) && (KeyCode == 0)) {
Global._submitState = true;
Global._username = _root.LevelOver_1.UserName.text;
MC_hide(LevelOver_1.Submit);
MC_hide(LevelOver_1.UserName);
MC_hide(LevelOver_1.Label);
trace("Time Socre : " + Global._finalTime);
_local2 = ((Global._level - 1) * 4) + Global._theme;
SaveHighScore(Global.Game_ID, 0, Global._username, _local2, Global._finalTime * 100, Global._finalTime, "Test Comment");
}
if (LevelOver_1.HighScores.hitTest(_root._xmouse, _root._ymouse)) {
MC_tween(LevelOver_1, "_xscale", "Regular", 100, 0, 0.75);
MC_tween(LevelOver_1, "_yscale", "Regular", 100, 0, 0.75);
LoadLevel = ((Global._level - 1) * 4) + Global._theme;
LoadHighScores(Global.Game_ID, LoadLevel);
}
break;
case "LevelStart" :
if (LevelStart_1.Continue.hitTest(_root._xmouse, _root._ymouse)) {
MC_tween(LevelStart_1, "_xscale", "Regular", 100, 0, 0.75);
MC_tween(LevelStart_1, "_yscale", "Regular", 100, 0, 0.75);
level_setup(Global._level);
Global._state = "Core";
}
if (LevelStart_1.Back.hitTest(_root._xmouse, _root._ymouse)) {
MC_tween(LevelStart_1, "_xscale", "Regular", 100, 0, 0.75);
MC_tween(LevelStart_1, "_yscale", "Regular", 100, 0, 0.75);
Global._state = "MainMenu";
}
if (LevelStart_1.HighScores.hitTest(_root._xmouse, _root._ymouse)) {
MC_tween(LevelStart_1, "_xscale", "Regular", 100, 0, 0.75);
MC_tween(LevelStart_1, "_yscale", "Regular", 100, 0, 0.75);
trace("Global._level : " + Global._level);
LoadLevel = ((Global._level - 1) * 4) + Global._theme;
LoadHighScores(Global.Game_ID, LoadLevel);
}
break;
case "HighScores" :
MC_tween(HighScores_1, "_xscale", "Regular", 100, 0, 0.75);
MC_tween(HighScores_1, "_yscale", "Regular", 100, 0, 0.75);
Global._state = "LevelStart";
break;
case "Instructions" :
if (Instructions_1.Back.hitTest(_root._xmouse, _root._ymouse)) {
MC_tween(Instructions_1, "_xscale", "Regular", 100, 0, 0.75);
MC_tween(Instructions_1, "_yscale", "Regular", 100, 0, 0.75);
Global._state = "MainMenu";
}
break;
case "ResetGame" :
}
}
function check_click() {
cb = 1;
while (cb <= Global.Ball_Count) {
with (_root["BallInfo_" + cb]) {
if (_root["Ball_" + cb].hitTest(_root._xmouse, _root._ymouse) && (_state == "Active")) {
if (Global._chosen1 == 0) {
if (cb <= 26) {
Global._chosen1 = cb;
_state = "Chosen";
SFX_Pop.start();
return;
}
} else if (cb > 26) {
Global._chosen2 = cb;
_state = "Chosen";
SFX_Pop.start();
return;
}
}
}
cb++;
}
}
function main_loop() {
switch (Global._state) {
case "MainMenu" :
update_background();
check_mainmenu_rollovers();
levelbox_rollovers();
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);
MainMenu_1.Message.MessageText.text = Global.SpecialMessage;
update_level_boxes();
}
return;
case "LevelStart" :
update_background();
check_levelstart_rollovers();
if ((LevelStart_1._visible == 0) || (LevelStart_1._xscale == 0)) {
set_level_data(Global._level);
set_theme_data(Global._theme);
MC_tween(LevelStart_1, "_xscale", "Regular", 5, 100, 0.75);
MC_tween(LevelStart_1, "_yscale", "Regular", 5, 100, 0.75);
MC_show(LevelStart_1);
LevelStart_1.ThemeText.text = _root["Theme_" + Global._theme];
LevelStart_1.LevelText.text = _root["Difficulty_" + Global._level];
LevelStart_1.TargetTime.text = "Beat this time to clear level\r" + timeString(LevelData._targetTime);
LevelStart_1.PromptText.text = _root["LevelPromptText_" + Global._theme];
}
return;
case "Core" :
update_background();
elapsedTime = update_timer(Global._initTime);
newTime = timeString(elapsedTime);
TargetTimer_1.TimerText.text = timeString(LevelData._targetTime);
Timer_1.TimerText.text = newTime;
update_balls();
if ((Global._chosen1 > 0) && (Global._chosen2 > 0)) {
if (Letter[Global._chosen1 - 1] == Letter[Global._chosen2 - 27]) {
with (_root["BallInfo_" + Global._chosen1]) {
_state = "Solved";
}
with (_root["BallInfo_" + Global._chosen2]) {
_state = "Solved";
}
Global._chosen1 = 0;
Global._chosen2 = 0;
} else {
with (_root["BallInfo_" + Global._chosen1]) {
_state = "Active";
}
with (_root["BallInfo_" + Global._chosen2]) {
_state = "Active";
}
Global._chosen1 = 0;
Global._chosen2 = 0;
}
}
if (available_letters() == 0) {
Global._state = "LevelOver";
}
return;
case "LevelOver" :
update_background();
check_levelover_rollovers();
if ((LevelOver_1._visible == 0) || (LevelOver_1._xscale == 0)) {
Global._finalTime = (getTimer() - Global._initTime) / 1000;
Global._finalTime = int(Global._finalTime * 100) / 100;
if ((Global._finalTime < BestTimes[Global._theme][Global._level]) || (BestTimes[Global._theme][Global._level] == 0)) {
BestTimes[Global._theme][Global._level] = Global._finalTime;
}
if (Global._finalTime <= LevelData._targetTime) {
Levels[Global._theme][Global._level] = true;
}
trace("Time after game : " + Global._finalTime);
newFinalTime = timeString(Global._finalTime);
trace((("Time after game : " + Global._finalTime) + " --->") + newFinalTime);
newBestTime = timeString(BestTimes[Global._theme][Global._level]);
hide_balls();
MC_hide("Timer_1");
MC_hide("TargetTimer_1");
LevelOver_1.ThemeText.text = _root["Theme_" + Global._theme];
LevelOver_1.LevelText.text = _root["Difficulty_" + Global._level];
LevelOver_1.YourTime.text = "Your Time\r" + newFinalTime;
LevelOver_1.BestTime.text = "Best Time\r" + newBestTime;
LevelOver_1.FeedbackText.text = FeedbackString(Global._finalTime);
MC_tween(LevelOver_1, "_xscale", "Regular", 5, 100, 0.75);
MC_tween(LevelOver_1, "_yscale", "Regular", 5, 100, 0.75);
MC_show(LevelOver_1);
Global._submitState = false;
LevelOver_1.UserName.text = Global._username;
MC_show(LevelOver_1.Submit);
MC_show(LevelOver_1.UserName);
MC_show(LevelOver_1.Label);
}
return;
case "Instructions" :
update_background();
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);
}
check_Instructions_rollovers();
return;
case "LoadingData" :
if (LoadingData_1._visible == 0) {
trace("set timer");
Global.InitLoadTime = getTimer();
MC_show(LoadingData_1);
trace(Global.InitLoadTime);
}
elapsedTime = update_timer(Global.InitLoadTime);
if (elapsedTime > 45) {
trace("This should not happen ");
trace(elapsedTime);
trace(Global.InitLoadTime);
MC_hide(LoadingData_1);
Global._state = "MainMenu";
}
return;
case "SavingData" :
if (SavingData_1._visible == 0) {
trace("Show saving");
MC_show(SavingData_1);
}
return;
case "LevelChange" :
return;
case "ResetGame" :
reset_game();
Global._state = "Core";
return;
case "HighScores" :
update_background();
check_highscores_rollovers();
if (!((HighScores_1._visible == 0) || (HighScores_1._xscale == 0))) {
break;
}
MC_show(HighScores_1);
MC_tween(HighScores_1, "_xscale", "Regular", 5, 100, 0.75);
MC_tween(HighScores_1, "_yscale", "Regular", 5, 100, 0.75);
index = 1;
while (index <= 10) {
MC_hide(HighScores_1["Listing_" + index]);
index++;
}
output_high_scores("Time");
}
}
function FeedbackString(TimeElapsed) {
if (TimeElapsed >= LevelData._targetTime) {
Feedback = "That kind of time just isn't going to cut it, you can do far better on this level";
} else {
Feedback = "That time was great for this level, but many have done far better. You still have room for improvement";
}
if (TimeElapsed < (LevelData._targetTime - 20)) {
Feedback = "That was an exceptional time, but I doubt you can beat it again.";
}
if (TimeElapsed > (LevelData._targetTime + 40)) {
Feedback = "I thought you were never going to finish. Did you ride a short bus to school by any chance ?";
}
return(Feedback);
}
function available_letters() {
letter_count = 0;
b = 1;
while (b <= Global.Ball_Count) {
if (_root["BallInfo_" + b]._state == "Active") {
letter_count++;
}
b++;
}
return(letter_count);
}
function next_letter() {
if (available_letters > 0) {
GoodLetter = false;
while (GoodLetter == false) {
new_letter = random(26) + 1;
if (_root["BallInfo_" + new_ball]._state == "Active") {
GoodLetter = true;
break;
}
}
} else {
new_letter = -1;
}
return(new_letter);
}
function reset_game() {
set_level_data(Global._level);
init_balls();
show_balls();
MC_show("Timer_1");
update_balls();
Global._initTime = getTimer();
Global._chosen1 = 0;
Global._chosen2 = 0;
}
function init_balls() {
cb = 1;
while (cb <= Global.Ball_Count) {
with (_root["BallInfo_" + cb]) {
if ((cb <= LevelData._balls) || (((cb - 26) <= LevelData._balls) && (cb > 26))) {
_state = "Active";
} else {
_state = "Inactive";
}
_xpos = -50;
_ypos = -50;
}
cb++;
}
cb = 1;
while (cb <= Global.Ball_Count) {
with (_root["BallInfo_" + cb]) {
if (_state == "Active") {
GoodLocation = false;
while (GoodLocation == false) {
_xpos = random(Global.Max_x - 50) + 25;
_ypos = random(Global.Max_y - 100) + 25;
GoodLocation = check_distance(cb, _xpos, _ypos);
}
_rotation = 0;
_scale = 40;
_rotatestep = 0;
_scalestep = 0;
if (cb <= 26) {
_text = Letter[cb - 1];
} else {
_text = cb - 26;
}
switch (Global._theme) {
case 1 :
break;
case 2 :
_rotation = random(360) + 1;
_rotatestep = random(10) - 5;
if (_rotatestep == 0) {
_rotatestep = random(5) + 1;
}
break;
case 3 :
_scale = random(20) + 20;
_scalestep = random(2) + 1;
break;
case 4 :
_rotation = random(360) + 1;
_rotatestep = random(10) - 5;
if (_rotatestep == 0) {
_rotatestep = random(5) + 1;
}
_scale = random(20) + 20;
_scalestep = random(2) + 1;
}
if (ThemeData._ballType == -1) {
_ballType = int(random(7) + 1);
} else {
_ballType = ThemeData._ballType;
}
}
MC_show("Ball_" + cb);
}
cb++;
}
}
function check_distance(ball_id, loc_x, loc_y) {
b = 1;
while (b <= Global.Ball_Count) {
with (_root["BallInfo_" + b]) {
if ((_state == "Active") && (b != ball_id)) {
xdiff = Math.abs(_xpos - loc_x);
ydiff = Math.abs(_ypos - loc_y);
if ((xdiff < Global.BallScale) && (ydiff < Global.BallScale)) {
return(false);
}
}
}
b++;
}
return(true);
}
function hide_balls() {
b = 1;
while (b <= Global.Ball_Count) {
MC_hide("Ball_" + b);
b++;
}
}
function show_balls() {
b = 1;
while (b <= Global.Ball_Count) {
MC_show("Ball_" + b);
b++;
}
}
function update_balls() {
b = 1;
while (b <= Global.Ball_Count) {
with (_root["BallInfo_" + b]) {
MC_pos(_root["Ball_" + b], _xpos, _ypos);
MC_scale(_root["Ball_" + b], _scale);
_root["Ball_" + b].Sphere.gotoAndStop(_ballType);
_root["Ball_" + b].BallText.text = _text;
if ((_text == 6) || (_text == 9)) {
_root["Ball_" + b].Underline._visible = 1;
} else {
_root["Ball_" + b].Underline._visible = 0;
}
if ((_state == "Chosen") || (_state == "Solved")) {
_root["Ball_" + b].Sphere._alpha = 80;
if (ThemeData._ballType == -1) {
_root["Ball_" + b].Sphere.gotoAndStop(9);
}
} else {
_root["Ball_" + b].Sphere._alpha = 30;
}
switch (Global._theme) {
case 1 :
MC_scale(_instance, _scale);
MC_rotate(_instance, _rotation);
break;
case 2 :
_rotation = _rotation + _rotatestep;
MC_scale(_instance, _scale);
MC_rotate(_instance, _rotation);
break;
case 3 :
_scale = _scale + _scalestep;
if ((_scale < 20) || (_scale > Global.BallScale)) {
_scalestep = -_scalestep;
}
MC_scale(_instance, _scale);
MC_rotate(_instance, _rotation);
break;
case 4 :
_scale = _scale + _scalestep;
if ((_scale < 20) || (_scale > Global.BallScale)) {
_scalestep = -_scalestep;
}
_rotation = _rotation + _rotatestep;
MC_scale(_instance, _scale);
MC_rotate(_instance, _rotation);
}
}
b++;
}
}
function display_tip_window(TextString, Timer) {
TipWindow._visible = 1;
TipWindow.TipText.text = TextString;
Global.TipTimer = Timer;
}
function create_ui() {
create_instance("MainMenu", 1, "MainMenu", 700);
MC_pos("MainMenu_1", 0, 0);
create_instance("Instructions", 1, "Instructions", 701);
MC_pos("Instructions_1", 0, 0);
create_instance("GameOver", 1, "GameOver", 702);
MC_pos("GameOver_1", 0, 0);
create_instance("LevelOver", 1, "LevelOver", 703);
MC_pos("LevelOver_1", 0, 0);
create_instance("LevelStart", 1, "LevelStart", 704);
MC_pos("LevelStart_1", 0, 0);
create_instance("LoadingData", 1, "LoadingData", 900);
MC_pos(LoadingData_1, 0, 0);
create_instance("SavingData", 1, "SavingData", 950);
MC_pos(SavingData_1, 0, 0);
create_instance("HighScores", 1, "HighScores", 1000);
MC_pos(HighScores_1, 0, 0);
create_instance("Ball", 52, "Ball", 500);
create_instance("Timer", 1, "Timer", 600);
create_instance("TargetTimer", 1, "TargetTimer", 601);
MC_pos("Timer_1", 10, 450);
MC_pos("TargetTimer_1", 480 - (TargetTimer_1._width + 10), 450);
}
function check_mainmenu_rollovers() {
if (MainMenu_1.StartGame.hitTest(_root._xmouse, _root._ymouse)) {
MC_scale(MainMenu_1.StartGame, 150);
} else {
MC_scale(MainMenu_1.StartGame, 100);
}
if (MainMenu_1.Instructions.hitTest(_root._xmouse, _root._ymouse)) {
MC_scale(MainMenu_1.Instructions, 150);
} else {
MC_scale(MainMenu_1.Instructions, 100);
}
}
function check_Instructions_rollovers() {
if (Instructions_1.Back.hitTest(_root._xmouse, _root._ymouse)) {
MC_scale(Instructions_1.Back, 150);
} else {
MC_scale(Instructions_1.Back, 100);
}
}
function check_levelover_rollovers() {
if (LevelOver_1.Back.hitTest(_root._xmouse, _root._ymouse)) {
MC_scale(LevelOver_1.Back, 150);
} else {
MC_scale(LevelOver_1.Back, 100);
}
if (LevelOver_1.Submit.hitTest(_root._xmouse, _root._ymouse)) {
MC_scale(LevelOver_1.Submit, 150);
} else {
MC_scale(LevelOver_1.Submit, 100);
}
if (LevelOver_1.HighScores.hitTest(_root._xmouse, _root._ymouse)) {
MC_scale(LevelOver_1.HighScores, 150);
} else {
MC_scale(LevelOver_1.HighScores, 100);
}
}
function check_levelstart_rollovers() {
if (LevelStart_1.Continue.hitTest(_root._xmouse, _root._ymouse)) {
MC_scale(LevelStart_1.Continue, 150);
} else {
MC_scale(LevelStart_1.Continue, 100);
}
if (LevelStart_1.Back.hitTest(_root._xmouse, _root._ymouse)) {
MC_scale(LevelStart_1.Back, 150);
} else {
MC_scale(LevelStart_1.Back, 100);
}
if (LevelStart_1.HighScores.hitTest(_root._xmouse, _root._ymouse)) {
MC_scale(LevelStart_1.HighScores, 150);
} else {
MC_scale(LevelStart_1.HighScores, 100);
}
}
function check_gameover_rollovers() {
if (GameOver_1.Back.hitTest(_root._xmouse, _root._ymouse)) {
MC_scale(GameOver_1.Back, 150);
} else {
MC_scale(GameOver_1.Back, 100);
}
}
function rotate_background() {
Background_1._rotation = Background_1._rotation + 0.05;
}
function scale_background() {
BackgroundInfo_1._scale = BackgroundInfo_1._scale + BackgroundInfo_1._scalestep;
if ((BackgroundInfo_1._scale > 150) || (BackgroundInfo_1._scale < 100)) {
BackgroundInfo_1._scalestep = -BackgroundInfo_1._scalestep;
}
MC_scale(Background_1, BackgroundInfo_1._scale);
}
function update_pulse(pulseSpeed) {
Pulse_1._xscale = Pulse_1._xscale + pulseSpeed;
Pulse_1._yscale = Pulse_1._yscale + pulseSpeed;
if ((Pulse_1._xscale > 150) || (Pulse_1._xscale < 50)) {
ThemeData._pulseSpeed = -ThemeData._pulseSpeed;
}
}
function change_background(NewIndex) {
Background_1.gotoAndStop(NewIndex);
}
function update_background() {
with (ThemeData) {
if (_pulse) {
update_pulse(_pulseSpeed);
}
if (_rotate) {
rotate_background();
}
if (_scale) {
scale_background();
}
if (_bubbles) {
update_bubbles();
}
}
}
function LevelDataParent() {
this._balls = 0;
this._targetTime = 0;
}
function update_level_boxes() {
t = 1;
while (t <= Global.Theme_Count) {
l = 1;
while (l <= Global.Level_Count) {
BoxIndex = ((t - 1) * Global.Level_Count) + l;
MainMenu_1.Levels["LevelBox_" + BoxIndex].BoxText.text = (((_root["Theme_" + t] + "\r") + _root["Difficulty_" + l]) + "\r") + timeString(BestTimes[t][l]);
if (Levels[t][l] == true) {
MC_show(MainMenu_1.Levels["LevelBox_" + BoxIndex].Star);
} else {
MC_hide(MainMenu_1.Levels["LevelBox_" + BoxIndex].Star);
}
l++;
}
t++;
}
}
function levelbox_rollovers() {
t = 1;
while (t <= (Global.Theme_Count * Global.Level_Count)) {
MainMenu_1.Levels["LevelBox_" + t].Star._rotation = MainMenu_1.Levels["LevelBox_" + t].Star._rotation + 5;
if (MainMenu_1.Levels["LevelBox_" + t].hitTest(_root._xmouse, _root._ymouse)) {
MC_alpha(MainMenu_1.Levels["LevelBox_" + t].Box, 70);
} else {
MC_alpha(MainMenu_1.Levels["LevelBox_" + t].Box, 35);
}
t++;
}
}
function levelbox_click() {
t = 1;
while (t <= (Global.Theme_Count * Global.Level_Count)) {
if (MainMenu_1.Levels["LevelBox_" + t].hitTest(_root._xmouse, _root._ymouse)) {
Global._theme = Math.floor(((t - 1) / Global.Level_Count) + 1);
Global._level = t - ((Global._theme - 1) * Global.Level_Count);
trace(Global._level);
MC_hide(MainMenu_1);
Global._state = "LevelStart";
}
t++;
}
}
function level_setup(NewLevel) {
init_balls();
show_balls();
MC_show("Timer_1");
MC_show("TargetTimer_1");
Global._initTime = getTimer();
Global._chosen1 = 0;
Global._chosen2 = 0;
change_background(ThemeData._background);
}
function set_level_data(NewLevel) {
with (LevelData) {
switch (NewLevel) {
case 1 :
_balls = 5;
break;
case 2 :
_balls = 10;
break;
case 3 :
_balls = 15;
break;
case 4 :
_balls = 20;
break;
case 5 :
_balls = 26;
}
LevelData._targetTime = _balls * 4;
}
}
function init_bubbles() {
b = 1;
while (b <= Global.MaxBubbles) {
_root.attachMovie("BubbleSymbol", "Bubble_" + b, 1000 + b);
_root["Bubble_" + b]._x = random(Global.Max_x);
_root["Bubble_" + b]._y = random(Global.Max_y);
_root["Bubble_" + b]._alpha = 40;
bubbleSize = random(40) + 15;
_root["Bubble_" + b]._xscale = bubbleSize;
_root["Bubble_" + b]._yscale = bubbleSize;
b++;
}
}
function kill_bubbles() {
b = 1;
while (b <= Global.MaxBubbles) {
_root["Bubble_" + b].removeMovieClip();
b++;
}
}
function update_bubbles() {
b = 1;
while (b <= Global.MaxBubbles) {
_root["Bubble_" + b]._x = _root["Bubble_" + b]._x + (random(6) - 2.5);
_root["Bubble_" + b]._y = _root["Bubble_" + b]._y - 2;
if (_root["Bubble_" + b]._y < -5) {
_root["Bubble_" + b]._y = Global.Max_y + 10;
}
b++;
}
}
function update_timer(timer_init) {
elapsedTime = (getTimer() - timer_init) / 1000;
elapsedTime = int(elapsedTime * 100) / 100;
return(elapsedTime);
}
function timeString(TimerValue) {
minutes = int(TimerValue / 60);
seconds = int(TimerValue - (minutes * 60));
sub = int((minutes * 60) + seconds);
test2 = TimerValue - test;
extra = int((((TimerValue * 100) - (sub * 100)) / 100) * 100);
if (seconds < 10) {
seconds = "0" + seconds;
}
if (extra < 10) {
extra = "0" + extra;
}
TimeValueString = (((minutes + ":") + seconds) + ".") + extra;
return(TimeValueString);
}
function ThemeDataParent() {
this._background = 0;
this._ballType = 0;
this._rotate = false;
this._alpha = 0;
this._pulse = false;
this._scale = false;
this._bubbles = false;
this._pulseSpeed = 2;
}
function set_theme_data(NewTheme) {
kill_bubbles();
with (ThemeData) {
switch (NewTheme) {
case 1 :
_background = 1;
_ballType = 7;
_rotate = true;
_alpha = 35;
_pulse = true;
_scale = false;
_bubbles = false;
break;
case 2 :
_background = 2;
_ballType = 2;
_rotate = false;
_alpha = 100;
_pulse = false;
_scale = false;
_bubbles = true;
break;
case 3 :
_background = 4;
_ballType = 3;
_rotate = false;
_alpha = 100;
_pulse = false;
_scale = false;
_bubbles = false;
break;
case 4 :
_background = 3;
_ballType = -1;
_rotate = true;
_alpha = 100;
_pulse = false;
_scale = true;
_bubbles = false;
}
change_background(_background);
MC_rotate(Background_1, 0);
MC_scale(Background_1, 100);
MC_alpha(Background_1, _alpha);
if (_pulse) {
MC_show(Pulse_1);
} else {
MC_hide(Pulse_1);
}
if (_bubbles) {
init_bubbles();
}
}
}
function LoadSomeText(game_id) {
Global._phpRoutine = "LoadSomeText";
PHPSendData.Routine = "LoadSomeText";
PHPSendData.Game_ID = game_id;
PHPSendData.sendAndLoad(Global.BasePath + "RecordManagement.php", PHPLoadData, "GET");
Global._state = "LoadingData";
Global.InitLoadTime = getTimer();
}
function LoadHighScores(game_id, level_id) {
clear_high_scores();
Global._phpRoutine = "LoadHighScores";
PHPSendData.Routine = "LoadHighScores";
PHPSendData.Game_ID = game_id;
PHPSendData.Level_ID = level_id;
trace(((" Outbound Data : " + game_id) + " : ") + level_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 = "LevelOver";
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 output_high_scores(ScoreType) {
var _local1;
_local1 = 1;
while (_local1 <= 10) {
if (PHPLoadData["Score_" + _local1]) {
HighScores_1["Listing_" + _local1].Rank.text = _local1;
switch (ScoreType) {
case "Score" :
HighScores_1["Listing_" + _local1].Score.text = PHPLoadData["Score_" + _local1];
break;
case "Time" :
HighScores_1["Listing_" + _local1].Score.text = timeString(PHPLoadData["Score_" + _local1] / 100);
}
HighScores_1["Listing_" + _local1].User.text = PHPLoadData["User_" + _local1];
MC_show(HighScores_1["Listing_" + _local1]);
}
_local1++;
}
}
function clear_high_scores() {
var _local1;
_local1 = 1;
while (_local1 <= 10) {
PHPLoadData["Score_" + _local1] = undefined;
_local1++;
}
}
Global = new GlobalParent();
LevelData = new LevelDataParent();
ThemeData = new ThemeDataParent();
var blur = (new flash.filters.BlurFilter(10, 10, 3));
var drop = (new flash.filters.DropShadowFilter(40, 45, 0, 0.3, 10, 10, 2, Quality.HIGH));
var glow = (new flash.filters.GlowFilter(16777215, 0.5, 5, 5, 2, 3));
var Letter = new Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z");
Feedback_1 = "You can do much better than this, keep practicing.";
Feedback_2 = "You did ok, but with a little more practice you can do better.";
Feedback_3 = "You did pretty good, but there is still room for improvement.";
Feedback_4 = "You did great. If you can beat this time, you really have something to be proud of.";
Feedback_5 = "Excellent, you are a master of the alphabet and numbers.";
Theme_1 = "The Basics";
Theme_2 = "Dizzy";
Theme_3 = "Pulse";
Theme_4 = "The Works";
Difficulty_1 = "Simple";
Difficulty_2 = "Easy";
Difficulty_3 = "Normal";
Difficulty_4 = "Hard";
Difficulty_5 = "Master";
LevelPromptText_1 = "Lets just start off with the basics. Pretty simple stuff here, you should have no problem.";
LevelPromptText_2 = "Lets see how you do when the letters and numbers are trying to make you dizzy";
LevelPromptText_3 = "Do you think you can handle letters and numbers that have a pulse?";
LevelPromptText_4 = "If you can finish this theme on the Master level, you will have mastered this game.";
var Levels = new Array();
var BestTimes = new Array();
xx = 1;
while (xx <= 4) {
Levels[xx] = new Array(false, false, false, false, false, false);
BestTimes[xx] = new Array(0, 0, 0, 0, 0, 0);
xx++;
}
create_instance("Load", 1, "LoadBar", 100);
MC_show(LoadBar_1);
MC_pos(LoadBar_1, 0, 0);
userKey = new Object();
Key.addListener(userKey);
userKey.onKeyDown = function () {
KeyCode = Number(Key.getCode());
Process_Control_Input(KeyCode);
};
mouseObj = new Object();
Mouse.addListener(mouseObj);
mouseObj.onMouseDown = function () {
Process_Control_Input(0);
};
create_instance("Background", 1, "Background", 50);
MC_pos(Background_1, 240, 240);
MC_show(Background_1);
MC_alpha(Background_1, 35);
BackgroundInfo_1._scalestep = 0.25;
create_instance("Pulse", 1, "Pulse", 49);
MC_pos(Pulse_1, 240, 240);
MC_show(Pulse_1);
MC_alpha(Pulse_1, 35);
change_background(1);
var PHPSendData = new LoadVars();
var PHPLoadData = new LoadVars();
PHPLoadData.onLoad = function (success) {
if (success) {
process_php_data(Global._phpRoutine);
}
};
Frame 2
MochiAd.showPreloaderAd({id:"a4d26753baa8bc3d", res:"480x480"});
Frame 3
LoadBar_1.LoadText.text = ("Loading : " + int(Preloader_Status())) + "%";
if (Preloader_Status() < 100) {
gotoAndPlay (2);
}
Frame 5
MC_hide(LoadBar_1);
SFX_Music = new Sound();
SFX_Music.attachSound("DropsOfLife");
SFX_Music.start();
SFX_Pop = new Sound();
SFX_Pop.attachSound("Pop");
SFX_Music.onSoundComplete = function () {
SFX_Music.start();
};
create_ui();
Global._state = "Instructions";
set_level_data(Global._level);
set_theme_data(Global._theme);
Frame 6
main_loop();
Frame 7
gotoAndPlay (6);
Symbol 115 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 116 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 117 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 118 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 119 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 120 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 121 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 122 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 123 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 124 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function showPreloaderAd(options) {
var _local29 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812};
options = _parseOptions(options, _local29);
var _local15 = options.clip;
var _local25 = 11000;
var _local28 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
return(undefined);
}
_local15.stop();
var mc = _local15._mochiad;
mc.onUnload = function () {
this._parent.play();
};
var _local16 = _getRes(options);
var _local5 = _local16[0];
var _local14 = _local16[1];
mc._x = _local5 * 0.5;
mc._y = _local14 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local5 * -0.5;
chk._y = _local14 * -0.5;
var _local8 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local8._x = 10;
_local8._y = _local14 - 20;
var _local24 = options.color;
delete options.color;
var _local21 = options.background;
delete options.background;
var _local26 = options.outline;
delete options.outline;
var _local6 = _local8.createEmptyMovieClip("_outline", 1);
_local6.beginFill(_local21);
_local6.moveTo(0, 0);
_local6.lineTo(_local5 - 20, 0);
_local6.lineTo(_local5 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
_local6.endFill();
var _local4 = _local8.createEmptyMovieClip("_inside", 2);
_local4.beginFill(_local24);
_local4.moveTo(0, 0);
_local4.lineTo(_local5 - 20, 0);
_local4.lineTo(_local5 - 20, 10);
_local4.lineTo(0, 10);
_local4.lineTo(0, 0);
_local4.endFill();
_local4._xscale = 0;
var _local7 = _local8.createEmptyMovieClip("_outline", 3);
_local7.lineStyle(0, _local26, 100);
_local7.moveTo(0, 0);
_local7.lineTo(_local5 - 20, 0);
_local7.lineTo(_local5 - 20, 10);
_local7.lineTo(0, 10);
_local7.lineTo(0, 0);
chk.ad_msec = _local25;
chk.ad_timeout = _local28;
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.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 _local15 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd"};
options = _parseOptions(options, _local15);
var _local6 = options.clip;
var _local12 = 11000;
var _local14 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
return(undefined);
}
_local6.stop();
var mc = _local6._mochiad;
mc.onUnload = function () {
this._parent.play();
};
var _local7 = _getRes(options);
var _local16 = _local7[0];
var _local13 = _local7[1];
mc._x = _local16 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local12;
chk.ad_timeout = _local14;
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 = "1.4";
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 = "1.4";
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);
}
}
Symbol 55 MovieClip [SoundEffects] Frame 1
stop();
Instance of Symbol 44 MovieClip [LinkSymbol] "Message" in Symbol 67 MovieClip [MainMenuSymbol] Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse)) {
this._xscale = 115;
this._yscale = 115;
} else {
this._xscale = 100;
this._yscale = 100;
}
}
on (release) {
if (_root.Global.SpecialLinkURL != "") {
getURL (_root.Global.SpecialLinkURL, _blank);
}
}