1

I've read this Q&A: Change TextField selection color in AS3

But I don't understand the part using TextFlow, I tried this:

import flashx.textLayout.elements.TextFlow;
import flashx.textLayout.edit.SelectionFormat;

TextFlow.defaultConfiguration.focusedSelectionFormat = new SelectionFormat(0xDC4713);

But my TLF didn't seemed to have changed it's highlight color, what is the proper way to use this code or is there a way to change the highlight color in all the textfields in your flash?

4

1 回答 1

0

如果您使用的是 TLF 文本,您应该使用类似这样的内容。

var fSelFmt:ISelectionManager = textFlow.interactionManager;
fSelFmt.focusedSelectionFormat = new SelectionFormat(0x000000, 1.0, BlendMode.INVERT);
fSelFmt.inactiveSelectionFormat = new SelectionFormat(0x00FF00, 1.0, BlendMode.OVERLAY);
fSelFmt.focusedSelectionFormat = new SelectionFormat(0x00FFFF, 1.0, BlendMode.HARDLIGHT);
textFlow.interactionManager = fSelFmt;
于 2013-07-15T17:06:44.190 回答