# Code help please!

**URL:** <https://forum.kirupa.com/t/code-help-please/52767>\
**Category:** Uncategorized\
**Created:** [May 27, 2004, 4:05am UTC](https://forum.kirupa.com/t/code-help-please/52767 "2004-05-27T04:05:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![snaphappy](https://avatars.discourse-cdn.com/v4/letter/s/ed8c4c/32.png) [@snaphappy](https://forum.kirupa.com/u/snaphappy)\
**Post date:** [May 27, 2004, 4:05am UTC](https://forum.kirupa.com/t/code-help-please/52767/1 "2004-05-27T04:05:27Z")

</div>

I am loading an array from a text file to create a set of thumbnail images a la scotty’s excellent post on the topic, using this code:

function select(q) {  
thumb\_array = new Array();  
loadArray = new LoadVars();  
loadArray.load(“array.txt”);  
loadArray.onLoad = function(success) {  
if (success) {  
ab = this[“array\_”+q];  
thumb\_array = ab.split(",");  
\_root.image\_array = thumb\_array;  
posthumbs();  
}  
};  
}

with the following in the .txt file

array\_1=001,002,003,005&array\_2=004,005,091,092,093,094,095,096,

As far as I understand the top function makes array\_1 and array\_2 selectable, and they are then referenced by this button action

contents.onRelease = function() {  
\_root.dragwindow.scrll.select(1);  
};

What I need help with is trying to have the same functionality but using XML, I understand how to load arrays from an xml file, but can’t get it to tie in with everything else even after many long attempts.

I also don’t understand what is going on later in the code with ab, can anyone explain it?

COMPLETE CODE FOLLOWS:

(attached as zipped text file - post.zip)

any help or explanations truly appreciated.

SH
