Out of curiosity, what is the use case to disable selection of text?  Can you just you disabled=false, or do you want people to still type in it?  Here is a working example of the code you need though J  I believe the problem with your component was you were not calling the super.createChildren() first so the textField was not created yet when you were trying to modify it’s properties.  One weird thing I noticed with this approach though is your caret is gone , but otherwise works fine.  Something else too, you should always use a default constructor and call the super() method when extending components.  This may also have been the problem, but I didn’t test enough to verify which one was the culprit. 

 

package com.lsf.common.view.controls

{

            import mx.controls.TextArea;

 

            public class NonSelectableTextArea extends TextArea

            {

                        public function NonSelectableTextArea() : void {

                                    super();

                        }

                       

                        override protected function createChildren() : void {

                                    super.createChildren();

                                    super.textField.selectable = false;

                        }

            }

}

 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of jpc14_99
Sent: Tuesday, July 25, 2006 4:37 PM
To: [email protected]
Subject: [flexcoders] Re: has anyone ever disabled selectability for a textArea??

 

Thanks for all the help. I have it recognizing my class just fine
now. Unfortunately I'm getting this error:

Attempted access of inaccessible property textField through a
reference with static type...

So the class I'm using (below) isn't quite cutting it. Any ideas for
changes?

----------------------

package
{
import mx.controls.TextArea;

public class myTextArea extends TextArea
{
protected override function createChildren():void {
textField.selectable = false;
super.createChildren();
}
}
}

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to