Frame 1
function sndInit() {
var _local2;
_local2 = 0;
while (_local2 < MSND) {
sndObj[_local2] = new Sound(this);
sndObj[_local2].attachSound(snd_fi[_local2]);
_local2++;
}
}
function sndPlay(a) {
sndObj[a].start();
}
function sndStop(a) {
sndObj[a].stop(snd_fi[a]);
}
function r2xx(r, sp) {
return(sp * Math.cos(r));
}
function r2yy(r, sp) {
return(sp * Math.sin(r));
}
function xy2r(xx, yy) {
return((Math.atan2(yy, xx) / Math.PI) * 180);
}
function rand(a) {
return(Math.floor(Math.random() * a));
}
function randF(a) {
return(Math.random() * a);
}
function wrapvalue(a) {
return(a % 360);
}
function rgb(r, g, b) {
return(((r << 16) + (g << 8)) + b);
}
function chgS(mc, s) {
mc.s = s;
mc._xscale = s;
mc._yscale = s;
}
function brdRight(mc) {
return(SCX - (mc._width / 2));
}
function brdBottom(mc) {
return(SCY - (mc._height / 2));
}
function brdTop(mc) {
return(mc._height / 2);
}
function brdLeft(mc) {
return(mc._width / 2);
}
function hideRight(mc) {
return(SCX + (mc._width / 2));
}
function hideBottom(mc) {
return((a = SCY + (mc._height / 2)));
}
function hideTop(mc) {
return((-mc._height) / 2);
}
function hideLeft(mc) {
return((-mc._width) / 2);
}
function delNa(na) {
var _local1;
_local1 = 0;
while (_local1 < nas.length) {
if (nas[_local1] == na) {
nas.splice(_local1, 1);
return(undefined);
}
_local1++;
}
}
function addNa(na) {
nas.push(na);
}
function clearT() {
i = 0;
while (i < nas.length) {
_root[nas[i]].removeMovieClip();
i++;
}
nas = [];
}
function chkT(x, y, a, myna, s) {
var _local2;
var _local9;
var _local3 = -1;
_local2 = 0;
while (_local2 < nas.length) {
if ((((_root[nas[_local2]].t == a) && (nas[_local2] != myna)) && (Math.abs(_root[nas[_local2]]._x - x) < s)) && (Math.abs(_root[nas[_local2]]._y - y) < s)) {
_local3 = _root[nas[_local2]].t;
rsi = _local2;
rsx = _root[nas[_local2]]._x;
rsy = _root[nas[_local2]]._y;
return(_local3);
}
_local2++;
}
return(_local3);
}
function setT(x, y, imgn, t1, pri) {
if (!tdp[pri]) {
tdp[pri] = 0;
}
na = ((imgn + pri) + "_") + tdp[pri];
addNa(na);
this.attachMovie(imgn, na, (pri * MTDP) - tdp[pri]);
tdp[pri]++;
if (tdp[pri] == MTDP) {
tdp[pri] = 0;
}
this[na].t = t1;
this[na]._x = x;
this[na]._y = y;
this[na].h = 0;
this[na].l = 0;
this[na]._xscale = 100;
this[na]._yscale = 100;
this[na].s = 100;
this[na].xx = 0;
this[na].yy = 0;
this[na].smo = 0;
this[na].myna = na;
switch (t1) {
case 101 :
this[na].l = 0;
this[na].gotoAndStop(1);
this[na].onPress = function () {
sndPlay(this.h);
this.gotoAndStop(2);
this.l = 1;
ks = 1;
if (this.h == 6) {
a = 5;
} else {
a = 1;
}
i = 0;
while (i < a) {
c = setT(282, 96, "kao", 1, 20);
c.gotoAndStop(1);
var _local2 = new Color(c);
_local2.setRGB(rgb(rand(128) + 128, rand(128) + 128, rand(128) + 128));
i++;
}
if (dns < 0) {
dns = 0;
}
dns = dns + 20;
if (dns > 128) {
dns = 128;
}
lpmc.play();
};
break;
case 102 :
this[na].l = 0;
this[na].gotoAndStop(1);
this[na].onPress = function () {
if (this.l == 0) {
this.l = 1;
jp = 1;
sndPlay(this.h);
this.gotoAndStop(2);
lpmc.play();
} else {
this.l = 0;
sndStop(this.h);
jp = 0;
this.gotoAndStop(1);
lpmc.stop();
}
};
}
this[na].onEnterFrame = function () {
var _local4;
var _local3;
var _local7;
var _local8;
var _local6;
var _local5;
var _local9;
_local6 = _root._xmouse;
_local5 = _root._ymouse;
_local4 = this._x;
_local3 = this._y;
switch (t1) {
case 1 :
if (jp) {
_local3 = _local3 + this.yy;
this.yy++;
if (_local3 > this.tsy) {
_local3 = this.tsy;
}
if (rand(8) == 0) {
this.tsy = _local3;
this.yy = -5 - rand(3);
}
} else {
this.tsy = _local3;
}
SP = 5;
if ((rand(8) == 0) || (this.h == 0)) {
this.h = 1 + rand(6);
}
switch (this.h) {
case 1 :
_local3 = _local3 - SP;
break;
case 2 :
_local4 = _local4 + SP;
break;
case 3 :
_local3 = _local3 + SP;
break;
case 4 :
_local4 = _local4 - SP;
break;
case 5 :
_local4 = (_local4 + rand(7)) - 3;
_local3 = (_local3 + rand(7)) - 3;
}
if (chkT(_local4, _local3, 1, this.myna, 16) != -1) {
SP = 15;
if (_local4 < rsx) {
_local4 = _local4 - rand(SP);
}
if (_local4 > rsx) {
_local4 = _local4 + rand(SP);
}
if (_local3 < rsy) {
_local3 = _local3 - rand(SP);
}
if (_local3 > rsy) {
_local3 = _local3 + rand(SP);
}
}
ax = 376;
if (_local4 > ax) {
_local4 = ax;
this.h = 1 + rand(6);
}
ax = 188;
if (_local4 < ax) {
_local4 = ax;
this.h = 1 + rand(6);
}
ay = 143;
if (_local3 > ay) {
_local3 = ay;
this.h = 1 + rand(6);
}
ay = 15;
if (_local3 < ay) {
_local3 = ay;
this.h = 1 + rand(6);
}
if ((++this.l) == 50) {
this.removeMovieClip();
}
break;
case 3 :
dns--;
if ((dns < 0) && (jp == 0)) {
this.stop();
}
break;
case 101 :
if (!this.l) {
break;
}
if (ks != 0) {
break;
}
this.gotoAndStop(1);
this.l = 0;
}
this._x = _local4;
this._y = _local3;
if (this.smo == 0) {
this._xscale = this.s;
this._yscale = this.s;
}
};
return(this[na]);
}
SCX = Stage.width;
SCY = Stage.height;
MTDP = 300;
lo = 0;
var tdp = new Array();
var nas = new Array();
var snd_fi = ["c.wav", "d.wav", "e.wav", "f.wav", "g.wav", "a.wav", "1.wav", "loop1.wav"];
var MSND = 8;
var sndObj = new Array(MSND);
var rsi;
var rsx;
var rsy;
var ks = 0;
var jp = 0;
var dns = 50;
var lpmc;
_root.onMouseUp = function () {
ks = 0;
};
tim1._visible = false;
tim1.onEnterFrame = function () {
lo++;
};
sndInit();
sndObj[7].onSoundComplete = function () {
this.start();
};
sx = 185;
sy = 225;
c = setT(sx, sy, "bt_c", 101, 10);
c.h = 0;
c = setT(sx + 40, sy, "bt_d", 101, 10);
c.h = 1;
c = setT(sx + 80, sy, "bt_e", 101, 10);
c.h = 2;
c = setT(sx + 120, sy, "bt_f", 101, 10);
c.h = 3;
c = setT(sx + 160, sy, "bt_g", 101, 10);
c.h = 4;
c = setT(sx, 184, "bt_k", 101, 10);
c.h = 6;
c = setT(344, 184, "bt_a", 101, 10);
c.h = 5;
c = setT(325, 207, "sw", 102, 10);
c.s = 90;
c.h = 7;
lpmc = setT(105, 150, "girl", 3, 30);