# Check it... New Array Formula

**URL:** <https://forum.kirupa.com/t/check-it-new-array-formula/7334>\
**Category:** flash\
**Created:** [October 28, 2002, 9:00pm UTC](https://forum.kirupa.com/t/check-it-new-array-formula/7334 "2002-10-28T21:00:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![waffe](https://avatars.discourse-cdn.com/v4/letter/w/c37758/32.png) [@waffe](https://forum.kirupa.com/u/waffe)\
**Post date:** [October 28, 2002, 9:00pm UTC](https://forum.kirupa.com/t/check-it-new-array-formula/7334/1 "2002-10-28T21:00:38Z")

</div>

file = new LoadVars();  
file.onLoad = AddItems;  
file.load(“[http://www.file.asp](http://www.file.asp)”);  
function AddItems() {  
for (i=0; i\<file.NumItems; i++) {  
var Name = eval(“file.Name”+i);  
var Link = eval(“file.Link”+i);  
var Desc = eval(“file.Desc”+i);  
var DataProvider = {Name:Name, Link:Link, Desc:Desc};  
listBox.addItem(Name, DataProvider);  
}  
listBox.setChangeHandler(“SelectItem”);  
// set change handler.  
}  
function SelectItem() {  
\_root.Name = listBox.getSelectedItem().data[“Name”];  
\_root.Link = listBox.getSelectedItem().data[“Link”];  
\_root.Desc = listBox.getSelectedItem().data[“Desc”];  
}

This looks like better code then the code Sbeener gave on the thread “Parse” of the array, but here are a few hundred Questions:nerd:

1. I would like to implement a onChange function to load a sound file.

onChange = function () { screen.loadSound(listBox.getSelectedItem().data[“link”], true);}; :q:

Its the same old story, load the array parse the string and use there data where I want.:evil:

The asp file for this code is also different.  
It goes like this

&Name0=123&link0=song.mp3,desc0=wow&  
&Name0=123&link0=song1.mp3,desc0=neat&  
&Name0=123&link0=song2.mp3,desc0=o&

&numItems=3&

There is an extra “&” in every string but only 3 items show in the list box.

Any pointers would be much appreciated.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 29, 2002, 6:52am UTC](https://forum.kirupa.com/t/check-it-new-array-formula/7334/2 "2002-10-29T06:52:01Z")

</div>

yeah i don’t really understand…should really read ur post…heh
