Good morning.

I came up with a solution, it's not elegant but it works:


1) Break up the HTML into an array of chunks of code based on where the
links occour.  So this:

     [p]Lorem ipsum [a href="event:block1"]dolor sit[/a] amet.[/p]

Gets turned into this:

     blocks[0] = [p]Lorem ipsum 
     blocks[0] = [a href="event:block1"]dolor sit[/a]
     blocks[0] =  amet.[/p]

2) Go through that array of chunks, concatenating each chunk with the chunks
before it and plugging the results into the TextField.  Force it to render
(validateNow();) each time and use the previous and current "length" of the
"text" property to determine the beginning and ending indices of each chunk.

3) For any chunks containing a link, save the link's URL and indices into an
array.  ie:

     link_props[0] = {name:block1, begin:12, end:21}

4) When a link is clicked use the "text" property of the TextEvent.LINK
event to get at the indices for that link in the array.


Thank you for helping. :)


 ------------------------------
Andrew Murphy
Interactive Media Developer
[email protected]

Delvinia
370 King Street West, 5th Floor, Box 4 
Toronto Canada M5V 1J9
P (416) 364-1455 ext. 232
F (416) 364-9830  
W www.delvinia.com

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to