Apache flex 是否使用enter键查找上一个单词边界?
这段代码工作得很好,它得到了最后一个字,但当我使用enter键时 它的行为是错误的,并停止获得最后的话语权。当我注释findPreviousWordBoundary行时,它会得到所有文本:Apache flex 是否使用enter键查找上一个单词边界?,apache-flex,actionscript-3,Apache Flex,Actionscript 3,这段代码工作得很好,它得到了最后一个字,但当我使用enter键时 它的行为是错误的,并停止获得最后的话语权。当我注释findPreviousWordBoundary行时,它会得到所有文本: <fx:Script> <![CDATA[ import flashx.textLayout.elements.ParagraphElement; protected function togglebutton1_clickHandler(event:
<fx:Script>
<![CDATA[
import flashx.textLayout.elements.ParagraphElement;
protected function togglebutton1_clickHandler(event:MouseEvent):void {
var urlLoader:URLLoader = new URLLoader();
var suggestions:Array = new Array();
var suggested:Array = new Array();
var textfields:Array = new Array();
var format:TextFormat = new TextFormat();
var currentSelection:int = -1;
mytextflow.addEventListener(KeyboardEvent.KEY_UP, suggest);
function suggest(event:KeyboardEvent):void {
suggested = [];
var activePos:int = mytextflow.selectionActivePosition
var curParagraph:ParagraphElement =
mytextflow.textFlow.findLeaf(activePos).getParagraph();
var wordBoundary:int = curParagraph.
findPreviousWordBoundary(activePos);
//var lastword:String = curParagraph.getText(wordBoundary,activePos);
}
}
]]>
</fx:Script>
<s:ToggleButton x="21" y="10"
click="togglebutton1_clickHandler(event)"/>
<s:RichEditableText
id="mytextflow"
x="111"
y="43"
width="363"
height="285"
backgroundColor="#C39191"/>
</s:Application>
我不知道你想做什么。你能不能不要用翻译,找一个会说英语的人帮你把你的问题转换成一个合理的句子?