1 person found this helpful
Although those events are not really dispatched by the TextArea component, I'm quite sure you can catch them somehow ( maybe by extending the component or building something similar ). For more information read here: http://livedocs.adobe.com/flex/3/langref/mx/controls/TextArea.html I didn't play around with this myself but I'm confident it can be done.
For TextField objects, selecting these commands
(or their keyboard equivalents) does not generate
selectAllevents. However, other classes that extend the InteractiveObject class, including components built
using the Flash Text Engine (FTE), can dispatch these events.
So yeah, it's possible just that you might need to rethink your approach.
Yeah, it looks like I'd pretty much have to build my own TextArea if I want to go that way. That may be what I have to do eventually, but I think I can also just fake it by translating the TextArea's change event into a cut, paste, delete, etc. based on context. Right now I'm using the TextInput event to tell me whether I've received input and based on that I use the key pressed and whether text is selected to determine a cut, delete, backspace, replace or insert. It seems to be working for now, but I'm not sure I can depend on the TextInput event to always come before the Change event.
Anyway, thanks for the help. I'm glad it wasn't just that I didn't know how to add a handler to the TextArea.
I wasn't looking for this particular problem, but while tracking down a problem with the Change event on TextArea I found I could handle TextInput on TextArea. Text input responds to paste events into the TA. YMMV.
There's a lot of helpful info out there, just google "Flex highlight textarea component". For example, I came across this post: http://flexbuzz.blogspot.com/2009/07/flex-textarea-track-changes-highlight.html
Might be just what you need.
Is there any code for implement cut copy paste with the help of button on text area. The right-click cut copy paste is working fine but in application i want to add this functionality through the buttons. So could you resolve this problem?
This is a different question than what was originally posted, so it should be a separate discussion. It's easy though, since you can use the System.setClipboard() method. Here's a post that should get you going. http://blog.flexexamples.com/2008/01/30/copying-text-to-the-operating-system-clipboard-in- flex/