A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: input text question

  1. #1
    Junior Member
    Join Date
    Jun 2001
    Posts
    1
    I want to know how i Can have the user enter the words Mr. Nelson and then follow it with anything, to access a random site. The problem isn't the random site part but instead the Mr. Nelson followed by anything part.
    Thank you for your help
    Jeremy

  2. #2
    Banned-ed-er-ing WMLeeBo's Avatar
    Join Date
    Mar 2001
    Posts
    1,482
    please explain this problem more or differently

  3. #3
    curmudgeon swampy's Avatar
    Join Date
    Jan 2001
    Location
    [wakey]
    Posts
    2,775
    Ok wjhat I think you mean is that someone can put anything in a text input box , but only gain access if they input "Mr. Nelson" as the first part .

    so "Mr. Nelson lives here" would get them access as would "Mr. Nelson is a fool" ??

    call your input text box inputand put this code on a button:

    Code:
    on (press) {
    selection=input.substring( 0, 10 )
    password="Mr. Nelson"
    
    if (selection== password) {
    
    trace("hello Mr. Nelson")
    
    }else {
    trace("No way hose")
    }
    }
    the selection variable is defined as the input box input characters from 0 to 10 the password variable is defined as Mr. Nelson.

    the if statement checks whether the selection matches the password and traces an output of "hello Mr. Nelson" i fthe user gets it right and "no way hose" if they get it wrong.

    this code will only allow the exact string "Mr. Nelson" entry

    i.e. mr. nelson , MR.NELSON etc would not gain people access





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