A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [RESOLVED] CDATA not showing HTML in text field???

  1. #1
    mentally unstable member smayer72's Avatar
    Join Date
    Jan 2001
    Posts
    527

    resolved [RESOLVED] CDATA not showing HTML in text field???

    Hi all

    Simple XML import with text and an html link and an image. For some reason the html tags are rendering as text, not html in the dynamic text field. I have looked at countless posts and tuts but found nothing that helps. From all I've read I am doing things right, but obviously I am not. I must be missing something. I would appreciate if someone could take a look at the attached code and explain where I am going wrong.

    XML File
    Code:
    <?xml version="1.0" ?>	
    <item>
    <description><![CDATA[iChristian Australia 
    
    A unique Christian resource store, iChristian services the Christian population across Australia and New Zealand. Our site can be re-branded to suit virtually any ministry, church, radio station or non-government organization (NGO). We profit share with our outlets encouraging them to brand 'their' store in the marketplace and to their supporters. Some of our long-term partners include: Scripture Union Australia, Michael Youssef Ministries, Brisbane 96Five FM and Rhema FM Newcastle. Our current distribution email list stands at over 385,000. 
    
    
    Essentially, iChristian is the 'hub' that allows us to offer the products and services you see here at MarketCathedral. 
    
    
    Established more than 5 years ago, iChristian has rapidly become a leader in the supply of digital Christian media in Australasia. 
    
    
    Begin earning 40% of the net profit on all purchases today! it's easy, it's quick and Best of all, it's FREE!!! 
    
    NO set-up or monthly service charges! We take care of everything for you-credit card processing, distribution, customer service, returns, exchanges... everything! All you have to do is put links to your store on your site and away you go!
    
    
    If you would like to contact us in relation to placing product on the iChristian site, please use the contact page and we'll be sure to get in touch with you. 
    
    <a href="www.ichristian.com.au/iChristianProposal.pdf">Click here to view the full iChristian proposal.    <img src="images/blk_pdf.jpg></a>]]>
    </description>
    </item>
    And the AS2 that load the file and displays the text
    Code:
    // XML LOADING
    //---------------------------------------------------------------------------------------------------------------------
    var buildMenu_SI:Number;
    xmlLoader = "Loading ";
    //
    projXML = new XML();
    projXML.ignoreWhite = true;
    projXML.onLoad = function(success) {
    	if (success) {
    		ima.theData.textBody.html = true;
    		ima.theData.textBody.htmlText=this.firstChild.childNodes[0];
    	}
    }
    xmlLoader = "";
    
    projXML.load("onlineSales.xml");
    //
    Scott (Australia)

    Sarcasm, chaos and disorder. My work here is done!

    **Mark you threads as [RESOLVED] please.**

  2. #2
    Junior Member
    Join Date
    Apr 2010
    Posts
    4

    Render option

    Either select the dynamic text field and toggle on the "Render text as HTML" option in the properties (looks like "<>")

    Or put the following code in your actionscript:

    var html = yourTextfield.html;

    Where "yourTextfield" is the instance name of your dynamic textfield.

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