Flash Question
Date: 03/26/07
(Web Development) Keywords: no keywords
I’ve made a simple drag and drop interactive quiz in flash, it all works fine but I want to improve it in terms of error handling.
Basically the user drops one of three choices onto the target and presses a ‘submit’ button. The text ‘correct’ or ‘incorrect’ is then displayed in a dynamic text box.
What I would like to add on is a way of handling the possibilities that
a) the user presses ‘submit’ without having placed a choice on the target
and b) the user may have put more than one choice on the target and pressed submit
More info
The way the text is set up is that there are two boxes, one (off stage) automatically displays the ‘incorrect’ ‘correct’ when the user drags and drops their choice onto the drop target. When the submit button is pressed this result is retrieved and presented to the user (on stage) so they can see whether they were right or wrong.
So this is the code on the ‘submit’ button
on (release) {
output2 = output1;
}
I’m guessing that I need to add something to this to handle the eventuality of the user pressing the submit button without first making their choice?
I’m a bit at a loss for the second part. I’m thinking I should attach the code to the submit button, it needs to be able to detect if there is more than one movie clip placed on the droptarget, and if this is the case, display an error message .
Any help much appreciated!
If I haven’t explained anything clearly enough please let me know and I’ll try and do a bit better.
Source: http://community.livejournal.com/webdev/398030.html