A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: xml import into html textbox shows raw html

  1. #1
    Senior Member nubz's Avatar
    Join Date
    Jun 2001
    Posts
    173

    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

  2. #2
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    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.
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  3. #3
    Senior Member nubz's Avatar
    Join Date
    Jun 2001
    Posts
    173
    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

  4. #4
    Senior Member nubz's Avatar
    Join Date
    Jun 2001
    Posts
    173
    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

  5. #5
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    yw glad i could help
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center