so whats your solution? On Tue, Aug 31, 2010 at 9:42 AM, Andrew Murphy <[email protected]> wrote:
> Thank you, but I came up with a solution. :) > > ------------------------------ > 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 > > > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf Of Karim > Beyrouti > Sent: August 31, 2010 05:37 am > To: Flash Coders List > Subject: Re: [Flashcoders] Link text indexes in a TextField > > > I have textfield link detection in this class - > > > > https://code.google.com/p/kurstcode/source/browse/trunk/libs/com/kurst/utils > /TextFieldUtils.as > > using it for link roll-over / roll-out events. And I think it could be > extended to get the link's start/end position. > Have a look at the 'detectMouseOver' function - could be a good starting > point... > > - karim > > On 30 Aug 2010, at 19:47, Andrew Murphy wrote: > > > Hello. :) > > > > Thank you, but I think that will give me the link's text from within the > > "htmlText" property of the TextField. > > > > > > What I need are the beginning and ending indexes of the link within the > > "text" property of the TextField. That is, after the HTML has been > rendered > > into the displayed text. > > > > I've thought of finding the index of the TextEvent's "text" property (ie: > > "block1") within the "htmlText" property of the TextField and using that > to > > determine the indexes, but those indexes would be relative to the > > TextField's "htmlText" property, rather than it's "text" property. > > > > > > > > ------------------------------ > > 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 > > > > > > -----Original Message----- > > From: [email protected] > > [mailto:[email protected]] On Behalf Of Nathan > > Mynarcik > > Sent: August 30, 2010 14:35 pm > > To: Flash Coders List > > Subject: Re: [Flashcoders] Link text indexes in a TextField > > > > You will have to cull out what you want: > > > > **Psuedo Code** > > > > var stuff:String = "[a href="event:block1"]dolor sit[/a]"; > > > > stuff.substr(stuff.indexOf("[a href="event:block1"]"), > > stuff.indexOf("[/a]")); > > > > > > > > Nathan Mynarcik > > [email protected] > > 254.749.2525 > > www.mynarcik.com > > > > > > On Mon, Aug 30, 2010 at 1:46 PM, Andrew Murphy <[email protected]> > wrote: > > > >> Hi. :) > >> > >> Does anyone know of a way to get the beginning and ending index of a > link > >> within a TextField? > >> > >> I want the indexes of the beginning and ending of the text that makes up > >> the > >> link. For example if I pass the following HTML text into the TextField: > >> > >> > >> [p]Lorem ipsum [a href="event:block1"]dolor sit[/a] amet.[/p] > >> > >> > >> What I want is the beginning and ending indexes of the "dolor sit" text > >> when > >> the user clicks on it. The TextEvent.LINK event passes out the value of > >> the > >> "href" within the link text (ie: "block1"), which isn't terribly useful > in > >> this case. > >> > >> > >> > >> ( ps: I used square brackets in the example HTML text rather than angle > >> brackets to try avoiding issues with the list's mailer, which doesn't > like > >> HTML code in emails. ) > >> > >> > >> ------------------------------ > >> 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 > >> > > _______________________________________________ > > Flashcoders mailing list > > [email protected] > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > _______________________________________________ > > Flashcoders mailing list > > [email protected] > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > _______________________________________________ > Flashcoders mailing list > [email protected] > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > _______________________________________________ > Flashcoders mailing list > [email protected] > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > -- Ktu; The information contained in this message may be privileged and/or confidential. If you are NOT the intended recipient, please notify the sender immediately and destroy this message. _______________________________________________ Flashcoders mailing list [email protected] http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

