Source Code Komentar Dan Saran Pada Uji Lapangan
Tombol Menu Utama untuk memanggil File .swf
on release { loadMoviePengenalan.swf,
0; }
Source Code Pengenalan
Suara Instrument
lagu = new Sound; lagu.attachSound1;
lagu.start0, 999; lagu.setVolume50
Tombol Pendahuluan
on release { loadMoviePendahuluan.swf,
0; }
Tombol Materi
on release { loadMovieMateri.swf,
0; }
Tombol Latihan
on release { loadMovieLatihan.swf,
0;
}
Tombol Evaluasi
on release { loadMovieKuis.swf,
0; }
Tombol Profil
on release { loadMovieProfil.swf,
0; }
Tombol Keluar
on release { loadMovieKonfirmasi Keluar.swf, 0;
}
Source Code Pendahuluan
Suara Instrument
lagu = new Sound; lagu.attachSound4;
lagu.start0, 999; lagu.setVolume50
Tombol Pendahuluan
on release {
loadMoviePendahuluan.swf, 0;
}
Tombol Materi
on release { loadMovieMateri.swf,
0; }
Tombol Latihan
on release { loadMovieLatihan.swf,
0; }
Tombol Evaluasi
on release { loadMovieKuis.swf,
0; }
Tombol Profil
on release { loadMovieProfil.swf,
0; }
Tombol Keluar
on release {
loadMovieKonfirmasi Keluar.swf, 0; }
Source Code Materi
Tombol Materi 1
on release{ gotoAndStop68;
}
Tombol Materi 2
on release{ gotoAndStop99;
}
Tombol Materi 3
on release{ gotoAndStop109;
}
Tombol Materi 4
on release{ gotoAndStop128;
}
Tombol Pendahuluan
on release { loadMoviePendahuluan.swf,
0; }
Tombol Materi
on release { loadMovieMateri.swf,
0; }
Tombol Latihan
on release { loadMovieLatihan.swf,
0; }
Tombol Evaluasi
on release { loadMovieKuis.swf,
0; }
Tombol Profil
on release { loadMovieProfil.swf,
0; }
Tombol Keluar
on release { loadMovieKonfirmasi Keluar.swf, 0;
}
Source Code Latihan
function QuizItemquestion {
this.question=question; this.answers=new
Array; this.picture=lokasi;
reset statistic this.numOfAnswers=0;
this.correctAnswer=0;
this function returns the question of this item this.getQuestion=function
{ return
this.question; return
this.lokasi; }
add answer to multiple choice items this.addAnswer=functionanswer,
isCorrectAnswer {
this.answers[this.numOfAnswers]=answer; if
isCorrectAnswer this.correctAnswer=this.numOfAnswers;
this.numOfAnswers++; }
this function returns the n-th answer this.getAnswer=functionanswerNumberToGet
{ return
this.answers[answerNumberToGet]; }
this function returns the index of the correct answer this.getCorrectAnswerNumber=function
{ return
this.correctAnswer; }
this function checks if the passed number is the correct answer index
this.checkAnswerNumber=functionuserAnswerNumber {
if userAnswerNumber==this.getCorrectAnswerNumber
gotoAndPlayCorrect; else
gotoAndPlayWrong; }
}
this function parses the XML data into our data structure function onQuizDatasuccess
{ var
quizNode=this.firstChild; var
quizTitleNode=quizNode.firstChild; title=quizTitleNode.firstChild.nodeValue;
var i=0;
items follows title var
itemsNode=quizNode.childNodes[1]; go through every item and convert it into our data structure
while itemsNode.childNodes[i]
{ var
itemNode=itemsNode.childNodes[i]; item consists of question and one or
more answer. question always comes before answers
Ie: question is the node 0 of item var
questionNode=itemNode.childNodes[0]; quizItems[i]=new
QuizItemquestionNode.firstChild.nodeValue; var
a=1; Go through every answer and add them
to our data structure. answer follows question
var answerNode=itemNode.childNodes[a++];
while answerNode
{ var
isCorrectAnswer=false; if
answerNode.attributes.correct==y isCorrectAnswer=true;
quizItems[i].addAnswer answerNode.firstChild.nodeValue,
isCorrectAnswer; goto the next answer
answerNode=itemNode.childNodes[a++]; }
i++; }
Were done decoding, now we can start gotoAndStopStart;
} var quizItems=new Array;
var myData=new XML; myData.ignoreWhite=true;
myData.onLoad=onQuizData; myData.loadlatihan.xml;
stop; Im telling Flash not to continue until the XML is
loaded.
Source Code Evaluasi
function QuizItemquestion
{ this.question=question;
this.answers=new Array;
this.picture=lokasi; reset statistic
this.numOfAnswers=0; this.correctAnswer=0;
this function returns the question of this item this.getQuestion=function
{ return
this.question; return
this.lokasi; }
add answer to multiple choice items this.addAnswer=functionanswer,
isCorrectAnswer {
this.answers[this.numOfAnswers]=answer; if
isCorrectAnswer this.correctAnswer=this.numOfAnswers;
this.numOfAnswers++; }
this function returns the n-th answer this.getAnswer=functionanswerNumberToGet
{
return this.answers[answerNumberToGet];
}
this function returns the index of the correct answer this.getCorrectAnswerNumber=function
{ return
this.correctAnswer; }
this function checks if the passed number is the correct answer index
this.checkAnswerNumber=functionuserAnswerNumber {
if userAnswerNumber==this.getCorrectAnswerNumber
gotoAndPlayCorrect; else
gotoAndPlayWrong; }
}
this function parses the XML data into our data structure function onQuizDatasuccess
{ var
quizNode=this.firstChild; var
quizTitleNode=quizNode.firstChild; title=quizTitleNode.firstChild.nodeValue;
var i=0;
items follows title var
itemsNode=quizNode.childNodes[1]; go through every item and convert it into our data structure
while itemsNode.childNodes[i]
{ var
itemNode=itemsNode.childNodes[i]; item consists of question and one or
more answer. question always comes before answers
Ie: question is the node 0 of item var
questionNode=itemNode.childNodes[0]; quizItems[i]=new
QuizItemquestionNode.firstChild.nodeValue; var
a=1; Go through every answer and add them
to our data structure. answer follows question
var answerNode=itemNode.childNodes[a++];
while answerNode
{ var
isCorrectAnswer=false; if
answerNode.attributes.correct==y isCorrectAnswer=true;
quizItems[i].addAnswer
answerNode.firstChild.nodeValue, isCorrectAnswer;
goto the next answer answerNode=itemNode.childNodes[a++];
} i++;
} Were done decoding, now we can start
gotoAndStopStart; }
var quizItems=new Array; var myData=new XML;
myData.ignoreWhite=true; myData.onLoad=onQuizData;
myData.loadlatihan.xml; stop;
Im telling Flash not to continue until the XML is loaded.
Source Code Profil
Suara Instrument
lagu = new Sound; lagu.attachSound2;
lagu.start0, 999; lagu.setVolume50
Tombol Pendahuluan
on release { loadMoviePendahuluan.swf,
0; }
Tombol Materi
on release { loadMovieMateri.swf,
0; }
Tombol Latihan
on release { loadMovieLatihan.swf,
0; }
Tombol Evaluasi
on release { loadMovieKuis.swf,
0; }
Tombol Profil
on release { loadMovieProfil.swf,
0; }
Tombol Keluar
on release {
loadMovieKonfirmasi Keluar.swf, 0; }
Source Code Exit
Tombol Tidak
on release { loadMovie menuutama.swf, 0;
}
Tombol Iya
on release { fscommandquit, true;
}
132
LAMPIRAN