View Full Version : TextArea component - Disallow copy and paste

03-13-2007, 03:07 PM

How can I disable the possibility of selecting text on a TextArea component?

I have tried...
myTextArea.selectable = false;

myTextArea.editable= false;

myTextArea.enabled= false;

...this last one does it, but it also disable the scrolling bar which I want to be able to use.


03-15-2007, 12:44 AM
I found the answer for you on this page:

Here's what works:

myText.label.selectable = false;

substitute the name of your TextArea component for "myText"

03-22-2007, 10:06 AM
Hello and thanks for your reply.

Unfortunately this won't work for me since the property "selectable" is part of the TextField class and not for the TextInput class, which is the one I am using.

The TextInput class has a similar property, "enabled". Unfortunately by doing...
myTextInput.enabled = false;...sets the entire component on a disable state, meaning that the text will appear with a grey colour, I could change that appearance by changing back its colour to black using...
myTextInput.setStyle("disabledColor", 0x000000);...but I still have a problem with its scrollBar which remains disable.

Do you guys know how to act over the TextInput's scrollBar so I override its state to enabled? How can I get a reference to that scrollBar?


03-22-2007, 10:24 AM
Hi Mazoonist.

I didn't read your solution properly, I missed that "label" part.

Your solution works.

Also, investigating the TextInput component I found out that this works as well...
myTextArea.focusTextField.selectable = false;
Thanks for your help.