PDA

View Full Version : textArea, make not editable?....


Wildmac
05-02-2004, 02:13 AM
I am using a textArea for it scrolling capabilities, and I would like to make it not editable, or actually, really just not have the cursor change to the I-bar when the mouse rollls over it.

Is this a setting buried someplace?....

annexion
05-02-2004, 02:19 PM
textArea.editable=false;

?

Wildmac
05-03-2004, 03:07 AM
Nope, that didn't do it, I tried variations thereof, and you can still select the text.

Any other ideas folks?...

killGerald.com
05-03-2004, 03:39 AM
textArea.selectable = false;

might work. the textArea component is a wrapped textField, so I'm guessing it'd inherit the .selectable... give it a shot - lemme know how it works out...

-Gerald.

annexion
05-03-2004, 09:10 AM
I misunderstood the last part of the question. My apologies.

Wildmac
05-03-2004, 10:24 PM
Didn't work.....

here's my script for the text area.....

//init TextArea component
headBrainText.html=true;
headBrainText.wordWrap=true;
headBrainText.multiline=true;
headBrainText.selectable=false;
headBrainText.setStyle("backgroundColor", "0x555539");
headBrainText.setStyle("borderStyle", "none");

/******************************/
//load css
csmcFlashStyle = new TextField.StyleSheet();
csmcFlashStyle.load("CSMCflash.css");
headBrainText.styleSheet = csmcFlashStyle;

/******************************/
//load in XML
headBrainContent = new XML();
headBrainContent.ignoreWhite = true;
headBrainContent.load("headBrain.xml");
headBrainContent.onLoad = function(success)
{
if(success)
{
headBrainText.text = headBrainContent;
}
}

Wildmac
05-03-2004, 10:32 PM
Again, the reason I want to do this is that I have linked text in the text, and as the user moves the cursor over the text, the hand shows up over the links, but it basically dissapears when someplace else in the text area, which will confuse some people.

Cyanide
05-03-2004, 11:23 PM
I don't believe there is a property of the TextArea component that allows what you want it to do. This is a draw back of these pre-built components, they are rather limited in their functionality. It may be worth it for you to create your own text fields with scrol bars. It's really not that difficult to create something that does exactly what the textArea component does, and more. If you made your own text fields you could then use TextField.selectable = false to get rid of the I-bar.

farafiro
05-04-2004, 03:24 AM
hey Wildmac
it's just as annexion's saidTextarea.editable = false
or u r using the Textinput component??

Wildmac
05-04-2004, 12:01 PM
hmm.... sounds like I have to go back and re-build the text areas by hand. I did try setting editable and selectable to false, and neither works.

What I really liked was having the scroll-bars show automatically if they were needed. (I am anticipating the external xml or html files being updated. So I may not know the final length.)

It appears I'll just have to have persistent scrollbars.

Cyanide
05-04-2004, 06:23 PM
You can make a scroll bar appear and disappear depending on weather it's needed or not. You just use the textField.maxscroll property. If it's greater than 1 then you make your scroll bar visible.

farafiro
05-05-2004, 05:50 AM
there was a tut somewhere for this
lemme see see and will post a link as i find it

Wildmac
05-05-2004, 11:28 AM
I really want to turn off the "i-beam" that is showing when the text is rolled-over. The cursor basically dissapearing is going to confuse some folks, so if this can't be done with the textArea, then I'll have to do it by hand....

DatabaseMX
05-11-2004, 02:18 AM
TextAreaInstanceName.label.selectable=false;

'label' is an un-documented property of the TextArea V2 component. Why this works ... don't really know, but I've personally tested this .. and it works ... most of the time ... meaning occasionally ... when you click into a TextArea with this set as above ... some of the text will randomly become highlighted (and selectable). Once you click into some other object that can receive focus ... then the TextArea will become un-selectable ... usually!
Bottom line ... it's not quite 100 %. I did see a reference to the un-documented label property buried in a livedoc.macromedia.com article ...although, it did not give this example. I found this somewhere else.

Also .. this is not to be confused with 'editable' ... which is a property of the TextArea ... and seems to work.

joe

303 maddec
06-08-2004, 10:59 AM
Thanx a million man it helped me a lot!!!

Well flash is becoming more and more like a mario game with warp zones and secret treasures ;)

The question is why? To promote MM certifications ?
Or because these features aren't stable enough? Who knows ;)

Best regards.

farafiro
06-09-2004, 01:59 AM
thanks for the info DatabaseMX
;)

Sarah012
06-11-2004, 04:52 PM
Using the suggestion on this post:

TextAreaInstanceName.label.selectable=false;

I was able to get rid of the selection bar in my TextAreas, but now I have another problem.

I have a series of frames with questions that load in the TextAreas. There are next buttons to go from one question to the next. My problem is that sometimes (seemingly randomly) I will click the next button and my cursor will turn into a selection bar and then I can't click the button again I until I move the mouse. If I move the mouse then the "hand" will come back. This gets really annoying when trying to click through the questions quickly.

Anybody have a solution to this problem?

303 maddec
06-11-2004, 05:11 PM
Well I don't know about the cursor thing,becoming back to |.

Don't forget that databaseMx claimed that they are few "bugs" in using this method (maybe the reason why MM did'nt make it official).

I for myself experienced the one he mentionned. Sometimes the text becomes entirely selected. ( workaround could be to add on the scrollbar button a setSelection (0,0)...).

Moreover, you should be aware of focus things.

I experienced that when the button you're using is not a component, but for example a MC (and you are using somewhere else a compoenent for example a text area), you should tell flash to set focus to the button, if not; you could only press once on the button, after you need to rollOut and one more time over to reinitialize the button....

You should maybe use an array instead of frame. It could maybe avoid your "bug".

Maybe it's what you experienced?

I hope this will help.

Best regards.