# \<--- \[a, b, c\] ---\> xml load 30 to 40 large images to scroll continously

**URL:** <https://forum.kirupa.com/t/a-b-c-xml-load-30-to-40-large-images-to-scroll-continously/228037>\
**Category:** flash\
**Created:** [June 4, 2007, 8:41pm UTC](https://forum.kirupa.com/t/a-b-c-xml-load-30-to-40-large-images-to-scroll-continously/228037 "2007-06-04T20:41:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![exxie](https://avatars.discourse-cdn.com/v4/letter/e/34f0e0/32.png) [@exxie](https://forum.kirupa.com/u/exxie)\
**Post date:** [June 4, 2007, 8:41pm UTC](https://forum.kirupa.com/t/a-b-c-xml-load-30-to-40-large-images-to-scroll-continously/228037/1 "2007-06-04T20:41:27Z")

</div>

\<— [… a, b, c…] —\> xml load 30 to 40 large images to scroll continously

I am wondering if anyone has ever seen this done before. A xml loaded gallery of only large images (NO THUMBS) that scroll infinitely. I have created a gallery that loads 30 to 40 large images via XML and scrolls it continously horizontally left or right - they are masked so that 3 can be seen scrolling by at any given time. The actionscript I have works great but takes quite some time for them to all load before scrolling will start. What I would like to do is have only maybe 6 fully load at a time and then unload when not close to the masked area. I’m not sure how to do this but I thought maybe with a setInterval type function? Where only images scrolling into the masked area are called to load.

Here is a site I really love that does something similar:

[http://www.roxburymusic.com/index.html](http://www.roxburymusic.com/index.html)

Here is the actionscript I am using so far:

pArray = new Array();  
pictArray = new Array();

my\_xml = new XML();  
my\_xml.ignoreWhite = true;  
my\_xml.onLoad = function(success) {  
if (success) {  
for (var i = 0; i\<this.firstChild.childNodes.length; i++) {  
pictArray.push(this.firstChild.childNodes\*.attributes.scrollphotos);  
pArray.push(this.firstChild.childNodes\*.attributes.image);  
}  
}  
delay = setInterval(makeMenu, 100);  
};  
my\_xml.load(“gallery2.xml”);  
var menu = this.createEmptyMovieClip(“menu\_tot”, 99);  
menu.setMask(mask2);  
var sub\_menu = menu.createEmptyMovieClip(“menu”, 100);  
var p = 0;  
var q = 0;  
var loadper = 0;  
function makeMenu() {  
clearInterval(delay);  
var item = sub\_menu.createEmptyMovieClip(“pic”+q, q);  
item.loadMovie(pictArray[p]);  
var temp = \_parent.createEmptyMovieClip(“tmp”, 9999+q);  
temp.onEnterFrame = function() {  
var tot = item.getBytesTotal();  
var loa = item.getBytesLoaded();  
var per = Math.round(((loa/tot)_100)/(pictArray.length_2));  
loadBar.\_xscale = loadper+per;  
if (tot == loa && tot\>4) {  
item.id = p;  
loadper += per;  
if (q\>0) {  
item.\_x = sub\_menu[“pic”+(q-1)].\_x+sub\_menu[“pic”+(q-1)].\_width+10;  
} else {  
item.\_x = 0;  
};  
nextItem();  
delete this.onEnterFrame;  
}  
};  
}  
var amount = pictArray.length-1;  
function nextItem() {  
if (q\<((pictArray.length\*2)-1)) {  
q++;  
if (p\<(pictArray.length-1)) {  
p++;  
makeMenu();  
} else {  
p = 0;  
makeMenu();  
}  
} else {  
activateMenu();  
}  
}  
var center = xcenter = 326;  
var speed = .05;  
function activateMenu() {  
menu.onEnterFrame = function() {  
var distance = \_root.\_xmouse-center;  
if (mask2.hitTest(\_root.\_xmouse, \_root.\_ymouse, false)) {

```
		this._x += (distance*speed);
		if (this._x&lt;-sub_menu._width/2) {
			this._x = 0;
		}
		if (this._x&gt;0) {
			this._x = -sub_menu._width/2;
		}
	}
};

```

}
