A Flash Developer Resource Site

Results 1 to 1 of 1

Thread: validate text and submit the text on to a new field

  1. #1
    Junior Member
    Join Date
    Feb 2006
    Posts
    11

    validate text and submit the text on to a new frame

    Hi am having problem wiht my validation
    im tryin to validate a text, which does the action below:

    function validateMessage () {
    var arr = []; // create an empty array
    var msg = msg.text; // set var to the current text field

    arr = msg.split(" "); // split each word into our array

    if (arr.length > 10) { // if the array is longer than 10
    // return a value of false to var istrue
    } else { // if the array is less 10
    // return a value of true to var istrue
    }

    but if i try to use the on realse method which send the text on to new screen and i use GotoAndStop (frame) to send it to the next frame.

    I tried this bu t im getting problem, i can't seem to make the validation work correctly, it should only allow you to go through if you enter less then 10 words, if not it would send out and error message which is

    error_msg.text = "You've exceeded 10 words, Please Try Again"; // do something
    Last edited by vj21; 02-27-2006 at 12:53 PM.

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