This content has been marked as final. Show 2 replies
> Hello - I'm attempting to use the Flash Text Input component, but can't figure
> out how to get the text input! I see in the help files there's a event called
> "TextInput.enter" which is triggered when the user hits the enter key, but
> can't figure out how to work that event. I've been trying:
> on TextInput.trigger me
> put TextInput.text
> but that just gets me an error message on the TextInput.trigger item. I'm
> sure this is simple
It's /not/ simple - dealing with Flash Components rarely is! ;-)
The component is designed to broadcast an event named #enter when the
user presses the ENTER key, and an event named #change when the text
changes. In order to catch this event, one would usually attach a
behavior to the sprite with a handler name the same as the event name,
but in the case of 'enter' it's a reserved word and the script won't
-- behavior attached to TextInput component:
on change me
--on enter me
-- put sprite(me.spriteNum).text
My recommendation would be to use a regular #text member since you can
trap the ENTER key in a keyDown handler, but it depends on what you're
trying to achieve.
Thanks Sean - I think I get it now.
Its unfortunate these components are so incredibly undocumented and clunky to use. At first glance they look like such elegant solutions.
I think I'll stick to the tried-and-true regular text member as you suggest.
Director 11, Windows Vista Ultimate