# \[actionscript 2\] XML and image scrolling with drag button problem!NEED HELP

**URL:** <https://forum.kirupa.com/t/actionscript-2-xml-and-image-scrolling-with-drag-button-problem-need-help/236002>\
**Category:** Uncategorized\
**Created:** [August 16, 2007, 1:10pm UTC](https://forum.kirupa.com/t/actionscript-2-xml-and-image-scrolling-with-drag-button-problem-need-help/236002 "2007-08-16T13:10:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vasiliki](https://avatars.discourse-cdn.com/v4/letter/v/13edae/32.png) [@vasiliki](https://forum.kirupa.com/u/vasiliki)\
**Post date:** [August 16, 2007, 1:10pm UTC](https://forum.kirupa.com/t/actionscript-2-xml-and-image-scrolling-with-drag-button-problem-need-help/236002/1 "2007-08-16T13:10:03Z")

</div>

Hi,  
I have an XML image gallery problem. I have created a dragable slider and my problem is that I can’t synchronize the movement of the slider to end with the last image. Did I make any sense??  
well the source goes like that:

function loadXML(loaded) {  
if (loaded) {  
xmlNode = this.firstChild;  
image = [];  
description = [];  
text\_url = [];  
total = xmlNode.childNodes.length;  
//last\_child = xmlNode.childNodes.lastChild;  
for (i=0; i\<total; i++) {  
image\* = xmlNode.childNodes\*.childNodes[0].firstChild.nodeValue;  
description\* = xmlNode.childNodes\*.childNodes[1].firstChild.nodeValue;  
text\_url\* = xmlNode.childNodes\*.childNodes[2].firstChild.nodeValue;  
thumbnails\_fn(i);  
}  
//firstImage();  
} else {  
content = “file not loaded!”;  
}  
}  
xmlData = new XML();  
xmlData.ignoreWhite = true;  
xmlData.onLoad = loadXML;  
xmlData.load(“web\_dev.xml”);  
/////////////////////////////////////

function thumbnails\_fn(k) {  
thumbnail\_mc.createEmptyMovieClip(“t”+k, thumbnail\_mc.getNextHighestDepth());  
tlistener = new Object();  
tlistener.onLoadInit = function(target\_mc) {  
target\_mc.\_x = hit\_left.\_x+(target\_mc.\_width+40)\*k;  
target\_mc.pictureValue = k;

```
    thumbnail_mc.targetWidth = thumbnail_mc._x;
thumbnail_mc.onEnterFrame = function() {
var speed = 5;
thumbnail_mc._x -=((thumbnail_mc.targetWidth+this._x)-100)/speed;

```

};

handle.onPress = function() {  
this.startDrag(false, 54, 470, 754,470);  
};  
handle.onReleaseOutside = handle.onRelease = function() {  
this.stopDrag();  
};  
handle.onEnterFrame = function() {  
if (thumbnail\_mc.hitTest(hit\_left)) {  
thumbnail\_mc.targetWidth = this.\_x ;  
//trace(“right”)  
} else if (thumbnail\_mc.hitTest(hit\_right)) {  
thumbnail\_mc.targetWidth = this.\_x;  
}  
}  
}

```
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(image[k], "thumbnail_mc.t"+k);

```

}

any suggestions?  
thanx  
V.
