Skip to main content
Participant
October 22, 2010
Question

TLF Highlighting and missing lines when scrolling.

  • October 22, 2010
  • 1 reply
  • 1585 views

I have a TLF (tried it both in a canvas, and by using s:TextArea) that I want to display a document in with different words/areas highlighted.

I do the highlighting via a selection and edit manager:

var ss:SelectionState = new SelectionState(tf, myStart, myEnd);
editManager.applyLeafFormat(textLayoutFormat, ss);

This works great, and highlights as I want, however when I scroll the text area, any lines that have a highlight in them suddenly dissappear! If I scroll back to the start, they re-appear.

Any ideas? Am I going about applying highlghts the correct way? I am not doing anything on the textarea scroll event. Do I need to be?

Very odd behavior.

-Ryan

This topic has been closed for replies.

1 reply

Adobe Employee
October 26, 2010

Are you trying to have the same TextFlow appear in multiple places with different highlighting? If so, the best way to do that would be to copy the TextFlow so there is a unique version in each different Flex component that is using it. You can do that by calling deepCopy:

var duplicateFlow:TextFlow = textFlow.deepCopy();

I may have misunderstood your problem. If so, can you restate it and tell me what version of Flex and/or TLF you are using?

Thanks,

- robin

Participant
October 26, 2010

To clarify a bit. I have spent the last several days doing extensive testing and trying many, many different things.

What I have found is this:

If I have a spark text area, and make changes to the text flow for highlighting and formatting, when scrolling, lines that have a background color in as a highlight dissappear (even though I am only highlighting 1 word in the line). I tried making the textformat changes using ApplyFormatOperation, as well as edit manager to see if that made a difference. It didn't.

The only successful work around I have found is to change the text color and size, but NOT highlight (change the background color). Changing the background color causes the lines to dissappear when scrolling, but if I don't apply that, it works properly.

I am using standard Flashbuilder 4 with the 4.1 SDK. I tried changing to the current TLF posted here, but it did not fix the issue, so I am back to standard 4.1 SDK. And no, there is only one text area with one text layout, I am not trying to use the same TextFlow in multiple places.

-Ryan

May 30, 2011

I have exatly the same problem. Its easy to reproduce.

Is there any solution??