I have recently increased the size of my exhibitor xml to include exhibitor info for booths that are not rented…basically I want each booth to be represented in my list components…here is the code to read in my XML…
function loadExXML(url:String)
{
var listWidth:Number = 34;
listAccChild1.exList.hScrollPolicy = "off";
listAccChild1.exList.rollOverColor="0x999999";
listAccChild1.exList.selectionColor="0x666666";
listAccChild1.exList.textSelectedColor="0xffffff";
listAccChild2.exList.hScrollPolicy = "off";
listAccChild2.exList.rollOverColor="0x999999";
listAccChild2.exList.selectionColor="0x666666";
listAccChild2.exList.textSelectedColor="0xffffff";
var boothArray:Array = new Array();
var boothCounter:Number = 0;
var tempCounter:Number;
var ExList:XML = new XML();
ExList.ignoreWhite = true;
_global.boothArray = new Array();
_global.exIndex = new Array();
_global.exName = new Array();
_global.cID = new Array();
_global.boothID = new Array();
_global.add1 = new Array();
_global.add2 = new Array();
_global.city = new Array();
_global.state = new Array();
_global.country = new Array();
_global.zip = new Array();
_global.contact = new Array();
_global.phone = new Array();
_global.fax = new Array();
_global.email = new Array();
_global.web = new Array();
_global.dataSet = new Array();
ExList.onLoad = function()
{
var nodes = this.firstChild.childNodes;
numOfItems = nodes.length;
for(var i=0; i<numOfItems; i++)
{
_global.exName* = nodes*.attributes.ex_name;
_global.cID* = nodes*.attributes.c_id;
_global.boothID* = nodes*.attributes.booth_ID;
_global.add1* = nodes*.attributes.add1;
_global.add2* = nodes*.attributes.add2;
_global.city* = nodes*.attributes.city;
_global.state* = nodes*.attributes.state;
_global.country* = nodes*.attributes.country;
_global.zip* = nodes*.attributes.zip;
_global.contact* = nodes*.attributes.contact;
_global.phone* = nodes*.attributes.phone;
_global.ax* = nodes*.attributes.fax;
_global.email* = nodes*.attributes.email;
_global.web* = nodes*.attributes.web;
}
for(var j=0; j<_global.exName.length; j)
{
if(_global.exName[j]!=" ")
{
do
{
_global.boothArray[boothCounter] = j;
boothCounter++;
j++;
}while(_global.exName[j-1] == _global.exName[j]);
listAccChild1.exList.addItem({label:_global.exName[j-1], data:_global.boothArray});
if(_global.exName[j-1].length > listWidth)
{
listWidth = _global.exName[j-1].length;
listAccChild1.exList.hScrollPolicy = "on";
listAccChild1.exList.maxHPosition = listWidth-25;
}
boothCounter = 0;
_global.boothArray = [];
}
}
for(var k=0; k<numOfItems; k++)
{
_global.dataSet[boothCounter] = k;
//if(_global.boothID[k]
listAccChild2.exList.addItem({label:parseInt(_global.boothID[k]) + ": " + _global.exName[k], data:_global.dataSet});
if(_global.exName[k].length > listWidth)
{
listWidth = _global.exName[k].length;
listAccChild2.exList.hScrollPolicy = "on";
listAccChild2.exList.maxHPosition = listWidth-25;
}
listAccChild2.exList.sortItems(numSort);
boothCounter = 0;
_global.dataSet = [];
}
}
ExList.load(url);
}
please excuse all the extra mumob jumbo…it deals with duplicates in the list and things like that…it seems that once the xml is larger than about 300 lines…the XML looks somewhat like this…
<EXHIBITORS> <EXHIBITOR ex_name=“Aardvark Mechanical” c_ID=“C:\EXPOCAD 69\Progra” booth_ID=“1231” add1=“58 Gross Street” add2="" city=“Milltown” state=“IL” country="" zip=“60234” contact=“SALES” phone=“815-724-8721” fax=“815-724-9393” email="[email protected]" web=“www.BrestewRed.com”/>
<EXHIBITOR ex_name=“ABC Company” c_ID=“C:\EXPOCAD 69\Progra” booth_ID=“549” add1=“678 Benton Strret” add2="" city=“Aurora” state=“IL” country="" zip=“60505” contact=“SALES” phone=“630-888-9797” fax=“630-888-9798” email="[email protected]" web=“www.BrestewRed.com”/>
<EXHIBITOR ex_name=“ABC Company” c_ID=“C:\EXPOCAD 69\Progra” booth_ID=“2037” add1=“678 Benton Strret” add2="" city=“Aurora” state=“IL” country="" zip=“60505” contact=“SALES” phone=“630-888-9797” fax=“630-888-9798” email="[email protected]" web=“www.BrestewRed.com”/>
<EXHIBITOR ex_name=“ABC Marketing Group” c_ID=“C:\EXPOCAD 69\Progra” booth_ID=“1533” add1=“123 Anywhere St.” add2="" city=“Main” state=“WV” country="" zip=“45454” contact=“SALES” phone=“456-888-0921” fax=“456-888-0922” email="[email protected]" web=“www.BrestewRed.com”/>
<EXHIBITOR ex_name=“Able Weights and Ferns” c_ID=“C:\EXPOCAD 69\Progra” booth_ID=“337” add1=“60 Queen Court” add2=“Mail Station E” city=“Aurora” state=“IL” country="" zip=“60331” contact=“SALES” phone=“331-555-5555” fax=“331-567-9921” email="[email protected]" web=“www.BrestewRed.com”/>
<EXHIBITOR ex_name=“Applied Computer Technology” c_ID=“C:\EXPOCAD 69\Progra” booth_ID=“1245” add1=“69 S. LaSalle Street” add2="" city=“Aurora” state=“IL” country="" zip=“60505” contact=“SALES” phone=“630-896-2281” fax=“630-898-5387” email="[email protected]" web=“www.BrestewRed.com”/>
.
.
.
<EXHIBITOR ex_name=“Available - 10’ x 10’” c_ID="" booth_ID=“1943” add1="" add2="" city="" state="" country="" zip="" contact="" phone="" fax="" email="" web=""/>
<EXHIBITOR ex_name=“Available - 10’ x 10’” c_ID="" booth_ID=“2042” add1="" add2="" city="" state="" country="" zip="" contact="" phone="" fax="" email="" web=""/>
<EXHIBITOR ex_name=“Available - 10’ x 10’” c_ID="" booth_ID=“2043” add1="" add2="" city="" state="" country="" zip="" contact="" phone="" fax="" email="" web=""/>
<EXHIBITOR ex_name=“Available - 10’ x 10’” c_ID="" booth_ID=“2142” add1="" add2="" city="" state="" country="" zip="" contact="" phone="" fax="" email="" web=""/>
</EXHIBITORS>
how would I go about breaking the load down so that its not trying to load the whole XML all at once?