它看起來像一個TLF或SpellUIForTLF類的錯誤。在SpellUIForTLF類中有一個方法,叫做「doSpellingJob」。在此調用之後,您要在文本流中重新選擇選擇。
// From customized SpellUIForTLF.as class
public function doSpellingJob():void
{
if (_spellingEnabled == false) return;
hh.clearSquiggles();
for (var idx:int = 0; idx < mTextFlow.flowComposer.numControllers; idx++)
{
var testController:ContainerController = mTextFlow.flowComposer.getControllerAt(idx);
//if (getValidFirstWordIndexTLF(testController) != -1)
spellCheckRangeTLF(getValidFirstWordIndexTLF(testController), getValidLastWordIndexTLF(testController));
}
if (hasEventListener(Event.COMPLETE)) {
dispatchEvent(new Event(Event.COMPLETE));
}
if (keepFocusOnTextFlow && !calledSetFocusOnce) {
setFocusOnTextFlowContainer();
calledSetFocusOnce = true;
}
}
public function setFocusOnTextFlowContainer():void {
//trace("Setting focus on textflow");
var testController:ContainerController;
if (mTextFlow.flowComposer) {
if (mTextFlow.flowComposer.numControllers) {
testController = mTextFlow.flowComposer.getControllerAt(0);
}
}
FlexGlobals.topLevelApplication.stage.focus = null;
if (testController) {
FlexGlobals.topLevelApplication.stage.focus = testController.container;
}
if (mTextFlow.interactionManager) {
//mTextFlow.flowComposer.updateAllControllers();
mTextFlow.interactionManager.setFocus();
var selectionState:SelectionState = mTextFlow.interactionManager.getSelectionState();
//TextObject(currentObject).textFlow.interactionManager.clearSelection();
mTextFlow.interactionManager.selectRange(selectionState.anchorPosition, selectionState.activePosition);
}
}
/**
* Sets the focus on the first container controller on the first composition complete.
* This is to fix a bug in some situations where the delete and arrow keys do not
* work after spell checking has been enabled before the text flow composition
* has completed. Usually there is also a delay with editing the first time the dictionary loads.
* */
public static var keepFocusOnTextFlow:Boolean;
public static var calledSetFocusOnce:Boolean;
public function SpellUIForTLF(textModel:TextFlow, lang:String)
{
...
calledSetFocusOnce = false;
if (keepFocusOnTextFlow) {
setFocusOnTextFlowContainer();
}
...
}
您有任何問題嗎? – Brian
Naw。我喜歡在網上發佈隨機的東西。你知道海獺每英寸皮膚有超過一百萬根頭髮嗎?人類每英寸有大約100根頭髮。 –