# RollOver Events for TextField Links

**URL:** https://forum.kirupa.com/t/rollover-events-for-textfield-links/272888
**Category:** flash
**Created:** [October 9, 2008, 3:45am UTC](https://forum.kirupa.com/t/rollover-events-for-textfield-links/272888 "2008-10-09T03:45:21Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![dail](https://avatars.discourse-cdn.com/v4/letter/d/82dd89/32.png) [@dail](https://forum.kirupa.com/u/dail)
#### Post date: [October 9, 2008, 3:45am UTC](https://forum.kirupa.com/t/rollover-events-for-textfield-links/272888/1 "2008-10-09T03:45:21Z")

</div>

Hi,

So, I have this little job to run some events from rolling over http links in a textfield. Clicking is no big deal.

Anyway, I came up with this method, using the rectangles derived from getCharBoundaries to basically calculate a hitrect for each word.

```auto

var wordRect:Array = []
var tmpString:String = introTxt.text
			var strAr:Array = ["River Road", "Waikato River", "Hamilton City","Ngaruawahia"]
			
			var startRect:Rectangle
			var endRect:Rectangle
			
			for (var i:String in strAr) {
				startRect = introTxt.getCharBoundaries(tmpString.search(strAr*))
				endRect = introTxt.getCharBoundaries(tmpString.search(strAr*) + strAr*.length)
				wordRectArray.push([startRect.union(endRect),strAr*] )
			}
						
			trace(wordRectArray)

```

At the moment, it just pushes the rect and string in question into an array. I’m just gonna write a class that I’ll use instead of the array, which will handle dispatching back an event with the word and link’s url.

I dunno, is this the best approach to this problem. Am I missing something blindingly obvious about simulating rollOver events from text links?
