Frame 2
lesson_notes = new Array();
if (Number(_framesloaded) < 10) {
prompt_ = _framesloaded;
gotoAndPlay (1);
} else {
User_Name = "";
Piano_text = "";
Guitar_text = "";
Drum_text = "";
from_note_piano = 10;
to_note_piano = 550;
from_note_guitar = 10;
to_note_guitar = 550;
from_note_drums = 10;
to_note_drums = 550;
gotoAndPlay (5);
}
Frame 5
function showWWW() {
if ((_level0.Show_www == "ON") && (www._alpha < 100)) {
www._alpha = www._alpha + 90;
}
if ((_level0.Show_www == "OFF") && (www._alpha > 0)) {
www._alpha = www._alpha - 90;
}
}
function findLength() {
i = 40;
while (i > 0) {
flag = 0;
if (_root["a" + i]._currentFrame == 10) {
flag = 1;
}
if (flag == 0) {
} else {
break;
}
i--;
}
n = i;
nn = int(60 * (100 / temp));
Length = ((("Length=" + (n - 1)) + "notes ") + int((60 * (n - 1)) / nn)) + " sec.";
}
function init() {
select._alpha = 0;
select._x = -200;
i = 1;
while (i <= 27) {
attachMovie("time guitar", "a" + i, i + 200);
_root["a" + i]._x = 5 + (20 * (i - 1));
_root["a" + i]._y = 250;
_root["a" + i].note = "";
_root["a" + i].select._alpha = 0;
_root["a" + i].instrument = "guitar";
i++;
}
_root.a1.gotoandstop(10);
}
function addNote(text_no, kod) {
if (UserNote >= 25) {
return(undefined);
}
trace((("guitar note " + text_no) + " ") + kod);
clearPlay();
_root.PlayList = 0;
_root.player_no = 0;
_root.UserNote++;
_root["a" + _root.UserNote].gotoandstop(1);
_root["a" + _root.UserNote].note = kod;
_root["a" + (_root.UserNote + 1)].gotoandstop(10);
_root.PressNote = _root.UserNote;
mySound = new Sound();
mySound.attachSound(text_no);
mySound.setPan(0);
mySound.setVolume(100);
mySound.start();
findLength();
SaveGuitar();
}
function DeleteOneNote() {
i = UserNote;
while (i < 100) {
_root["a" + i].note = _root["a" + (i + 1)].note;
nn = _root["a" + (i + 1)]._currentFrame;
_root["a" + i].gotoandstop(nn);
i++;
}
UserNote--;
if (UserNote < 0) {
UserNote = 1;
}
_root.Button_delete._x = _root["a" + _root.UserNote]._x + 10;
_root.PressNote = _root.UserNote;
findLength();
_root.curent_no = 1;
_root.PlayList = 0;
SaveGuitar();
}
function DeleteAll() {
curent_no = 0;
PlayList = 0;
UserNote = 0;
PressNote = 0;
i = 1;
while (i < 100) {
_root["a" + i].gotoandstop(1);
_root["a" + i].note = "";
_root["a" + i].select._alpha = 0;
i++;
}
_root.a1.gotoandstop(10);
Movie_ruller.button_go._x = 10;
Movie_ruller.button_stop._x = 540;
Button_delete._x = 8;
movie_temp.reset();
Movie_bits.reset();
findLength();
SaveGuitar();
from_note_guitar = 1;
to_note_guitar = 27;
}
function clearPlay() {
_root.curent_no = 1;
_root.PlayList = 0;
i = 1;
while (i < 100) {
i = 1;
while (i < 100) {
_root["a" + i].select._alpha = 0;
i++;
}
i++;
}
}
function SaveGuitar() {
guitar_Text = "";
guitar_Text_select = "";
i = 1;
while (i < 100) {
note = _root["a" + i].note;
if (note.length < 1) {
break;
}
guitar_Text = (guitar_Text + note) + ",";
if (_root["a" + i]._alpha > 90) {
guitar_Text_select = (guitar_Text_select + note) + ",";
}
i++;
}
trace("Save guitar melody=" + guitar_Text);
}
function LoadGuitar() {
init();
Nom = 1;
s = guitar_Text;
s_save = guitar_Text;
if (s.length < 1) {
return(undefined);
}
_root.a1.gotoandstop(1);
trace("Load Guitar melody =" + s);
m = 1;
letter_melody = "";
while (s.length > 0) {
i = 1;
while (((substring(s, i, 1)) != ",") && (s.length > 0)) {
i++;
}
tag = substring(s, 1, i - 1);
s = substring(s, i + 1, 10000);
_root["a" + Nom].note = tag;
Nom++;
tag = substring(s, 1, 1);
if (tag == "$") {
return(undefined);
}
}
UserNote = Nom - 1;
_root["a" + (_root.UserNote + 1)].gotoandstop(10);
guitar_Text = s_save;
}
UserNote = 0;
loopFlag = 0;
Temp = 50;
Bits = 5;
Melody_Select = "Non melody select";
Screen_width = 550;
Screen_high = 400;
Pages.Page_Piano.Gotoandstop(1);
Pages.Page_Guitar.Gotoandstop(2);
Pages.Page_Drums.Gotoandstop(1);
LoadGuitar();
Movie_ruller.restore();
stop();
Show_www = "ON";
www._alpha = 0;
showWWW();
Instance of Symbol 96 MovieClip in Frame 5
onClipEvent (mouseDown) {
x = _root._xmouse;
y = _root._ymouse;
i = 1;
while (i < 100) {
if (_root["g" + i].hitTest(x, y, true)) {
_root.Button_delete._x = _root._xmouse;
_root.GuitarUserNote = i;
}
i++;
}
}
onClipEvent (mouseUp) {
return(undefined);
}
onClipEvent (enterFrame) {
if (nextNoteTime > getTimer()) {
return(undefined);
}
nextNoteTime = getTimer() + (nexttime * (_root.temp / 100));
if (_root.pouse == 1) {
return(undefined);
}
if (_root.PlayList == 0) {
bit = 1;
return(undefined);
}
while (_root["a" + _root.player_no]._alpha < 40) {
_root.player_no++;
}
no = _root["a" + _root.player_no]._currentFrame;
_root["a" + (_root.player_no - 1)].select._alpha = 0;
if ((no == 10) || (_root["a" + _root.player_no]._alpha < 60)) {
if (_root.loopFlag == 0) {
_root.PlayList = 0;
}
_root.player_no = 1;
return(undefined);
}
_root["a" + _root.player_no].select._alpha = 100;
note = _root["a" + _root.player_no].note;
trace("Play guitar " + note);
text_no = "";
if (note == "1-1") {
text_no = "37";
}
if (note == "1-2") {
text_no = "36";
}
if (note == "1-3") {
text_no = "35";
}
if (note == "1-4") {
text_no = "34";
}
if (note == "1-5") {
text_no = "34";
}
if (note == "2-1") {
text_no = "5";
}
if (note == "2-2") {
text_no = "4";
}
if (note == "2-3") {
text_no = "3";
}
if (note == "2-4") {
text_no = "2";
}
if (note == "2-5") {
text_no = "1";
}
if (note == "3-1") {
text_no = "9";
}
if (note == "3-2") {
text_no = "8";
}
if (note == "3-3") {
text_no = "7";
}
if (note == "3-4") {
text_no = "6";
}
if (note == "3-5") {
text_no = "5";
}
if (note == "4-1") {
text_no = "14";
}
if (note == "4-2") {
text_no = "13";
}
if (note == "4-3") {
text_no = "12";
}
if (note == "4-4") {
text_no = "11";
}
if (note == "4-5") {
text_no = "10";
}
if (note == "5-1") {
text_no = "19";
}
if (note == "5-2") {
text_no = "18";
}
if (note == "5-3") {
text_no = "17";
}
if (note == "5-4") {
text_no = "16";
}
if (note == "5-5") {
text_no = "15";
}
if (note == "6-1") {
text_no = "24";
}
if (note == "6-2") {
text_no = "23";
}
if (note == "6-3") {
text_no = "22";
}
if (note == "6-4") {
text_no = "21";
}
if (note == "6-5") {
text_no = "20";
}
volume_no = 100;
mySound = new Sound();
mySound.attachSound(text_no);
mySound.setPan(0);
mySound.setVolume(volume_no);
mySound.start();
_root.player_no++;
bit++;
if (bit > _root.bits) {
bit = 0;
}
}
onClipEvent (load) {
_root.player_no = 0;
PlayList = 0;
nexttime = 600;
nextNoteTime = getTimer() + nexttime;
}
Instance of Symbol 108 MovieClip "Movie_ruller" in Frame 5
on (rollOver) {
_root.GuitarPrompt = "Change the windows of playng";
}
on (rollOut) {
_root.GuitarPrompt = "";
}
Symbol 44 MovieClip [time guitar] Frame 1
stop();
Symbol 53 Button
on (press) {
_root.addNote(34, "1-4");
}
Symbol 54 Button
on (press) {
_root.addNote(5, "2-1");
}
Symbol 55 Button
on (press) {
_root.addNote(14, "4-1");
}
Symbol 56 Button
on (press) {
_root.addNote(19, "5-1");
}
Symbol 57 Button
on (press) {
_root.addNote(24, "6-1");
}
Symbol 58 Button
on (press) {
_root.addNote(33, "1-5");
}
Symbol 59 Button
on (press) {
_root.addNote(4, "2-2");
}
Symbol 60 Button
on (press) {
_root.addNote(9, "3-1");
}
Symbol 61 Button
on (press) {
_root.addNote(13, "4-2");
}
Symbol 62 Button
on (press) {
_root.addNote(18, "5-2");
}
Symbol 63 Button
on (press) {
_root.addNote(23, "6-2");
}
Symbol 64 Button
on (press) {
_root.addNote(32);
}
Symbol 65 Button
on (press) {
_root.addNote(3, "2-3");
}
Symbol 66 Button
on (press) {
_root.addNote(8, "3-2");
}
Symbol 67 Button
on (press) {
_root.addNote(12, "4-3");
}
Symbol 68 Button
on (press) {
_root.addNote(17, "5-3");
}
Symbol 69 Button
on (press) {
_root.addNote(22, "6-3");
}
Symbol 70 Button
on (press) {
_root.addNote(31);
}
Symbol 71 Button
on (press) {
_root.addNote(2, "2-4");
}
Symbol 72 Button
on (press) {
_root.addNote(7, "3-3");
}
Symbol 73 Button
on (press) {
_root.addNote(11, "4-4");
}
Symbol 74 Button
on (press) {
_root.addNote(16, "5-4");
}
Symbol 75 Button
on (press) {
_root.addNote(21, "6-4");
}
Symbol 76 Button
on (press) {
_root.addNote(30);
}
Symbol 77 Button
on (press) {
_root.addNote(1, "2-5");
}
Symbol 78 Button
on (press) {
_root.addNote(6, "3-4");
}
Symbol 79 Button
on (press) {
_root.addNote(10, "4-5");
}
Symbol 80 Button
on (press) {
_root.addNote(15, "5-5");
}
Symbol 81 Button
on (press) {
_root.addNote(20, "6-5");
}
Symbol 82 Button
on (press) {
_root.addNote(9);
}
Symbol 83 Button
on (press) {
_root.addNote(8);
}
Symbol 84 Button
on (press) {
_root.addNote(7);
}
Symbol 85 Button
on (press) {
_root.addNote(6);
}
Symbol 86 Button
on (press) {
_root.addNote(29);
}
Symbol 87 Button
on (press) {
_root.addNote(28);
}
Symbol 88 Button
on (press) {
_root.addNote(27);
}
Symbol 89 Button
on (press) {
_root.addNote(26);
}
Symbol 90 Button
on (press) {
_root.addNote(25);
}
Symbol 91 Button
on (press) {
_root.addNote(37, "1-1");
}
Symbol 92 Button
on (press) {
_root.addNote(36, "1-2");
}
Symbol 93 Button
on (press) {
_root.addNote(35, "1-3");
}
Symbol 94 Button
on (press) {
_root.addNote(5, "3-5");
}
Symbol 98 Button
on (press) {
_root.PlayList = 1;
_root.pouse = 0;
select._alpha = 100;
}
on (rollOver) {
_root.Prompt = "Play melody";
}
on (rollOut) {
_root.Prompt = "";
}
Symbol 100 Button
on (press) {
_root.Curent_no = 1;
_root.Player_no = 1;
_root.PlayList = 0;
_root.ClearPlay();
_root.prompt = "Go to the first note";
}
on (rollOver) {
_root.Prompt = "Stop melody";
}
on (rollOut) {
_root.Prompt = "";
}
Symbol 102 Button
on (press) {
if (_root.pouse == 1) {
_root.pouse = 0;
_root.prompt = "Pouse off";
} else {
_root.pouse = 1;
_root.prompt = "Pouse on";
}
}
on (rollOver) {
_root.Prompt = " Pouse";
}
on (rollOut) {
_root.Prompt = "";
}
Symbol 104 Button
on (press) {
if (_root.loopFlag == 1) {
_root.loopFlag = 0;
_root.prompt = "Loop melody off";
} else {
_root.loopFlag = 1;
_root.prompt = "Loop melody on";
}
}
on (rollOver) {
_root.Prompt = "Loop melody =" + _root.loopFlag;
}
on (rollOut) {
_root.Prompt = "";
}
Symbol 108 MovieClip Frame 1
function restore() {
if (_root._currentframe == 5) {
trace("_root.from_note_piano " + _root.from_note_piano);
trace("_root.to_note_piano " + _root.to_note_piano);
button_go._x = _root.from_note_piano;
button_stop._x = _root.to_note_piano;
}
if (_root._currentframe == 10) {
button_go._x = _root.from_note_guitar;
button_stop._x = _root.to_note_guitar;
}
if (_root._currentframe == 15) {
button_go._x = _root.from_note_drums;
button_stop._x = _root.to_note_drums;
}
}
function reset() {
trace("reset ruller");
button_go._x = 10;
button_stop._x = 540;
_root.from_note = int(button_go._x / 20);
_root.to_note = int(button_stop._x / 20);
}
function checkDrag() {
if ((button_go.drag == 1) || (button_stop.drag == 1)) {
x = button_go._x;
if (button_go.drag == 1) {
button_go._x = xx;
}
if (button_stop.drag == 1) {
button_stop._x = xx;
}
button_go.drag = 0;
button_stop.drag = 0;
if (button_go._x < 5) {
button_go._x = 5;
}
if (button_stop._x < 50) {
button_stop._x = 50;
}
if (button_go._x > (_root.Screen_width - 10)) {
button_go._x = _root.Screen_width - 10;
}
if (button_stop._x > (_root.Screen_width - 5)) {
button_stop._x = _root.Screen_width - 5;
}
if (button_go._x > button_stop._x) {
button_go._x = button_stop._x - 20;
}
}
from_note1 = (button_go._x - 5) / 20;
to_note1 = (button_stop._x - 5) / 20;
_root.from_note = button_go._x;
_root.to_note = button_stop._x;
i = 1;
while (i <= 27) {
alpha = 100;
if (i < from_note1) {
alpha = 30;
} else if (i > to_note1) {
alpha = 50;
}
_root["n" + i]._alpha = alpha;
_root["a" + i]._alpha = alpha;
_root["tom11" + i]._alpha = alpha;
_root["tom11" + i]._alpha = alpha;
_root["tom12" + i]._alpha = alpha;
_root["snare" + i]._alpha = alpha;
_root["kick" + i]._alpha = alpha;
_root["tom13" + i]._alpha = alpha;
_root["hihats_loose" + i]._alpha = alpha;
_root["crash14" + i]._alpha = alpha;
_root["crash15" + i]._alpha = alpha;
_root["crash18" + i]._alpha = alpha;
_root["ride" + i]._alpha = alpha;
i++;
}
if (_root._currentframe == 5) {
_root.savePiano();
_root.from_note_piano = _root.from_note;
_root.to_note_piano = _root.to_note;
}
if (_root._currentframe == 10) {
_root.saveGuitar();
_root.from_note_guitar = _root.from_note;
_root.to_note_guitar = _root.to_note;
trace("g " + _root.from_note_guitar);
trace("g " + _root.to_note_guitar);
}
if (_root._currentframe == 15) {
_root.saveDrums();
_root.from_note_drums = _root.from_note;
_root.to_note_drums = _root.to_note;
}
}
aaa = 44;
actions._alpha = 0;
reset();
stop();
Instance of Symbol 96 MovieClip "actions" in Symbol 108 MovieClip Frame 1
onClipEvent (mouseDown) {
x = _root._xmouse;
y = _root._ymouse;
if (_parent.button_go.hitTest(x, y, true)) {
_parent.button_go.drag = 1;
_parent.button_go.xx = _parent.button_go._x;
offsetx = _parent.button_go._x - x;
}
if (_parent.button_stop.hitTest(x, y, true)) {
_parent.button_stop.drag = 1;
_parent.button_stop.xx = _parent.button_stop._x;
offsetx = _parent.button_stop._x - x;
}
}
onClipEvent (mouseUp) {
_parent.checkDrag();
}
onClipEvent (enterFrame) {
if (_parent.button_go.drag == 1) {
_parent.button_go._x = _root._xmouse + offsetx;
}
if (_parent.button_stop.drag == 1) {
_parent.button_stop._x = _parent._xmouse + offsetx;
}
if (_parent.button_go._x < 5) {
_parent.button_go._x = 5;
}
if (_parent.button_stop._x < 10) {
_parent.button_stop._x = 10;
}
if (_parent.button_go._x > (_root.Screen_width - 15)) {
_parent.button_go._x = _root.Screen_width - 15;
}
if (_parent.button_stop._x > (_root.Screen_width - 5)) {
_parent.button_stop._x = _root.Screen_width - 5;
}
}
Symbol 111 Button
on (press) {
_root.DeleteAll();
}
on (rollOver) {
_root.Prompt = "Delete melody";
}
on (rollOut) {
_root.Prompt = "";
}
Symbol 117 Button
on (release) {
getURL ("http://www.flashmusicgames.com");
}