# Dynamic XML Image Slider auto scroll question

**URL:** <https://forum.kirupa.com/t/dynamic-xml-image-slider-auto-scroll-question/240082>\
**Category:** flash\
**Created:** [September 28, 2007, 9:51pm UTC](https://forum.kirupa.com/t/dynamic-xml-image-slider-auto-scroll-question/240082 "2007-09-28T21:51:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![island86](https://avatars.discourse-cdn.com/v4/letter/i/bbce88/32.png) [@island86](https://forum.kirupa.com/u/island86)\
**Post date:** [September 28, 2007, 9:51pm UTC](https://forum.kirupa.com/t/dynamic-xml-image-slider-auto-scroll-question/240082/1 "2007-09-28T21:51:45Z")

</div>

I Have a question regarding a dynamic XML driven image slide show.

I want the movie to slide continuessly from the left side automatically when it is loaded.  
Now it only loads when a mouse movement enters the screen.

The link is:  
[http://dev.islandtechnologies.net/Flash-test/flash-test01.html](http://dev.islandtechnologies.net/Flash-test/flash-test01.html)

Here is the code from the main time line, Frame 2 (Frame 1 loads the XML file:

stop();  
// Number of items  
itemNum = 15;  
// Stage Dimentions  
stageWidth = 700;  
stageHeight = 300;  
// Button’s width  
width = 169;  
// Separation between the buttons  
separation = 20;  
// Distance between the buttoms  
space = width + separation;  
// Total width of the buttons line  
limit = itemNum \* space;  
// Speed  
speed = 5;  
for(i=0; i\<itemNum; i++) {  
\_root.attachMovie(“mc\_button”,“mc\_button”+i,10+i);  
ref = \_root[“mc\_button”+i];  
// Vertical Positión (\_y)  
ref.\_y = stageHeight/5;  
// Horizontal Positión (\_x) + separation (20px)  
ref.\_x = ( space \* i ) + separation;  
// Loads the picture description  
ref.info.descName=picturesXML.firstChild.childNodes\*.childNodes[0].firstChild.nodeValue  
// unloads the marc  
ref.marc.unloadMovie()  
// Load the picture(.jpg)  
ref.marc.loadMovie(picturesXML.firstChild.childNodes\*.childNodes[1].firstChild.nodeValue)  
// The link where will go when press  
ref.link=picturesXML.firstChild.childNodes\*.childNodes[2].firstChild.nodeValue  
}  
onMouseMove = function(){  
movement = int(((\_xmouse - (stageWidth/2))/-(stageWidth/2)) \* speed);  
}

And here is the code from the movie clip timeline (frame 1):

// picture scale  
marc.\_xscale = marc.\_yscale = 100  
// link  
var link:String;  
// Moving

onEnterFrame = function() {  
// Adjust the position  
this.\_x += \_root.movement;  
// if is outside the right limit…  
if ( this.\_x \> \_root.limit - \_root.width ){  
// … goes to the left limit  
this.\_x -= \_root.limit;  
}  
// if is outside the left limit…  
if( this.\_x \< -\_root.width ) {  
// … goes to the right limit  
this.\_x += \_root.limit;  
}  
}  
// Getting URL when press  
info.onPress=function(){  
getURL(“http://”+link)  
}

Any help would be greatly appreciated.  
Thanks,  
RJ
