# Read xml with attachMovie

**URL:** https://forum.kirupa.com/t/read-xml-with-attachmovie/63470
**Category:** Uncategorized
**Created:** [September 7, 2004, 7:45am UTC](https://forum.kirupa.com/t/read-xml-with-attachmovie/63470 "2004-09-07T07:45:49Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![onisho](https://avatars.discourse-cdn.com/v4/letter/o/b782af/32.png) [@onisho](https://forum.kirupa.com/u/onisho)
#### Post date: [September 7, 2004, 7:45am UTC](https://forum.kirupa.com/t/read-xml-with-attachmovie/63470/1 "2004-09-07T07:45:49Z")

</div>

I have an xml file which i read in in flash and putting every ‘item’ beneath another one with attachMovie.

My xml looks like

```auto
  <work>
   <item>
   <title>
   <desc>
   <detail>
   </item>
   <item>
   ...
   </item>
   </work>

```

Actions on first frame with a movieclip in the library (actionscript export activated - name: itemClip - itemName and itemDetails are the two dynamic textfields in the movieclip ‘itemClip’)

```auto
menuXml = new XML();
 menuXml.ignoreWhite = true;
 menuXml.onLoad = function(success) {
   if (success) {
    menuItem = this.firstChild.childNodes;
    for (var i=0; i<menuItem.length; i++) {
 	  item = _root.attachMovie("itemClip", "itemClip" + i, i);
 	  //put item on stage: 50 is the start x and y value from top left
 	  //30 is the value to add to y for each new itemClip
 	  item._x = 50;
 	  item._y = 50+20*i;
 	  item.itemName.text = menuItem*.childNodes[0].firstChild.nodeValue;
 	  item.itemDetails.text = menuItem*.childNodes[1].firstChild.nodeValue;
 	  item.myUrl = menuItem*.childNodes[2].firstChild.nodeValue;
 	  item.onRelease = function() {
 	  getURL(this.myUrl,"_blank");
    }
   }
  }
 }
 menuXml.load("work.xml");

```

What i want is the following :

1. The movieclip is now generated on the stage… but i would like to have it with a scroller… and with a mask on it… or in a scrollpane…

2. I also would like to now if I click on an item, how can i pass a the value of a variable to another piece of actionscript in wich i will show the details in a dynamic textfield (or multiple textfields)… Just like in php : a list of all items and when you click on one, you’ll get the details of that item.

I only want to use flash with xml… no php if possible.

Thanks to the person who can help me out on this !!

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [September 7, 2004, 11:45am UTC](https://forum.kirupa.com/t/read-xml-with-attachmovie/63470/2 "2004-09-07T11:45:32Z")

</div>

1. The movieclip is now generated on the stage… but i would like to have it with a scroller… and with a mask on it… or in a scrollpane…

Found a solution for the first part of my question in [http://www.kirupaforum.com/forums/showthread.php?t=65554&highlight=scrollpane](http://www.kirupaforum.com/forums/showthread.php?t=65554&highlight=scrollpane)
