dimanche 4 septembre 2016

Coverting codes into Array but same output

i am currently makin a identification quiz using as3, i have a codes here that are actuallyworking through buttons, i just want to ask if its possible to convert my code to array statement but ended up with same output? i really like to make my code an array coz its really flexible, thanks guys

   var answer:String = answer.text.toLowerCase();
   if (answer == "allan joshua mccartney" || answer =="mccartney" 
   || answer == "allan" || answer =="joshua" || answer == "joshua mccartney" || answer =="allan joshua" || answer == "allan mccartney") {
score = score +1;
gotoAndStop(2);

as you can see my codes is working but it takes really really long codes to finish a single identifcation quiz bcoz there is so many possible answer, i heard that array is the best way to deal with this bunch of possible answers. thans guys

Aucun commentaire:

Enregistrer un commentaire