A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: try 3 times again...

  1. #1
    Member
    Join Date
    Aug 2008
    Posts
    33

    try 3 times again...

    hi...i am doing fill-in-blank fields....the user is given 3 times to fill up the field correctly. When the user answers the question wrongly for the 1st time, he is given 2 times to try again...

    How do I script it?

    Code:
    on (release) {
    	 if (inputTxt01.text == "") {
            inputTxt01.text = "Required!";
        } else if (inputTxt01.text>" ", inputTxt01.text != "Required!") {
            gotoAndStop(2);
        }
    
    }

  2. #2
    Senior Member
    Join Date
    Jun 2008
    Posts
    549
    Try this.

    Code:
    var num_of_tries:Number = 0;
    
    on (release) {
    	num_of_tries++;
    	if (inputTxt01.text == "") {
            inputTxt01.text = "Required!";
    	if(num_of_tries == 3){
    		//Your code here.
    	}
    
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center