Hurmm....masalah yang sy hadapi ialah answer y case sensitive - kalau answer "nose" betul tapi kalau answer "Nose" salah..
Step by step:
1. Bina beberapa layer mengikut keperluan.
2. Gunakan Static Text untuk soalan, Input Text (var : answer) untuk ruang jawapan daripada pengguna dan Dynamic Text (var : respon) untuk respon kepada jawapan pengguna.
3. Bina layer stop dan masukkan actionscript :
var respon;
var answer;
respon = ""
answer = ""
stop();
4. Bina layer button, masukkan Check Button dan Next Button.
Actionscript untuk Check Button :
on (release, keyPress "<Enter>") {if (answer.toLowerCase()== "nose") {respon="Correct! Good job.";
}else{
respon="Incorrect. Your answer " + answer + " is incorrect.";
}
}
Actionscript untuk Next Button :
on (release) {gotoAndPlay("Scene 2", 1);
}
5. Test movie
haha...i enjoy playing with this program...
ReplyDeletenice one...
for your question about the Big N and small n tu, well i guess one has to specify it at the actionscript...maybe u can have "if else" setting there...but tell you what, i'm not really good in that...
haha, maybe Ashikhin can lend a help here...i think she's good with programming...hehe...
but, i will try to search and do it first and i'll get back to you later ok...
Kreatif la u ni, mesti anak2 murid suka test latihan ni :)
ReplyDeleteTentang case sensitive problem tu, Syakira cuba add toLowerCase() kat sebelah answer dalam Actionscript setting tu.
Hope that helps ;)
yea, just check her blog...it is worth to drop by...
ReplyDeleteand Norzie you have just save my time...hehe
saya ada try n error guna if - else if - else statement..so far alhamdulillah jadi.TAPI coding terlalu panjang sbb kena letakkn beberapa condition.
ReplyDeletesaya tgh try coding lowercase n uppercase yang Norzie berikan.
Kalau success akan diberitahu kelak yer..
Doakn sama2.:)
Hurmm..xfaham & xdapat buat..
ReplyDeleteNorzie,ieja & kak shikhin, kat bahagian mana y nak add toLowerCase()?
ni actionscript saya..
on (release, keyPress "") {if (answer == "nose") {respon="Correct! Good job.";
}else{
respon="Incorrect. Your answer " + answer + " is incorrect.";
}
}
TQ..
do like this one:
ReplyDeleteon (release, keyPress "") {if (answer.toLowerCase()== "drives"){respon="Hooray! CORRECT!";
} else {
respon="Incorrect. Your answer " + answer + " is incorrect";
}
}
bole refer blog norzie utk pemahaman lanjut ok
ThanX a lot!!!
ReplyDelete