PDA

View Full Version : dynamic input text


atomek
08-29-2001, 11:26 AM
hi

i would like to make dynamic search
so I:
1) put dynamic text input
2) convert it into movie clip
3) add onClipEvent(keyDown...)
4) keycode is passed to search function

few problems:
1) how to filter keystrokes and display in input area only those which are allowed ([A-Z][0-9]) ?
2) why it also catch all keystrokes (not only when someone is typing into input text) ?


--
atomek

Jesse
08-30-2001, 02:16 AM
I would have done it differently. best to keep your text field on the main stage, not in a movie clip for a variety of reasons.
keyDown is a global event, it has nothing to do with input text fields. it catches all key presses. if you want to look at the characters enterred into the field then you will need to perform operations on the field's variable.

in terms of limiting input data, it depends on how you're taking it. if you're wnating the user to enter a string into a text field and you only want alphanum characters then you'd have to make a checker which scanned the field for invalid chars and removed them. if you're not visually displaying the data, just logging the keypresses then it's easier as you can just ignore (not log) invalid characters.

we need more info on what you're doing basically before we can provide a solution.

atomek
08-31-2001, 08:44 AM
thx Jessie (I didn't know that keyDown is global event)

sorry if didn't express myself clear, I hope this link will explain something more:
http://www.retro.n1.pl/flash/

what are those reasons for keeping text field on the main stage not in movie clip ?

--
atomek

Jesse
08-31-2001, 09:59 AM
OK here's an example I made which only allows numbesr and caps to be typed into the field. Note the field is actually a dynmiac field, not and input field.
http://www.actionscripts.org/help/atomek/

heshrock
11-09-2001, 05:14 AM
jesse, could you possibly post the source to the example you made?

Jesse
11-09-2001, 06:13 AM
http://www.actionscripts.org/showMovie.php?id=302