A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: With the input setting,

  1. #1
    Senior Member
    Join Date
    May 2004
    Posts
    627

    With the input setting,

    if I let the user input the name, can I avoid user input any symbol or the length of the name no more than 10 character in Flash?

  2. #2
    Senile member! :)
    Join Date
    Dec 2001
    Location
    Saunaswamp (transl)
    Posts
    2,296
    Code:
    name_txt.restrict = "a-z A-Z";
    name_txt.maxChars = 10;
    Where name_txt is the instancename of the textfield.

    /Mirandir

  3. #3
    Senior Member
    Join Date
    May 2004
    Posts
    627
    **Error** Scene=Scene 1, layer=Actions, frame=10:Line 2: Left side of assignment operator must be variable or property.
    if (inputName.restrict = "a-z A-Z" && inputName.maxChars = 10{

    Total ActionScript Errors: 1 Reported Errors: 1

    What happens? How do we do with "if" statement?

  4. #4
    Senior Member
    Join Date
    May 2004
    Posts
    627
    push

  5. #5
    Senile member! :)
    Join Date
    Dec 2001
    Location
    Saunaswamp (transl)
    Posts
    2,296
    You should write code as I presentedf it. You do not need to use an if-statement. thoose two lines of code will force the user to only use letters , no numbers or special chars, only letters. And a maximum 10 letters are allowed to be filled in.

    However that code will only allow a to z so if it is to be used with a certain language's special chars like å, ä and ö (swedish) they have to be added to the string.

    /Mirandir

  6. #6
    Senior Member
    Join Date
    May 2004
    Posts
    627
    But how can I present if the user do something wrong. I dont have to give him feedback to let him know?

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