dcsimg
A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: [F8] XML links

  1. #1
    Member
    Join Date
    Oct 2005
    Location
    England
    Posts
    85

    [F8] XML links

    Hi,
    Im wondering if anyone can help me.
    I am loading xml into my flash using this method -


    function loadXML(loaded) {
    if (loaded) {
    _root.web = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;

    _root.logo1_txt.text = _root.web;
    } else {
    trace("file not loaded!");
    }
    }
    xmlData = new XML();
    xmlData.ignoreWhite = true;
    xmlData.onLoad = loadXML;
    xmlData.load("myText.xml");


    and the xml is -

    <?xml version="1.0"?>

    <sitetext>

    <site>
    <web>http://www.alanwallace.co.uk </web>
    </site>
    </sitetext>



    So........i would like to make the "web" node into a link. Any ideas on how i can do that?
    Thanks
    Alan

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    use a CDATA section and an html enabled textfield
    PHP Code:
    function loadXML(loaded) { 
    if (loaded) { 
    _root.web = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
    _root.logo1_txt.html = true
    _root.logo1_txt.htmlText = _root.web;
    } else { 
    trace("file not loaded!"); 


    xmlData = new XML(); 
    xmlData.ignoreWhite = true; 
    xmlData.onLoad = loadXML; 
    xmlData.load("web.xml"); 

    /*

    <?xml version="1.0"?>

    <sitetext>
    <site>
    <web><![CDATA[<a href ='http://www.alanwallace.co.uk'>alanwallace.co.uk</a> ]]></web>
    </site>
    </sitetext>

    */

  3. #3
    Member
    Join Date
    Oct 2005
    Location
    England
    Posts
    85
    Hi,
    Thanks for taking the time to help me with this.
    Ive applied it to my project but i just get a "null" in the text field.
    Any Ideas?

    Thanks
    Alan

  4. #4
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    i have attached my Flash 8 test file
    hope it is of some help to you
    Attached Files Attached Files

  5. #5
    Member
    Join Date
    Oct 2005
    Location
    England
    Posts
    85
    Thanks you so much.
    As my intended text fields were buried deep inside my fla it took me a long time and a bit of shifting around but eventually after about 5 hours i have finally succeeded in getting this to work.
    Im in the process of making a template which is 100% xml and this has enabled me to get over the hump.
    very much apreciated
    Thanks
    Alan

  6. #6
    Member
    Join Date
    Oct 2005
    Location
    England
    Posts
    85
    cheers
    Last edited by magicplant; 02-07-2008 at 06:46 PM.

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