如何在Flex TextInput控件中访问选定的文本 [英] How to access the selected text in a Flex TextInput control

查看:89
本文介绍了如何在Flex TextInput控件中访问选定的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Flashbuilder4.我有一个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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆