-
Senior Member
xml import into html textbox shows raw html
hi there
my first bash at xml import - I have an xml file I created from a database table - I used an xml editor to enclose each relevant node with CDATA and it imports fine and I can navigate the content from my swf except the textfield displays all links as raw html, an example node in the xml file:
Code:
<tip><![CDATA[Do something amazing, donate blood <a href="http://www.blood.co.uk" target="_blank">www.blood.co.uk</a>]]></tip>
and it's output in the swf textfield:
Code:
Do something amazing, donate blood <a href="http://www.blood.co.uk" target="_blank">www.blood.co.uk
I have made the textfield recognise html:
Code:
var myNode=myXML.childNodes[0];
_root.createTextField('tipTxt',_root.getNextHighestDepth(),20,35,370,90);
_root.tipTxt.html=true;
_root.tipTxt.multiline=true;
_root.tipTxt.wordWrap=true;
_root.tipTxt.htmlText=myNode.childNodes[nextInArray].childNodes[1];
_root.tipTxt.setTextFormat(tFormat);
what am i doing wrong or not doing please! any help muchly appreciated!
thanks
site check spec: ADSL (UK), PC P4 3Ghz, 1024MB RAM, Res: 1440 X 900, Player: Flash 9, WinXP Home, Firefox 2
dev spec: Flash 8 Pro, Flash MX 2004, Flash MX
-
Flashmatics
use
Code:
_root.tipTxt.htmlText=myNode.childNodes[nextInArray].childNodes[1].nodeValue;
i havent seen your xml document so u may need to use
firstChild.nodeValue
hope that helps
Last edited by silentweed; 06-06-2007 at 01:53 PM.
-
Senior Member
well that strips the tags for me if I use:
PHP Code:
_root.tipTxt.htmlText=myNode.childNodes[nextInArray].childNodes[1].firstChild.nodeValue;
odd thing is sometimes they actually link (I have an array of eco-tips that I can flip through) but mainly they don't link tho
site check spec: ADSL (UK), PC P4 3Ghz, 1024MB RAM, Res: 1440 X 900, Player: Flash 9, WinXP Home, Firefox 2
dev spec: Flash 8 Pro, Flash MX 2004, Flash MX
-
Senior Member
hey strike that - they all link fine in a browser which is really where it matters - so thanks a million silentweed
site check spec: ADSL (UK), PC P4 3Ghz, 1024MB RAM, Res: 1440 X 900, Player: Flash 9, WinXP Home, Firefox 2
dev spec: Flash 8 Pro, Flash MX 2004, Flash MX
-
Flashmatics
yw glad i could help
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|