title: AS3: Getting the x & y value of a matched string in a text field
body: <p>I have a text field within Flash that contains a block of (obviously) text.</p>
  
  <p>What I want to do is perform a search on the content of the text field that returns the <code>x &amp; y</code> coordiante and the <code>width &amp; height</code> of the found text. The result will be used to place a visual element over that portion of the text box.</p>
  
  <p>For example:</p>
  
  <pre><code>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
       */
  }
  </code></pre>
  
  <p>Which visually should result in something like:</p>
  
  <p><img src="https://i.stack.imgur.com/TwbHC.jpg" alt="enter image description here"></p>