# Stop auto image scrolling

**URL:** https://forum.kirupa.com/t/stop-auto-image-scrolling/293874
**Category:** Uncategorized
**Created:** [August 5, 2009, 8:02am UTC](https://forum.kirupa.com/t/stop-auto-image-scrolling/293874 "2009-08-05T08:02:58Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![dalam](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@dalam](https://forum.kirupa.com/u/dalam)
#### Post date: [August 5, 2009, 8:02am UTC](https://forum.kirupa.com/t/stop-auto-image-scrolling/293874/1 "2009-08-05T08:02:58Z")

</div>

Hi dears how are you Autally i made auto xml base image scrolling i want when our scroll moving with products then mouse over it automatic stop please check this action script please help me any body!

var feed\_xml:XML = new XML();  
feed\_xml.ignoreWhite = true;  
feed\_xml.load(“data.xml”);[//data.xml](https://data.xml) path  
feed\_xml.onLoad = function(success) {  
init();//initialization  
AUTO\_id=setInterval(autoscr,(interval_1000))//auto scrolling init  
};  
//function init  
function init() {  
time\_chk()  
right.\_visible=1  
right.ar.gotoAndPlay(1)  
import mx.xpath.XPathAPI;  
\_global.item\_array = XPathAPI.selectNodeList(feed\_xml.firstChild, “/list/item”);  
\_global.user\_flag=feed\_xml.firstChild.attributes.u ser\_flag  
\_global.interval=feed\_xml.firstChild.attributes.in terval  
for (i=0; i\<item\_array.length; i++) {  
item\_array_.pic = item\_array\*.childNodes[0].firstChild.nodeValue;  
item\_array\*.title = item\_array\*.childNodes[1].firstChild.nodeValue;  
item\_array\*.link = item\_array\*.childNodes[2].firstChild.nodeValue;  
item\_array\*.id = i;  
}  
p = 0;  
for (i=0; i\<item\_array.length; i++) {  
it = items\_mc.item.duplicateMovieClip(“item”+i, i);  
it.pic.loadMovie(item\_array\*.pic);  
it.txt.text = item\_array\*.title;  
it.id = item\_array\*.id;  
it.bg.onRollOver = function() {  
if(!this.\_parent.\_parent.\_parent.moving){  
this.gotoAndStop(2);  
}  
};  
it.bg.onRollOut = function() {  
this.gotoAndStop(1);  
};  
it.bg.onRelease = function() {  
if(!this.\_parent.\_parent.\_parent.moving){  
getURL(item\_array[this.\_parent.id].link, “\_blank”);  
}  
};  
if (i%3 == 0) {  
it.\_x = p+35;  
} else {  
it.\_x = p;  
}  
p = it.\_x+180;  
}  
}  
//start setting  
page = 1;  
left.\_visible=0  
right.\_visible=0  
items\_mc.setMask(mask)  
//bluring when move  
function create\_blur(flg) {  
for (index in items\_mc) {  
if (flg) {  
items\_mc[index].filters = [new BlurFilter(25, 0, 1)];  
} else {  
items\_mc[index].filters = [null];  
}  
}  
}  
//thumbs moving right  
function move\_right() {  
moving=true  
create\_blur(1);  
left.\_visible=0  
right.\_visible=0  
clearInterval(AUTO\_id)  
items\_mc.onEnterFrame = function() {  
if (this.\_x\>-this.\_parent.page_575) {  
this.\_x -= 50;  
} else {  
this.\_x = -this.\_parent.page_575+1;  
delete (this.onEnterFrame);  
this.\_parent.page++;  
this.\_parent.create\_blur(0);  
this.\_parent.moving=false  
this.\_parent.left.\_visible=1  
this.\_parent.right.\_visible=1  
this.\_parent.left.ar.gotoAndPlay(1)  
this.\_parent.right.ar.gotoAndPlay(1)  
this.\_parent.AUTO\_id=setInterval(this.\_parent.auto scr,(interval\*1000))//auto scrolling init  
if(this.\_parent.page\>(Math.ceil(item\_array.length/3)-1)){  
this.\_parent.right.\_visible=0  
}  
}  
};  
}  
//thumbs moving left  
function move\_left() {  
moving=true  
create\_blur(1);  
left.\_visible=0  
right.\_visible=0  
clearInterval(AUTO\_id)  
items\_mc.onEnterFrame = function() {  
if (this.\_x\<-(this.\_parent.page-2)\*575) {  
this.\_x += 50;  
} else {  
this.\_x = -(this.\_parent.page-2)_575+1;  
delete (this.onEnterFrame);  
this.\_parent.page–;  
this.\_parent.create\_blur(0);  
this.\_parent.moving=false  
this.\_parent.left.\_visible=1  
this.\_parent.right.\_visible=1  
this.\_parent.left.ar.gotoAndPlay(1)  
this.\_parent.right.ar.gotoAndPlay(1)  
this.\_parent.AUTO\_id=setInterval(this.\_parent.auto scr,(interval_1000))//auto scrolling init  
if(this.\_parent.page==1){  
this.\_parent.left.\_visible=0  
}  
}

};  
}  
//auto scrolling function  
function autoscr(){  
if(!act\_ar.hitTest(\_xmouse,\_ymouse,1)){  
if(!auto\_temp){  
if(page\<Math.ceil(item\_array.length/3)){  
trace(Math.ceil(item\_array.length/3))  
move\_right()  
}else{  
auto\_temp=true  
}  
}else{  
if(page\>1){  
move\_left()  
}else{  
auto\_temp=false  
}  
}  
}  
}
