Skip to main content
Participant
September 12, 2008
Question

Convert HTML text to normal text

  • September 12, 2008
  • 2 replies
  • 328 views
Basically I want to convert some html formatted text to normal text. I've got a html page being loaded into my swf but then I want to copy it to the user's clipboard, but as it is on screen without all of the html tags (<BR>, character escaping, etc). Previously i did it like this:

tempText.html = true;
tempText.htmlText = "<BR><B>hellow world</B><BR>";
copyText = tempText.text;
trace(copytext);


returns "undefined"


this code used to work but doesn't anymore 😞 I kind of want to refrain from using copy and replace string functions to get rid of the html formating because thats a bit unreliable given how i'm going to use this. So does anyone have any ideas? 😄
This topic has been closed for replies.

2 replies

kglad
Community Expert
Community Expert
September 18, 2008
the only way that would return undefined is if no textfield with instance name tempText existed when the corrected code executed.
kglad
Community Expert
Community Expert
September 12, 2008
it would work if you used copyText in that trace() function instead of copytext.
JabuchouAuthor
Participant
September 17, 2008
Hi kglad

Sorry about that typo on my end, but even if you do trace(copyText); it still comes up with undefined ¬_^'

Got any ideas?