# XML links list...how can it be done

**URL:** <https://forum.kirupa.com/t/xml-links-list-how-can-it-be-done/197252>\
**Category:** flash\
**Created:** [August 14, 2006, 10:54pm UTC](https://forum.kirupa.com/t/xml-links-list-how-can-it-be-done/197252 "2006-08-14T22:54:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![FlashPirateYarr](https://avatars.discourse-cdn.com/v4/letter/f/f08c70/32.png) [@FlashPirateYarr](https://forum.kirupa.com/u/FlashPirateYarr)\
**Post date:** [August 14, 2006, 10:54pm UTC](https://forum.kirupa.com/t/xml-links-list-how-can-it-be-done/197252/1 "2006-08-14T22:54:11Z")

</div>

I’m starting to learn XML with Flash–the Kirupa tutorial on XML as well as Lee Brimelow’s XML tutorials on gotoAndLearn() have been wonderful. But here’s an actionscript challenge: I’m trying to create a list of links, with the link text and url of each link stored in an XML file. The file looks like this:

```auto
<?xml version="1.0"?>
  <myMenu>
  <myEssay name="Why No One's a Fan of Stanley Fish (2006)" url="docs/stanfish.html" />
  <myEssay name="The Fiction of History (2006)" url="docs/hwhite.html" />
  ...
  </myMenu>

```

I’ve seen projects that load each link into a textbox in an iteration of a premade movieclip and set an onRelease event to the whole movieclip to open the link. This is a novel solution, but won’t work for me for two reasons: 1.) I have about forty links and a series of forty movieclips, even if they’re only 20 pixels tall, will run off the stage, and 2.) I don’t yet know how to make a scrollbar for a series of movieclip symbols.

But I do know how to make a scrollbar for a dynamix textfield, so that’s what I’m doing. This AS loads in the names of my essays and displays them, one on each line, in a dynamic textbox called essayLinks:

```auto
menuXml = new XML();
menuXml.ignoreWhite = true;
menuXml.onLoad = function(success) {
    if (success) {
        myEssays = this.firstChild.childNodes;
        for (var i=0; i<myEssays.length; i++) {
            essayLinks.text += (myEssays*.attributes.name + "
");
        }
    }
}

```

The problem is how to attach a hyperlink (destination stored in the XML as an attribute called “url”) to each line. I immediately looked to the TextFormat class (with its TextFormat.url and TextFormat.target properties), but _I think_ that has to be applied to a whole textfield, and not just a string of text (If I could I would store \*\*myEssays.attributes.name \*as a temporary string variable and apply the TextFormat to it). So this is where things fall apart. Tell me if I’m going about this all wrong, but if I’m not I would really like some help.

Cheers,  
Steve
