# Stop at last question

**URL:** <https://forum.kirupa.com/t/stop-at-last-question/290204>\
**Category:** flash\
**Created:** [June 11, 2009, 8:04am UTC](https://forum.kirupa.com/t/stop-at-last-question/290204 "2009-06-11T08:04:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dilpreet](https://avatars.discourse-cdn.com/v4/letter/d/51bf81/32.png) [@dilpreet](https://forum.kirupa.com/u/dilpreet)\
**Post date:** [June 11, 2009, 8:04am UTC](https://forum.kirupa.com/t/stop-at-last-question/290204/1 "2009-06-11T08:04:10Z")

</div>

Hello

I have a multiple choice quiz and i want it to stop on the last question. Can you please help  
here is my code -

numExamples is the length of the array

this what my next button

var index:int = 0;

btnNext.addEventListener(MouseEvent.CLICK, goNext);  
function goNext(mevt:MouseEvent):void {  
index++;  
if (index \> (numExamples - 1)) {  
index = 0;  
}  
setup();  
}

And the setup function basically makes the the radiobuttons according to the answers
