Frame 1
Frame 2
gotoAndStop (2);
checknote = function () {
var _local1 = _global;
note1 = "a-3";
note1b = "a+3";
note2 = "b-3";
note3 = "c-4";
note3b = "c+4";
note4 = "d-4";
note4b = "d+4";
note5 = "e-4";
note6 = "f-4";
note6b = "f+4";
note7 = "g-4";
note7b = "g+4";
note8 = "a-4";
note8b = "a+4";
note9 = "b-4";
note10 = "c-5";
note10b = "c+5";
note11 = "d-5";
note11b = "d+5";
note12 = "e-5";
_local1.currentnote = "none";
if ((_ymouse > 160) & (_ymouse < 210)) {
if ((_xmouse >= 75) && (_xmouse < 100)) {
_local1.currentnote = note1;
}
if ((_xmouse >= 100) && (_xmouse < 125)) {
_local1.currentnote = note2;
}
if ((_xmouse >= 125) && (_xmouse < 150)) {
_local1.currentnote = note3;
}
if ((_xmouse >= 150) && (_xmouse < 176)) {
_local1.currentnote = note4;
}
if ((_xmouse >= 176) && (_xmouse < 202)) {
_local1.currentnote = note5;
}
if ((_xmouse >= 202) && (_xmouse < 228)) {
_local1.currentnote = note6;
}
if ((_xmouse >= 228) && (_xmouse < 254)) {
_local1.currentnote = note7;
}
if ((_xmouse >= 254) && (_xmouse < 279)) {
_local1.currentnote = note8;
}
if ((_xmouse >= 279) && (_xmouse < 304)) {
_local1.currentnote = note9;
}
if ((_xmouse >= 304) && (_xmouse < 329)) {
_local1.currentnote = note10;
}
if ((_xmouse >= 329) && (_xmouse < 354)) {
_local1.currentnote = note11;
}
if ((_xmouse >= 354) && (_xmouse < 376)) {
_local1.currentnote = note12;
}
}
if ((_ymouse > 160) & (_ymouse < 190)) {
if ((_xmouse >= 89) && (_xmouse < 112)) {
_local1.currentnote = note1b;
}
if ((_xmouse >= 140) && (_xmouse < 164)) {
_local1.currentnote = note3b;
}
if ((_xmouse >= 164) && (_xmouse < 188)) {
_local1.currentnote = note4b;
}
if ((_xmouse >= 216) && (_xmouse < 240)) {
_local1.currentnote = note6b;
}
if ((_xmouse >= 240) && (_xmouse < 265)) {
_local1.currentnote = note7b;
}
if ((_xmouse >= 265) && (_xmouse < 290)) {
_local1.currentnote = note8b;
}
if ((_xmouse >= 317) && (_xmouse < 342)) {
_local1.currentnote = note10b;
}
if ((_xmouse >= 342) && (_xmouse < 365)) {
_local1.currentnote = note11b;
}
}
};
_global.stylosound = new Sound(this);
this.onEnterFrame = function () {
var _local1 = _global;
if (_local1.stylophonepressed) {
checknote();
if ((_local1.currentnote != _local1.previousnote) && (_local1.currentnote != "none")) {
_local1.stylosound.attachSound(_local1.currentnote + ".wav");
_local1.stylosound.stop();
_local1.stylosound.start(0, 99);
_local1.previousnote = _local1.currentnote;
_local1.fadestate = 5;
} else if (_local1.currentnote == "none") {
_local1.stylosound.stop();
_local1.previousnote = _local1.currentnote;
}
}
stylus_mc._x = _xmouse - 5;
stylus_mc._y = _ymouse;
};
btn_stylo.onPress = function () {
_global.stylophonepressed = true;
};
btn_stylo.onRelease = function () {
var _local1 = _global;
_local1.stylosound.stop();
_local1.stylophonepressed = false;
_local1.previousnote = "none";
};
btn_stylo.onReleaseOutside = function () {
var _local1 = _global;
_local1.stylosound.stop();
_local1.stylophonepressed = false;
_local1.previousnote = "none";
};