# drawRect function for Right and Wrong answers

**URL:** <https://forum.kirupa.com/t/drawrect-function-for-right-and-wrong-answers/331395>\
**Category:** flash\
**Created:** [July 23, 2013, 1:51pm UTC](https://forum.kirupa.com/t/drawrect-function-for-right-and-wrong-answers/331395 "2013-07-23T13:51:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![haponing](https://avatars.discourse-cdn.com/v4/letter/h/7bcc69/32.png) [@haponing](https://forum.kirupa.com/u/haponing)\
**Post date:** [July 23, 2013, 1:51pm UTC](https://forum.kirupa.com/t/drawrect-function-for-right-and-wrong-answers/331395/1 "2013-07-23T13:51:26Z")

</div>

Need help please. I’m doing a practice test using flash cs3 radio button group with data from .xml file.

I need a drawRect function that will highlight (draw rectangle with fill) the user answer if it’s right or wrong; red color - wrong and green color - right. And will show the correct answer (highlighted in green) if the user answer is wrong.

I have the check button to listen to the event click.  
btnCheck.addEventListener(MouseEvent.CLICK, chkAnswer);

but I don’t know how to write the function for drawRect. Please help
