• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Q&A

Q1:Why, if I use a button or listener, can I hold down a key and the button or listener will continue to react to the key press? I thought only the Key.isDown method could do that.
A1: Buttons and listeners react to only one key press at a time. However, if you hold down a key on the keyboard, your operating system will automatically repeat that key press over and over again. This is an old-fashioned typewriter repeat function. You can see it if you open a word processor and press and hold down “a.” The “a” will type, followed by a delay, followed by a lot of “a's” very quickly. You can adjust this or turn it off in the operating system control panels. Most users will have it turned on by default, but you shouldn't rely on using it for functionality in your movie.
Q2:What happens if an input text area allows the user to type many characters, but the size of the input text area is small?
A2: Give it a try. You'll see that the text inside the input text area scrolls from side to side as the user types in it or uses the Backspace or arrow keys. This makes it easy for the user to type a lot of text in a small space.
Q3:What sort of error checking can Flash do to form input?
A3: Just about anything. For instance, if the user is supposed to enter an e-mail address, you can use indexOf to check for the presence of a the “@” and “.” symbols. If they are not present, you know right away that the e-mail address is wrong.
Q4:Is there any way to get a substring of a string counting from the end of the string?
A4: You can use substr with a negative number as the first parameter. For instance, myString.substr(-7,3) returns three characters starting seven characters from the end.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint