AS3 combo box referencing xml

Mallubeats

New Member
I'm pretty new to actionscript, I have this scenerio. I have a combo box "elementPicker", I have a project that loads images from an XML file, the XML file is set up like\[code\]<elements><head> <imgpath>/img/x.png</imgpath></head><head>...</head><head>...</head><eyes>...</eyes><eyes>...</eyes><eyes>...</eyes></elements>\[/code\]And so on, so in my combo box I'll have options like "head", "eyes", and so on. What I want is based on the data in the combo box to change which xml element gets loaded into my array that holds the image pathsI tried something like\[code\]var comboSelection:String = elementPicker.selectedItem.label;\[/code\]then, when I'm looping to put the paths in the array:\[code\]elementPathList.push(theXMLData.comboSelection.imgpath[ b ]);\[/code\]But this isn't working, the output shows: TypeError: Error #1009: Cannot access a property or method of a null object reference.Any idea on how to do this?
 
Back
Top