Frame 1
stop();
Frame 9
audience.cheer(15);
Frame 20
function fruitHits(myNum, note) {
keyboard.playNote(note);
}
n = 2;
wrongSnd = new sound(wrongMC);
wrongSnd.attachSound("wrong.mp3");
keyboard_PROTO.duplicateMovieClip("keyboard", 50);
keyboard_PROTO._visible = 0;
wood_PROTO.duplicateMovieClip("wood", 49);
wood_PROTO._visible = 0;
audience_PROTO.duplicateMovieClip("audience", 48);
audience_PROTO._visible = 0;
i = 1;
while (i <= 10) {
newname = "f" + i;
f0.duplicateMovieClip(newname, 100 + i);
i++;
}
f0._visible = 0;
makeRandomList = function (n) {
var a = new array();
var c = new array();
i = 1;
while (i <= n) {
a.unshift(i);
i++;
}
i = 1;
while (i <= n) {
pos = random(a.length);
b = a.splice(pos, 1);
c.unshift(Number(b.toString()));
i++;
}
return(c);
};
isBlackNote = function (note) {
return(((((note == 2) || (note == 4)) || (note == 7)) || (note == 9)) || (note == 11));
};
Frame 23
i = 1;
while (i <= 10) {
f = eval ("f" + i);
f.myNum = i;
f._x = f0._x + (i * 50);
f.loadSnd(i);
f.saveDefault();
f.reset();
i++;
}
Frame 25
onEnterFrame = 0;
count = 1;
song = keyboard.getTune(n);
removeOrder = makeRandomList(n);
trace(removeOrder);
i = 1;
while (i <= 10) {
f = eval ("f" + i);
f.reset();
whichFruit = random(10) + 1;
f.showFruitAndNumber(whichFruit, i);
i++;
}
i = 0;
while (i < n) {
note = song[i];
mX = eval ("m" + note)._x;
mY = eval ("m" + note)._y;
f = eval ("f" + removeOrder[i]);
f._x = mX;
f._y = f0._y;
f.maxY = mY;
f.myButton._visible = 0;
if (isBlackNote(note)) {
f.downAdj = 20;
f.swapDepths(100 + i);
} else {
f.downAdj = 50;
f.swapDepths(110 + i);
}
f.note = note;
f.state = "waiting";
f._rotation = 20 - random(40);
f.yv = 50;
i++;
}
Frame 29
f = eval ("f" + count);
f.playSnd();
f.state = "falling";
Frame 39
count++;
if (count <= n) {
gotoAndPlay (29);
} else {
count = 0;
}
Frame 53
wrong = 0;
saySound = function () {
currentFruit.playSnd();
};
click = function (who) {
if (who == thisFruit) {
currentFruit.leave();
play();
} else {
wrong++;
audience.sigh(wrong);
wrongSnd.start();
wrongSnd.onSoundComplete = saySound;
}
};
Frame 54
thisFruit = removeOrder[count];
currentFruit = eval ("f" + thisFruit);
currentFruit.playSnd();
i = 1;
while (i <= n) {
f = eval ("f" + i);
f.myButton._visible = 1;
i++;
}
stop();
Frame 55
i = 1;
while (i <= n) {
f = eval ("f" + i);
f.myButton._visible = 0;
i++;
}
Frame 62
count++;
if (count < n) {
gotoAndPlay (54);
} else {
count = 0;
}
Frame 67
keyboard.playNote(song[count]);
Frame 70
count++;
if (count < n) {
gotoAndPlay (67);
} else {
count = 0;
audience.cheer(n * 2);
}
Frame 81
n++;
if (n == 11) {
gotoAndPlay (84);
} else {
gotoAndPlay (25);
}
Frame 84
g = 0;
keyboard.getTune(random(10) + 1);
Frame 88
if (keyboard.playNextNote() == 0) {
keyboard.getTune(random(10) + 1);
}
audience.cheer(5);
g++;
g0.duplicateMovieClip("g" + g, 100 + g);
gg = eval ("g" + g);
gg.gotoandstop(random(10) + 1);
gg._x = random(700);
gg.yv = random(100) / 30;
gg.rv = random(30) - 15;
gg.onEnterFrame = function () {
this._rotation = this._rotation + this.rv;
this.yv = this.yv + 1;
this._y = this._y + this.yv;
};
if (g == 10) {
gotoAndPlay (93);
}
Frame 92
gotoAndPlay (88);
Frame 135
i = 0;
while (i <= g) {
eval ("g" + i).removeMovieClip();
i++;
}
n = 2;
gotoAndPlay (25);
Symbol 25 MovieClip Frame 1
stop();
Symbol 51 MovieClip Frame 1
cheer_snd = new sound(this);
cheer_snd.attachSound("clap1.wav");
cheer2_snd = new sound(this);
cheer2_snd.attachSound("clap2.wav");
cheer3_snd = new sound(this);
cheer3_snd.attachSound("clap3.wav");
cheer4_snd = new sound(this);
cheer4_snd.attachSound("clap4.wav");
um_snd = new sound(this);
um_snd.attachSound("um1.wav");
um2_snd = new sound(this);
um2_snd.attachSound("um2.wav");
um3_snd = new sound(this);
um3_snd.attachSound("um3.wav");
um4_snd = new sound(this);
um4_snd.attachSound("um4.wav");
um5_snd = new sound(this);
um5_snd.attachSound("um5.wav");
whistle_snd = new sound(this);
whistle_snd.attachSound("whistle.wav");
Symbol 51 MovieClip Frame 2
onEnterFrame = 0;
stop();
Symbol 51 MovieClip Frame 10
onEnterFrame = function () {
if (random(7) == 1) {
gotoAndStop (2);
}
switch (random(8)) {
case 0 :
um1_snd.start();
return;
case 1 :
um2_snd.start();
return;
case 2 :
um3_snd.start();
return;
case 3 :
um4_snd.start();
return;
case 4 :
um5_snd.start();
}
};
Symbol 51 MovieClip Frame 17
gotoAndStop (2);
Symbol 51 MovieClip Frame 18
switch (random(6)) {
case 0 :
cheer_snd.start();
break;
case 1 :
cheer2_snd.start();
break;
case 2 :
cheer3_snd.start();
break;
case 3 :
cheer4_snd.start();
break;
case 4 :
whistle_snd.start();
}
fuse = random(25) + 10;
onenterFrame = function () {
fuse--;
if (fuse == 0) {
gotoAndStop (2);
}
};
Symbol 51 MovieClip Frame 54
gotoAndStop (2);
Symbol 52 MovieClip Frame 1
sigh = function (num) {
i = 1;
while (i <= num) {
a = eval ("s" + (random(14) + 1));
a.gotoandplay("sigh");
i++;
}
};
cheer = function (num) {
i = 1;
while (i <= num) {
a = eval ("s" + (random(14) + 1));
a.gotoandplay("cheer");
i++;
}
};
Symbol 58 MovieClip Frame 1
stop();
Symbol 58 MovieClip Frame 5
gotoAndStop (1);
Symbol 62 MovieClip Frame 1
stop();
Symbol 62 MovieClip Frame 5
gotoAndStop (1);
Symbol 66 MovieClip Frame 1
stop();
Symbol 66 MovieClip Frame 5
gotoAndStop (1);
Symbol 70 MovieClip Frame 1
stop();
Symbol 70 MovieClip Frame 5
gotoAndStop (1);
Symbol 74 MovieClip Frame 1
stop();
Symbol 74 MovieClip Frame 5
gotoAndStop (1);
Symbol 78 MovieClip Frame 1
stop();
Symbol 78 MovieClip Frame 2
Symbol 78 MovieClip Frame 5
gotoAndStop (1);
Symbol 82 MovieClip Frame 1
stop();
Symbol 82 MovieClip Frame 5
gotoAndStop (1);
Symbol 86 MovieClip Frame 1
stop();
Symbol 86 MovieClip Frame 5
gotoAndStop (1);
Symbol 90 MovieClip Frame 1
stop();
Symbol 90 MovieClip Frame 5
gotoAndStop (1);
Symbol 94 MovieClip Frame 1
stop();
Symbol 94 MovieClip Frame 5
gotoAndStop (1);
Symbol 98 MovieClip Frame 1
stop();
Symbol 98 MovieClip Frame 5
gotoAndStop (1);
Symbol 102 MovieClip Frame 1
stop();
Symbol 102 MovieClip Frame 5
gotoAndStop (1);
Symbol 106 MovieClip Frame 1
stop();
Symbol 106 MovieClip Frame 5
gotoAndStop (1);
Symbol 107 MovieClip Frame 1
function playNote(note) {
switch (note) {
case 1 :
C.gotoAndPlay(2);
return;
case 2 :
Csh.gotoAndPlay(2);
return;
case 3 :
D.gotoAndPlay(2);
return;
case 4 :
Dsh.gotoAndPlay(2);
return;
case 5 :
E.gotoAndPlay(2);
return;
case 6 :
F.gotoAndPlay(2);
return;
case 7 :
Fsh.gotoAndPlay(2);
return;
case 8 :
G.gotoAndPlay(2);
return;
case 9 :
Gsh.gotoAndPlay(2);
return;
case 10 :
A.gotoAndPlay(2);
return;
case 11 :
Ash.gotoAndPlay(2);
return;
case 12 :
B.gotoAndPlay(2);
return;
case 13 :
C2.gotoAndPlay(2);
}
}
function getTune(n) {
r = random(6) + 1;
curSong = aTune[n][r];
curNote = 0;
return(curSong);
}
function playNextNote() {
trace(curSong[curNote]);
playNote(curSong[curNote++]);
bDone = curSong.length < curNote;
return(bDone);
}
function getNextNote() {
return(curSong[curNote]);
}
function randomTune(n) {
var a = new array();
var c = new array();
i = 1;
while (i <= 13) {
a.unshift(i);
i++;
}
i = 1;
while (i <= n) {
pos = random(a.length);
b = a.splice(pos, 1);
c.unshift(b);
i++;
}
return(c);
}
curNote = 0;
curSong = new Array();
aTune = new array(11);
i = 0;
while (i < 11) {
aTune[i] = new array(7);
i++;
}
aTune[1][1][1] = 1;
aTune[1][2][1] = 3;
aTune[1][3][1] = 5;
aTune[1][4][1] = 8;
aTune[1][5][1] = 10;
aTune[1][6][1] = 13;
aTune[2][1] = new array(1, 3);
aTune[2][2] = new array(8, 4);
aTune[2][3] = new array(1, 8);
aTune[2][4] = new array(3, 10);
aTune[2][5] = new array(6, 10);
aTune[2][6] = new array(1, 13);
aTune[3][1] = new array(1, 3, 5);
aTune[3][2] = new array(3, 6, 10);
aTune[3][3] = new array(5, 8, 12);
aTune[3][4] = new array(6, 10, 13);
aTune[3][5] = new array(2, 7, 9);
aTune[3][6] = new array(8, 4, 1);
aTune[4][1] = new array(13, 12, 10, 8);
aTune[4][2] = new array(10, 6, 8, 1);
aTune[4][3] = new array(6, 7, 8, 9);
aTune[4][4] = new array(6, 5, 8, 13);
aTune[4][5] = new array(12, 10, 8, 5);
aTune[4][6] = new array(2, 3, 9, 10);
aTune[5][1] = new array(1, 3, 5, 6, 8);
aTune[5][2] = new array(10, 8, 5, 4, 13);
aTune[5][3] = new array(13, 1, 4, 7, 8);
aTune[5][4] = new array(10, 11, 6, 3, 1);
aTune[5][5] = new array(13, 12, 10, 8, 5);
aTune[5][6] = new array(2, 4, 7, 9, 11);
aTune[6][1] = new array(1, 5, 8, 10, 12, 13);
aTune[6][2] = new array(12, 6, 10, 5, 3, 8);
aTune[6][3] = new array(8, 5, 6, 10, 3, 1);
aTune[6][4] = new array(10, 12, 13, 5, 6, 8);
aTune[6][5] = new array(3, 4, 5, 8, 9, 10);
aTune[6][6] = new array(4, 2, 5, 3, 7, 6);
aTune[7][1] = new array(1, 5, 8, 10, 3, 6, 11);
aTune[7][2] = new array(2, 4, 7, 8, 9, 10, 11);
aTune[7][3] = new array(13, 1, 3, 4, 7, 8, 5);
aTune[7][4] = new array(10, 9, 7, 8, 3, 12, 13);
aTune[7][5] = new array(13, 12, 10, 8, 6, 3, 1);
aTune[7][6] = new array(1, 3, 4, 7, 9, 11, 13);
aTune[8][1] = new array(1, 3, 5, 6, 8, 10, 12, 13);
aTune[8][2] = new array(13, 12, 10, 8, 6, 5, 3, 1);
aTune[8][3] = new array(1, 4, 6, 7, 8, 11, 12, 13);
aTune[8][4] = new array(8, 4, 3, 1, 9, 6, 12, 13);
aTune[8][5] = new array(2, 4, 7, 9, 11, 3, 5, 8);
aTune[8][6] = new array(12, 9, 10, 7, 8, 5, 4, 1);
aTune[9][1] = new array(1, 3, 5, 6, 8, 10, 11, 12, 13);
aTune[9][2] = new array(13, 1, 3, 10, 8, 5, 4, 7, 6);
aTune[9][3] = new array(10, 13, 8, 6, 5, 4, 3, 2, 1);
aTune[9][4] = new array(7, 8, 5, 1, 4, 3, 11, 10, 13);
aTune[9][5] = new array(10, 3, 7, 8, 12, 5, 9, 10, 1);
aTune[9][6] = new array(2, 1, 4, 3, 7, 6, 9, 8, 5);
aTune[10][1] = new array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
aTune[10][2] = new array(13, 12, 10, 8, 6, 5, 4, 3, 2, 1);
aTune[10][3] = new array(2, 6, 9, 8, 12, 5, 13, 10, 4, 1);
aTune[10][4] = new array(13, 12, 11, 10, 2, 3, 4, 5, 8, 1);
aTune[10][5] = new array(1, 4, 5, 8, 10, 3, 6, 7, 11, 9);
aTune[10][6] = new array(9, 11, 13, 2, 3, 7, 6, 5, 1, 8);
stop();
Symbol 113 MovieClip Frame 1
_visible = 0;
_x = int(_x);
stop();
Symbol 125 MovieClip Frame 1
stop();
Symbol 137 MovieClip Frame 1
stop();
Symbol 138 MovieClip Frame 1
stop();
Symbol 140 Button
on (press) {
click();
}
Symbol 141 MovieClip Frame 1
function showFruitAndNumber(f, num) {
fruit.gotoAndStop(f);
number.gotoAndStop(f);
number.number.gotoAndStop(num);
}
function fall() {
ny = _y + yv;
if (ny >= maxY) {
_parent.fruitHits(myNum, note);
_y = (maxY + downAdj);
fuse = 3;
state = "playing";
} else {
_y = ny;
}
}
function playSnd() {
snd.start();
}
function loadSnd(i) {
snd = new sound(this);
snd.attachSound(i + ".mp3");
}
function soundLoaded() {
_parent.aSoundLoaded();
}
stop();
soundFolder = _root.soundFolder;
saveDefault = function () {
origScale = _xscale;
origX = _x;
origY = _y;
origDepth = this.getDepth;
};
click = function () {
_parent.click(myNum);
};
reset = function () {
_x = origX;
_y = origY;
fuse = -1;
state = "waiting";
scale = origScale;
_xscale = scale;
_yscale = scale;
_rotation = 0;
fruit._rotation = 0;
number._rotation = 0;
this.swapDepths(origDepth);
};
leave = function () {
_parent.fruitHits(myNum, note);
_y = (maxY + downAdj);
fuse = 3;
state = "playing_2";
};
onEnterFrame = function () {
if (state == "falling") {
fall();
} else if (state == "playing") {
fuse--;
if (fuse == 0) {
_y = maxY;
state = "waiting";
}
} else if (state == "playing_2") {
fuse--;
if (fuse == 0) {
_y = maxY;
yv = -70;
xv = 20 - random(40);
rv = 50 - random(100);
state = "flying";
}
} else if (state == "flying") {
yv = yv + 5;
_x = (_x + xv);
_y = (_y + yv);
fruit._rotation = fruit._rotation + rv;
number._rotation = number._rotation + rv;
if (((_x > 720) || (_x <= -20)) || (_y > 500)) {
reset();
}
if (_y < 0) {
this.swapDepths(myNum);
}
scale = scale * 0.95;
_xscale = scale;
_yscale = scale;
}
};