Frame 1
stop();
myPlay.onPress = function () {
gotoAndStop (2);
};
Frame 2
function createBalloon() {
var b = _root.createEmptyMovieClip("b" + (depth++), depth++);
b.mc = mcs[balloon[Math.floor(Math.random() * 7)]];
b.attachMovie(b.mc, "pink1", depth++);
myInfoBar.swapDepths(b);
b._x = Math.random() * 480;
b._y = 420;
if (b.mc == "emerald") {
b.num = (Math.random() * 10) + 15;
} else {
b.num = (Math.random() * 10) + 9;
}
b.onEnterFrame = function () {
b._y = b._y - b.num;
if (b._y <= -150) {
b.removeMovieClip();
}
if (gameOver == true) {
b.removeMovieClip();
}
};
b.onMouseDown = function () {
if (b.hitTest(_xmouse, _ymouse, true)) {
b.pink1.gotoAndStop(2);
var t = setInterval(function () {
b.removeMovieClip();
clearInterval(t);
}, 1000);
if (b.mc == "emerald") {
var _local3 = new Sound();
_local3.attachSound("gem_get.wav");
_local3.start();
myInfoBar.score.text = parseInt(myInfoBar.score.text) + 5;
} else if (b.mc == "eggman") {
var _local2 = new Sound();
_local2.attachSound("lose_rings.wav");
_local2.start();
myInfoBar.score.text = parseInt(myInfoBar.score.text) - 10;
} else {
var _local1 = new Sound();
_local1.attachSound("ring_get.wav");
_local1.start();
myInfoBar.score.text = parseInt(myInfoBar.score.text) + 1;
}
b.onEnterFrame = function () {
b._y = b._y - b.num;
if (b._y <= -150) {
b.removeMovieClip();
}
if (gameOver == true) {
b.removeMovieClip();
}
b._xscale = b._xscale - 5;
b._yscale = b._yscale - 5;
};
b.onMouseDown = null;
}
};
depth++;
}
function countDown() {
if (parseInt(myInfoBar.time.text) == 0) {
gameOver = true;
clearInterval(i);
gotoAndStop (3);
} else {
myInfoBar.time.text = parseInt(myInfoBar.time.text) - 1;
}
}
stop();
depth = 0;
balloon = [0, 0, 0, 0, 0, 1, 2];
mcs = ["ring", "emerald", "eggman"];
var gameOver = false;
_root.attachMovie("infobar", "myInfoBar", depth++);
myInfoBar.score.text = "0";
myInfoBar.time.text = "60";
var sound2 = new Sound();
sound2.attachSound("SONIC 60 INST.mp3");
sound2.setVolume(50);
sound2.start();
myInfoBar.myMute.onPress = function () {
if (myInfoBar.myMute._currentframe == 1) {
myInfoBar.myMute.gotoAndStop(2);
sound2.setVolume(0);
} else {
myInfoBar.myMute.gotoAndStop(1);
sound2.setVolume(100);
}
};
var i = setInterval(createBalloon, 300);
var g = setInterval(countDown, 1000);
Frame 3
stop();
clearInterval(g);
var myAgain = _root.createEmptyMovieClip("b2", depth++);
var mySubmit = _root.createEmptyMovieClip("b3", depth++);
myAgain.attachMovie("again", "again", depth++);
mySubmit.attachMovie("submit", "submit", depth++);
myAgain._x = 56.9;
myAgain._y = 290.1;
mySubmit._x = 51.9;
mySubmit._y = 237.6;
myAgain.onPress = function () {
mySubmit.removeMovieClip();
myAgain.removeMovieClip();
myInfoBar.removeMovieClip();
gotoAndPlay (2);
};
mySubmit.onPress = function () {
mySubmit.removeMovieClip();
flash.external.ExternalInterface.call("submitGameResults", "sonicringthing", parseInt(myInfoBar.score.text));
flash.external.ExternalInterface.call("addPoints", "game_complete");
};
Symbol 20 MovieClip Frame 1
stop();
Symbol 20 MovieClip Frame 2
stop();