Frame 1
stop();
bassLoop = new Sound(bass);
bassLoop.attachSound("bass");
bassLoop.setVolume(0);
leadLoop = new Sound(lead);
leadLoop.attachSound("lead");
leadLoop.setVolume(0);
kickLoop = new Sound(kick);
kickLoop.attachSound("kick");
kickLoop.setVolume(0);
snareLoop = new Sound(snare);
snareLoop.attachSound("snare");
snareLoop.setVolume(0);
hihatLoop = new Sound(hihat);
hihatLoop.attachSound("hihat");
hihatLoop.setVolume(0);
playSound = function () {
looptimes = 1000;
bassLoop.start(0, looptimes);
trace("bass started!");
leadLoop.start(0, looptimes);
trace("bass started!");
kickLoop.start(0, looptimes);
trace("kick started!");
hihatLoop.start(0, looptimes);
trace("hihat started!");
snareLoop.start(0, looptimes);
trace("snare started!");
};
soundload = 0;
checkSound = function () {
soundload = soundload + 1;
trace(soundload);
if (soundload == 5) {
trace("I'm inside the if statement!");
playSound();
}
};
pythTheorem = function () {
xsquared = xdiff * xdiff;
ysquared = ydiff * ydiff;
csquared = xsquared + ysquared;
distance = Math.sqrt(csquared);
distance = Math.round(distance);
trace(distance);
};
findDiff = function () {
if (_root._xmouse < _root.microphone._x) {
xdiff = _root.microphone._x - _root._xmouse;
} else {
xdiff = _root._xmouse - _root.microphone._x;
}
if (_root._ymouse < _root.microphone._y) {
ydiff = _root.microphone._y - _root._ymouse;
} else {
ydiff = _root._ymouse - _root.microphone._y;
}
pythTheorem();
};
findMicDiff = function () {
if (bass._x < microphone._x) {
xdiff = microphone._x - bass._x;
} else {
xdiff = bass._x - microphone._x;
}
if (bass._y < microphone._y) {
ydiff = microphone._y - bass._y;
pythTheorem();
bass.findVolume();
} else {
ydiff = bass._y - microphone._y;
pythTheorem();
bass.findVolume();
}
if (lead._x < microphone._x) {
xdiff = microphone._x - lead._x;
} else {
xdiff = lead._x - microphone._x;
}
if (lead._y < microphone._y) {
ydiff = microphone._y - lead._y;
pythTheorem();
lead.findVolume();
} else {
ydiff = lead._y - microphone._y;
pythTheorem();
lead.findVolume();
}
if (kick._x < microphone._x) {
xdiff = microphone._x - kick._x;
} else {
xdiff = kick._x - microphone._x;
}
if (kick._y < microphone._y) {
ydiff = microphone._y - kick._y;
pythTheorem();
kick.findVolume();
} else {
ydiff = kick._y - microphone._y;
pythTheorem();
kick.findVolume();
}
if (hihat._x < microphone._x) {
xdiff = microphone._x - hihat._x;
} else {
xdiff = hihat._x - microphone._x;
}
if (hihat._y < microphone._y) {
ydiff = microphone._y - hihat._y;
pythTheorem();
hihat.findVolume();
} else {
ydiff = hihat._y - microphone._y;
pythTheorem();
hihat.findVolume();
}
if (snare._x < microphone._x) {
xdiff = microphone._x - snare._x;
} else {
xdiff = snare._x - microphone._x;
}
if (snare._y < microphone._y) {
ydiff = microphone._y - snare._y;
pythTheorem();
snare.findVolume();
} else {
ydiff = snare._y - microphone._y;
pythTheorem();
snare.findVolume();
}
};
bass.bassbutton.onPress = function () {
startDrag (bass);
clicker1 = true;
};
bass.bassbutton.onRelease = function () {
stopDrag();
clicker1 = false;
};
lead.leadbutton.onPress = function () {
startDrag (lead);
clicker2 = true;
};
lead.leadbutton.onRelease = function () {
stopDrag();
clicker2 = false;
};
kick.kickbutton.onPress = function () {
startDrag (kick);
clicker3 = true;
};
kick.kickbutton.onRelease = function () {
stopDrag();
clicker3 = false;
};
hihat.hihatbutton.onPress = function () {
startDrag (hihat);
clicker4 = true;
};
hihat.hihatbutton.onRelease = function () {
stopDrag();
clicker4 = false;
};
snare.snarebutton.onPress = function () {
startDrag (snare);
clicker5 = true;
};
snare.snarebutton.onRelease = function () {
stopDrag();
clicker5 = false;
};
microphone.micbutton.onPress = function () {
startDrag (microphone);
clicker6 = true;
};
microphone.micbutton.onRelease = function () {
stopDrag();
clicker6 = false;
};
loadSounds();
bassLoop.onLoad = checkSound();
leadLoop.onLoad = checkSound();
kickLoop.onLoad = checkSound();
hihatLoop.onLoad = checkSound();
snareLoop.onLoad = checkSound();
Symbol 15 MovieClip Frame 1
bassColor = new Color(playcircle);
bassColorNew = new Object();
bassColor.aa = 0;
bassColor.ab = 0;
bassColor.ra = 0;
bassColor.ga = 0;
bassColor.ba = 0;
bassColor.rb = 0;
bassColor.gb = 200;
bassColor.bb = 255;
bassColor.setTransform(bassColor);
alphaChange = function () {
bassColorNew.aa = volume;
bassColorNew.ab = volume;
bassColor.setTransform(bassColorNew);
};
findVolume = function () {
volume = (_root.distance - 50) / 2;
volume = 100 - volume;
trace("volume: " + volume);
makeChanges();
};
makeChanges = function () {
if (volume > 0) {
_root.bassLoop.setVolume(volume);
alphaChange();
playcircle._xscale = volume;
playcircle._yscale = volume;
}
};
onEnterFrame = function () {
if (_root.clicker1 == true) {
_root.findDiff();
findVolume();
} else if (_root.clicker6 == true) {
_root.findMicDiff();
}
};
Symbol 18 MovieClip Frame 1
leadColor = new Color(playcircle);
leadColorNew = new Object();
leadColor.aa = 0;
leadColor.ab = 0;
leadColor.ra = 0;
leadColor.ga = 0;
leadColor.ba = 0;
leadColor.rb = 50;
leadColor.gb = 255;
leadColor.bb = 0;
leadColor.setTransform(leadColor);
alphaChange = function () {
leadColorNew.aa = volume;
leadColorNew.ab = volume;
leadColor.setTransform(leadColorNew);
};
findVolume = function () {
volume = (_root.distance - 50) / 2;
volume = 100 - volume;
trace("volume: " + volume);
makeChanges();
};
makeChanges = function () {
if (volume > 0) {
_root.leadLoop.setVolume(volume);
alphaChange();
playcircle._xscale = volume;
playcircle._yscale = volume;
}
};
onEnterFrame = function () {
if (_root.clicker2 == true) {
_root.findDiff();
findVolume();
} else if (_root.clicker6 == true) {
_root.findMicDiff();
}
};
Symbol 21 MovieClip Frame 1
kickColor = new Color(playcircle);
kickColorNew = new Object();
kickColor.aa = 0;
kickColor.ab = 0;
kickColor.ra = 0;
kickColor.ga = 0;
kickColor.ba = 0;
kickColor.rb = 255;
kickColor.gb = 0;
kickColor.bb = 0;
kickColor.setTransform(kickColor);
alphaChange = function () {
kickColorNew.aa = volume;
kickColorNew.ab = volume;
kickColor.setTransform(kickColorNew);
};
findVolume = function () {
volume = (_root.distance - 50) / 2;
volume = 100 - volume;
trace("volume: " + volume);
makeChanges();
};
makeChanges = function () {
if (volume > 0) {
_root.kickLoop.setVolume(volume);
alphaChange();
playcircle._xscale = volume;
playcircle._yscale = volume;
}
};
onEnterFrame = function () {
if (_root.clicker3 == true) {
_root.findDiff();
findVolume();
} else if (_root.clicker6 == true) {
_root.findMicDiff();
}
};
Symbol 24 MovieClip Frame 1
hihatColor = new Color(playcircle);
hihatColorNew = new Object();
hihatColor.aa = 0;
hihatColor.ab = 0;
hihatColor.ra = 0;
hihatColor.ga = 0;
hihatColor.ba = 0;
hihatColor.rb = 255;
hihatColor.gb = 200;
hihatColor.bb = 0;
hihatColor.setTransform(hihatColor);
alphaChange = function () {
hihatColorNew.aa = volume;
hihatColorNew.ab = volume;
hihatColor.setTransform(hihatColorNew);
};
findVolume = function () {
volume = (_root.distance - 50) / 2;
volume = 100 - volume;
trace("volume: " + volume);
makeChanges();
};
makeChanges = function () {
if (volume > 0) {
_root.hihatLoop.setVolume(volume);
alphaChange();
playcircle._xscale = volume;
playcircle._yscale = volume;
}
};
onEnterFrame = function () {
if (_root.clicker4 == true) {
_root.findDiff();
findVolume();
} else if (_root.clicker6 == true) {
_root.findMicDiff();
}
};
Symbol 27 MovieClip Frame 1
snareColor = new Color(playcircle);
snareColorNew = new Object();
snareColor.aa = 0;
snareColor.ab = 0;
snareColor.ra = 0;
snareColor.ga = 0;
snareColor.ba = 0;
snareColor.rb = 255;
snareColor.gb = 100;
snareColor.bb = 0;
snareColor.setTransform(snareColor);
alphaChange = function () {
snareColorNew.aa = volume;
snareColorNew.ab = volume;
snareColor.setTransform(snareColorNew);
};
findVolume = function () {
volume = (_root.distance - 50) / 2;
volume = 100 - volume;
trace("volume: " + volume);
makeChanges();
};
makeChanges = function () {
if (volume > 0) {
_root.snareLoop.setVolume(volume);
alphaChange();
playcircle._xscale = volume;
playcircle._yscale = volume;
}
};
onEnterFrame = function () {
if (_root.clicker5 == true) {
_root.findDiff();
findVolume();
} else if (_root.clicker6 == true) {
_root.findMicDiff();
}
};