Then again there is this:
package{
//imports
import fl.controls.TextArea;
import flash.text.TextField;
public class CustomTextArea extends TextArea{
//vars
private var internalTextField:TextField;
public function CustomTextArea(){
super();
internalTextField = TextField(this.textField);
}
public function set selectable(b:Boolean):void{
internalTextField.mouseEnabled = b;
this.editable = b;
}
public function get selectable():Boolean{
return internalTextField.mouseEnabled;
}
}
}
Example usage:
package{
//imports
import flash.display.MovieClip;
import CustomTextArea;
public class Application extends MovieClip{
//vars
private var customTA:CustomTextArea;
public function Application(){
init();
//addEventListener(KeyboardEvent.KEY_DOWN,
onUpArrow);
}
private function init():void{
customTA = new CustomTextArea();
addChild(customTA);
customTA.x = 0;
customTA.y = 0;
customTA.width = 150;
customTA.height = 90;
customTA.htmlText = "<font color='#0000FF'><b>Lorem
ipsum dolor sit amet,</b> consectetuer adipiscing elit.</font><font
color='#0000FF'><b>Lorem ipsum dolor sit amet,</b> consectetuer adipiscing
elit.</font><font color='#0000FF'><b>Lorem ipsum dolor sit amet,</b>
consectetuer adipiscing elit.</font><font color='#0000FF'><b>Lorem ipsum
dolor sit amet,</b> consectetuer adipiscing elit.</font>";
trace("customTA.selectable =",customTA.selectable);
customTA.selectable = false;
trace("customTA.selectable =",customTA.selectable);
}
}
}
HTH
Regards,
-Keith
http://keithreinfeld.home.comcast.net
> -----Original Message-----
> From: [email protected] [mailto:flashcoders-
> [email protected]] On Behalf Of [email protected]
> Sent: Saturday, March 28, 2009 3:53 PM
> To: Flash Coders List
> Subject: Re: [Flashcoders] ?: how to prevent users to copy text from
> aTextArea?
>
> maybe...
>
> hard way:
>
> on select - set clipboard with " " or something else...
>
>
>
>
> On Mar 28, 2009, at 9:14 PM, Keith Reinfeld wrote:
>
> >
> >> A simple solution is to put the textarea in a movieclip and set the
> >> movieclip to : mc.mouseChildren = false;
> >
> > That's not a bad idea, Cor. Unfortunately, it also disables the
> > scrollbar.
> > If the TextArea doesn't need to be scrolled, then fine. Otherwise I
> > think it
> > may be best to just use a TextField with a UIScrollBar.
> >
> > Regards,
> >
> > -Keith
> > http://keithreinfeld.home.comcast.net
> >
> >
> >
> > _______________________________________________
> > Flashcoders mailing list
> > [email protected]
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
>
>
> iashido.com
> itseveryday.ro
>
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders