I l @ ve RuBoard



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.


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.


What happens if an input text area allows the user to type many characters , but the size of the input text area is small?


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.


What sort of error checking can Flash do to form input?


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.


Is there any way to get a substring of a string counting from the end of the string?


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.

I l @ ve RuBoard

Sams Teach Yourself Flash MX ActionScript in 24 Hours
Sams Teach Yourself Flash MX ActionScript in 24 Hours
ISBN: 0672323850
EAN: 2147483647
Year: 2002
Pages: 272 © 2008-2017.
If you may any questions please contact us: