# Stop scroll when up

**URL:** <https://forum.kirupa.com/t/stop-scroll-when-up/223983>\
**Category:** flash\
**Created:** [April 27, 2007, 9:18am UTC](https://forum.kirupa.com/t/stop-scroll-when-up/223983 "2007-04-27T09:18:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![arduino76](https://avatars.discourse-cdn.com/v4/letter/a/eb9ed0/32.png) [@arduino76](https://forum.kirupa.com/u/arduino76)\
**Post date:** [April 27, 2007, 9:18am UTC](https://forum.kirupa.com/t/stop-scroll-when-up/223983/1 "2007-04-27T09:18:46Z")

</div>

Hi…  
i used the continuous thumbnail gallery to scroll from right to left the images…  
now i would like to stopp the scoll when u are on the images…can some guru help me?..  
This my code:  
cliparray = [];  
function loadXML(loaded) {  
if (loaded) {  
xmlNode = this.firstChild;  
url = [];  
link = [];  
total = xmlNode.childNodes.length;  
for (i=0; i\<total; i++) {  
url\* = xmlNode.childNodes\*.childNodes[0].firstChild.nodeValue;  
link\* = xmlNode.childNodes\*.childNodes[1].firstChild.nodeValue;  
thumbnails\_fn(i);  
}

} else {  
content = “file not loaded!”;  
}  
}  
xmlData = new XML();  
xmlData.ignoreWhite = true;  
xmlData.onLoad = loadXML;  
xmlData.load(“images.xml”);  
/////////////////////////////////////  
p = 0;  
this.createEmptyMovieClip(“tscroller”, 1000);  
scroll\_speed = 5;  
var tot = 0;  
tscroller.onEnterFrame = function() {  
if ((\_root.\_ymouse\>=thumbnail\_mc.\_y) && (\_root.\_ymouse\<=thumbnail\_mc.\_y+thumbnail\_mc.\_height)) {  
if (\_root.\_xmouse\>=\_x) {  
for (var obj in cliparray) {  
cliparray[obj].\_x -= scroll\_speed;  
}  
if (cliparray[0].\_x\<-cliparray[0].\_width) {  
cliparray[0].\_x = cliparray[cliparray.length-1].\_x+cliparray[cliparray.length-1].\_width+500;  
var j = cliparray.splice(0, 1);  
cliparray = cliparray.concat(j);  
}  
} else if (\_root.\_xmouse\<=\_x) {  
for (var obj in cliparray) {  
cliparray[obj].\_x += scroll\_speed;  
}  
if (cliparray[cliparray.length-1].\_x\>hit\_right.\_x) {  
cliparray[cliparray.length-1].\_x = cliparray[0].\_x-(cliparray[cliparray.length-1].\_width+500);  
var j = cliparray.splice(cliparray.length-1, 1);  
cliparray = j.concat(cliparray);  
}  
}  
}  
};  
function thumbnails\_fn(k) {  
var yy = thumbnail\_mc.createEmptyMovieClip(“t”+k, thumbnail\_mc.getNextHighestDepth());  
cliparray.push(yy);  
tlistener = new Object();  
tlistener.onLoadInit = function(target\_mc) {  
target\_mc.\_x = 500+(target\_mc.\_width+500)\*k;  
target\_mc.pictureValue = k;  
tot += target\_mc.\_x;  
target\_mc.onRelease = function() {  
p = this.pictureValue+0;  
getURL(link[p], “\_blank”);  
};  
target\_mc.onRollOver = function() {  
this.\_alpha = 60;  
thumbNailScroller();  
};  
target\_mc.onRollOut = function() {  
this.\_alpha = 100;  
};

};  
image\_mcl = new MovieClipLoader();  
image\_mcl.addListener(tlistener);  
image\_mcl.loadClip(url[k], “thumbnail\_mc.t”+k);  
}

And here the exemple  
[http://portale.nethouse.it/download/test/movie3.html](http://portale.nethouse.it/download/test/movie3.html)

thanx
