> Consider using XPath, as in this example:
>
>       http://www.majordan.net/test/flashlinks/

Geez that's a shload of class files in that Zip file! [grin] I'm going to
explore XPath a little more when I free up some time.

I really appreciate everyone's willingness to help me out.

Let me outline what I ended up doing. I'm still refining things for
efficiency and re-purposability, but...

1. Tokenize the text field htmlText, creating an array whose elements are
either complete tags, or the extracted content that falls between (or
before or after) them. Obs: There is obviously quite a bit to this that I
left out for brevity.

2. Capture the hyperlink click location in the text field using
Selection.getCaretIndex(). Obs: The "selectable" property of the text
field must already be set to "true" at click time.

3. Cycle through the token array, concatenating non mark-up elements to a
string, whose length is compared (each time) to the caret position.

4. When the string length exceeds/equals the caret position, I have my
hyperlink content.

This presumes a couple of things about the HTML, and there are a few
things I also had to do in order to guarantee the correct text (necessary
to compensate for quirks in the Flash TextField hyperlink mechanism), but
that sums it up.

Thanks again.


-
pixelTwiddler, a.k.a. Jason

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to