• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

TLF Highlighting and missing lines when scrolling.

New Here ,
Oct 22, 2010 Oct 22, 2010

Copy link to clipboard

Copied

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

TOPICS
Text layout framework

Views

1.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Oct 25, 2010 Oct 25, 2010

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 26, 2010 Oct 26, 2010

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 30, 2011 May 30, 2011

Copy link to clipboard

Copied

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

Is there any solution??

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
May 30, 2011 May 30, 2011

Copy link to clipboard

Copied

LATEST

It's a pretty old discussion that I didn't dive in at that time. So can you please try the new flex SDK? If it can still be reproduced, feel free to let me know. Thanks!

PS:

please download newest sdk in http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4.5

In  {sdk basedir}/frameworks/rsls, there is textLayout_2.0.0.xxx.swf which  is the runtime shared library of tlf and shows tlf's detailed version.

In  {sdk basedir}/frameworks/libs, textLayout.swc is also tlf library which  is used when the project is compiled with merge-into-code  configuration(default).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines