# Modify an image slider using xml

**URL:** <https://forum.kirupa.com/t/modify-an-image-slider-using-xml/251695>\
**Category:** flash\
**Created:** [February 11, 2008, 9:09pm UTC](https://forum.kirupa.com/t/modify-an-image-slider-using-xml/251695 "2008-02-11T21:09:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stefane321](https://avatars.discourse-cdn.com/v4/letter/s/41988e/32.png) [@stefane321](https://forum.kirupa.com/u/stefane321)\
**Post date:** [February 11, 2008, 9:09pm UTC](https://forum.kirupa.com/t/modify-an-image-slider-using-xml/251695/1 "2008-02-11T21:09:22Z")

</div>

I want to midify this script to use image that have different width.

[http://www.flashkod.com/codes/SLIDER...ENS\_33504.aspx](http://www.flashkod.com/codes/SLIDER...ENS_33504.aspx)

Can you help me please?

Here is what I tried:

I aded a width attribut in the xml file to set each image width (widthimage=“215”)

In the Movie clip menu\_mc I modified the actionscript to use the attribute width in the xml file.

```auto

//350 étant le milieu de la scène, là où la vitesse est la plus faible
this.onMouseMove = function() {
this.vitesseMenu = Math.round(-(this._xmouse-350)/50);
};
// c'est Math.round qui va éviter le décalage
//et le tremblement des images
//car il arrondit les valeurs
setMenu = function (FileXML) {
// largeurBouton = 100;

for (var n = 0; n<FileXML.childNodes.length; n++) {
var Name = "bouton"+n;
//on duplique le bouton qui va contenir les images
var btn = attachMovie("BTN_mc", Name, n);
//LINE I ADDED
largeurBouton = FileXML.childNodes[n].attributes.widthimage;
//END LINE I ADDED
//largeurBouton = 100;
btn._x = n*largeurBouton;
//on lui attribue les chemins correspondants du fichier xml
btn.URL = FileXML.childNodes[n].attributes.URL;
btn.urlimg = FileXML.childNodes[n].attributes.urlimage;
}
decalage = n*largeurBouton;
};

```

But it does not work,
