如何访问 Flex TextInput 控件中的选定文本 [英] How to access the selected text in a Flex TextInput control
本文介绍了如何访问 Flex TextInput 控件中的选定文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用的是 Flashbuilder 4.我有一个 Spark TextInput 控件,我正在实现一个复制"按钮,该按钮只会将所选文本从该控件中复制到剪贴板(与 RMB Copy 非常相似).我该怎么做?
I'm using Flashbuilder 4. I have a Spark TextInput control, and I'm implementing a "Copy" button that will copy the selected text only from within this control to the clipboard (pretty much like the RMB Copy does). How do I do this?
谢谢,
稻田
推荐答案
试试这个:
var beginIndex:int = Math.min(myTextInput.textDisplay.selectionActivePosition, myTextInput.textDisplay. selectionAnchorPosition);
var endIndex:int = Math.max(myTextInput.textDisplay.selectionActivePosition, myTextInput.textDisplay. selectionAnchorPosition);
这篇关于如何访问 Flex TextInput 控件中的选定文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文