A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: [RESOLVED] Make xml loaded text string clickable URL Help

  1. #1
    Senior Member
    Join Date
    Mar 2008
    Posts
    168

    resolved [RESOLVED] Make xml loaded text string clickable URL Help

    I would like to make the text in the last node of my XML a clickable URL Link. I have tried:

    <sf_grant="ReadMore"><![CDATA[<a href='http://www.google.com'>Read more about Oregon</a>.]]></sf_grant>

    no luck.

    Here is my load and array set up;

    Code:
    myXML = new XML();
    myXML.ignoreWhite = true;
    myXML.load("states.xml");
    myXML.onLoad = function(succes){
    if(succes){
    	trace (state_no);
    var root = this.firstChild;
    nodes = root.childNodes;
    mc_allstates.Title_txt.text = nodes[state_no].attributes.name;
    subnodes = nodes[state_no].childNodes;
    mc_allstates.f_total_txt.text = subnodes[0].firstChild.toString();
    mc_allstates.f_increase_txt.text = subnodes[1].firstChild.toString();
    mc_allstates.f_rank_txt.text = subnodes[2].firstChild.toString();
    mc_allstates.u_current_txt.text = subnodes[3].firstChild.toString();
    mc_allstates.u_last_txt.text = subnodes[4].firstChild.toString();
    mc_allstates.u_50plus_txt.text = subnodes[5].firstChild.toString();
    mc_allstates.bg_actual_txt.text = subnodes[6].firstChild.toString();
    mc_allstates.bg_percent_txt.text = subnodes[7].firstChild.toString();
    mc_allstates.hp_current_txt.text = subnodes[8].firstChild.toString();
    mc_allstates.hp_increase_txt.text = subnodes[9].firstChild.toString();
    mc_allstates.sf_grant_txt.text = subnodes[10].firstChild.toString();
    
    } else trace("Error loading XML document")
    
    }
    and here is one item from my XML;
    Code:
    <title name="Oregon">
      	<f_total>46</f_total>
    	<f_increase>26</f_increase>
    	<f_rank>$12</f_rank>
    
    	<u_current>96%</u_current>
    	<u_last>5</u_last>
    	<u_50plus>$5,000</u_50plus>
    
    	<bg_actual>55%</bg_actual>
    	<bg_percent>25%</bg_percent>
    
    	<hp_current>-8.11%</hp_current>
    	<hp_increase>48 **</hp_increase>
    	
    	<sf_grant>Read more about Oregon</sf_grant>
      </title>

  2. #2

  3. #3
    Senior Member
    Join Date
    Mar 2008
    Posts
    168
    actually that sort of confused me more, Thanks anyway

  4. #4
    Member
    Join Date
    Aug 2012
    Posts
    55
    Last edited by rachelg; 09-13-2012 at 01:46 PM.

  5. #5
    Senior Member
    Join Date
    Mar 2008
    Posts
    168
    Got it figured out Thanks:

    <sf_grant><a href="http://www.google.com" target="_new">Read more about Washington</a></sf_grant>

  6. #6
    Member
    Join Date
    Aug 2012
    Posts
    55
    great!

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