Re: [Flashcoders] Retrieving Link Text in a Text Field

2006-04-13 Thread Michael Bedar
I don't think you can directly get the link text, but you can add parameters to asfunction calls, so maybe you can do it that way? -- Michael Bedar [EMAIL PROTECTED] On Apr 13, 2006, at 2:31 PM, Jason Lutes wrote: Is there a way to identify the contents of a link element in an

RE: [Flashcoders] Retrieving Link Text in a Text Field

2006-04-13 Thread Steven Sacks
Could you get the .htmlText of the text field and using split to pull the link out? txt.htmlText = a href=\link\; var a = txt.htmlText; var b = a.split(a href=\)[1]; var c = b.split(\)[0]; trace(c); // link There are also regex methods for Flash is you hunt around for them. HTH, Steven

Re: [Flashcoders] Retrieving Link Text in a Text Field

2006-04-13 Thread JesterXL
Assuming Highlander TextField: function init() { my_txt.htmlText = Hello a href='http://www.jessewarden.com'Jesse/a, how are you?; var str = my_txt.htmlText; var start = str.indexOf(a href); if(start == -1) { start = str.indexOf(A HREF); } var startBracket = str.indexOf(, start); var

RE: [Flashcoders] Retrieving Link Text in a Text Field

2006-04-13 Thread Steven Sacks
Assuming Highlander TextField: There can be only one! Flash likes to capitalize stuff and add TARGET to the href so here's the fixed (and tested) code. txt.htmlText = a href=\thesequelsucked.html\McCloud/a; a = txt.htmlText.split(A HREF=\)[1].split(\ TARGET=)[0]; trace(a);

RE: [Flashcoders] Retrieving Link Text in a Text Field

2006-04-13 Thread Steven Sacks
Is there a way to identify the contents of a link element in an HTML-enabled text field? How can I pass the text of the link to a function invoked by the link? Wait, you mean you want to pass the text of the link (inside the a tag) via the function you're calling in the link? You'll have to

RE: [Flashcoders] Retrieving Link Text in a Text Field

2006-04-13 Thread Jason Lutes
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