开发者

Actionscript- double click to select a word in a textfield?

Can someone tell me how I might enable double clicking to select a word in a inp开发者_如何学运维ut textfield?


It should do this by default if you are using a TextField with type TextFieldType.INPUT.


If Spencer's idea doesn't work you could do the following:

  1. Set doubleClickEnabled=true on the TextField.
  2. Add a listener for the DOUBLE_CLICK.
  3. When the listener fires, convert the event's (x,y) to a character index by using TextField.getCharIndexAtPoint.
  4. Search before and after that point for either a space or string end/begin and use those two values to set the selection index.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜