I can't next to frame
Hello i'm new in Adobe Animate , I wanna make a quiz multiple choice , I want my quizzes to be random when they start and when they repeat. So I try to make the question randomly
I'm use 3 frame
1. Button Start
2. Frame with Movie Clip (There is , Dynamic Text and Answer Button)
3. Dynamic Text for Score and Repeat Button
when i'm insert the code in frame 1 to next to frame 2 (A movie clip) it's not working
here the code :
//variabel global
var data = [{
pertanyaan_text: "1+1",
jawaban: "2",
jawabann: ["1", "3", "2"]
}, {
pertanyaan_text: "Berapa Jumlah hari dalam Seminggu",
jawaban: "1",
jawabann: ["5", "7", "8"]
}, {
pertanyaan_text: "Bumi Merupakan Planet Ke-",
jawaban: "0",
jawabann: ["4", "5", "8"]
}, ];
var indexPertanyaan = 0;
var currentPertanyaan;
this.bt_quis.addEventListener(MouseEvent.CLICK, function(){
//Sembunyikan tombol mulai, tampilkan movie clip pertanyaan
consol.log("Button Clicked");
btn_quis.visible = false;
mc_kuis.visible = true;
//load the first question
loadPertanyaan();
});mc_kuis is the instance name for the movie clip in frame 2
loadPertanyaan is the function tu load the question to dynamic text in Movie Clip in frame 2
In frame 2 here the code I use :
function loadPertanyaan(){
//Acak Soal
data= mixed(data);
//Ambil soal pertama yang baru
currentPertanyaan = data[indexPertanyaan];
//Tampilkan pertanyaan
mc_kuis.txt_Pertanyaan.text = currentPertanyaan.pertanyaan_text;
}
I've to use consol.log() at the button bt_quis but it's not working
and I wanted to ask if it's possible to take a global variable in frame 1 to use in frame 2.?
Thanks for the help
