# Clean up this code!

**URL:** <https://forum.kirupa.com/t/clean-up-this-code/41055>\
**Category:** flash\
**Created:** [January 25, 2004, 7:38am UTC](https://forum.kirupa.com/t/clean-up-this-code/41055 "2004-01-25T07:38:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kill\_robot\_kill](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kill_robot_kill/32/359_2.png) [@kill\_robot\_kill](https://forum.kirupa.com/u/kill_robot_kill)\
**Post date:** [January 25, 2004, 7:38am UTC](https://forum.kirupa.com/t/clean-up-this-code/41055/1 "2004-01-25T07:38:32Z")

</div>

there HAS got to be a better way to write this out.  
Any help would be greatly appreciated. This script will be duplicated  
in different MC’s containing a different number of "varCheck"s  
and different true/false values to check against.

[AS]btnSubmit.onRelease = function() {  
if (this.\_parent.varCheck0 && !this.\_parent.varCheck1 && this.\_parent.varCheck2 && !this.\_parent.varCheck3 && this.\_parent.varCheck4 && this.\_parent.varCheck5 && !this.\_parent.varCheck6 && this.\_parent.varCheck7) {  
strHeadline = “Great Job!”;  
strFeedback = “You got them all right! Let’s go on to the next one”;  
nextFrame();   
} else {  
strHeadline = “Sorry”;  
strFeedback = “You got one wrong, let’s try this again”;  
nextFrame();   
}  
};[/AS]
