Hi guys
I’m creating a simple quiz which has 3 questions. Each question has an input text field next to it for the user to type their answer. There is also one submit button underneath the 3 questions.
What I’m needing is some actionscript so they can only progress to the next frame by clicking the submit button once ALL 3 text fields have text in it. It doesn’t have to detect any specific text, just that there is something put into each one. If there hasn’t been, then it’ll pop up with text asking them to complete all the questions first.
ActionScript Code:
[LEFT]submit.[COLOR=#993300]onRelease[/COLOR] = [COLOR=#993300]function[/COLOR]COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR] [COLOR=#993300]if[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#000000]([/COLOR]theanswer.[COLOR=#993300]text[/COLOR] == [COLOR=#0000FF]""[/COLOR] || theanswer.[COLOR=#993300]text[/COLOR] == [COLOR=#993300]undefined[/COLOR][COLOR=#000000])[/COLOR] && [COLOR=#000000]([/COLOR]theanswer2.[COLOR=#993300]text[/COLOR] == [COLOR=#0000FF]""[/COLOR] || theanswer2.[COLOR=#993300]text[/COLOR] == [COLOR=#993300]undefined[/COLOR][COLOR=#000000])[/COLOR] && [COLOR=#000000]([/COLOR]theanswer3.[COLOR=#993300]text[/COLOR] == [COLOR=#0000FF]""[/COLOR] || theanswer3.[COLOR=#993300]text[/COLOR] == [COLOR=#993300]undefined[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR] answer_txt.[COLOR=#993300]text[/COLOR] = [COLOR=#0000FF]“Please answer all questions”[/COLOR]; [COLOR=#000000]}[/COLOR] [COLOR=#993300]else[/COLOR] [COLOR=#000000]{[/COLOR] [COLOR=#993300]gotoAndStop[/COLOR]COLOR=#000000[/COLOR]; [COLOR=#000000]}[/COLOR] [COLOR=#000000]}[/COLOR]
[/LEFT]
Any help would be greatly appreciate. Thanks