【发布时间】:2011-10-04 04:51:13
【问题描述】:
我在 Flash 中有一个文本字段,其中包含(显然)文本块。
我想要做的是对返回找到文本的x & y 坐标和width & height 的文本字段的内容执行搜索。结果将用于在文本框的该部分上放置一个可视元素。
例如:
var pattern:RegExp = /\d+/g;
var found:Array = box.text.match(pattern);
var i:String;
for each(i in found)
{
/**
* Find the x, y, width, height of the matched text in the text field
* Use result to place transparent yellow box around text
*/
}
这在视觉上应该会产生类似的结果:
【问题讨论】:
-
有趣的问题,我一直想知道这是怎么做到的!
标签: regex flash actionscript-3 textfield