Показать сообщение отдельно
Старый 20.05.2013, 18:58
Idon'tKnow вне форума Посмотреть профиль Отправить личное сообщение для Idon'tKnow Найти все сообщения от Idon'tKnow
  № 16  
Ответить с цитированием
Idon'tKnow

Регистрация: Apr 2013
Сообщений: 77
Не уверен, но вроде как что-то типа такого должно быть:

Код AS3:
if(question_id == LANG.excercise.length -1) {
trace('end test');
return Math.floor( Math.random() * LANG.excercise.length)) ;
}
А вообще, если Вы вот этот код используете.

Код AS3:
function nextAnswer(event:MouseEvent) : void {
 if(question_id == myList.excercise.length()) {
    trace('end test');
    return;
 }       
 if (answerTxt.text == myList.excercise[question_id].answer) {
    question_id++;
    questionTxt.text = myList.excercise[question_id].question;
 }
}
То вот как должно быть, вроде.

Код AS3:
function nextAnswer(event:MouseEvent) : void {
 if(question_id == myList.excercise.length -1) {
    trace('end test');
    return;
     }  
question_id = Math.floor( Math.random() * myList.excercise.length);
 if (answerTxt.text == myList.excercise[question_id].answer) {
    question_id++;
     }
    questionTxt.text = myList.excercise[question_id].question;
}