Hello All,
This is my first post on this forum so I hope that you guys can help. I’m trying to filter some data from a XML file but flash keeps telling me that my child node is not available. I have checked the file several times with no luck. This is my first time using XML with AS3 so any help would be appreciated. This is still a work in progress but I’d like to be able to filter this data. I don’t know if the XML file is too large or what. Here is the AS:
import fl.containers.ScrollPane;
import fl.controls.TextArea;
var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML = new XML();
xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
xmlLoader.load(new URLRequest(“http://mainstreetlvnm.org/xmltest/AssetDatabase.xml”));
function LoadXML(e:Event):void {
xmlData = new XML(e.target.data);
ParseProperties(xmlData);
}
function ParseProperties(propertyInput:XML):void {
trace(“XML Output”);
trace("------------------------");
var addressArray = new Array()
var authorList:XMLList = propertyInput.Properties.(Occupancy == “Vacant”).Physical_x0020_Address;
trace(authorList)
var yLoc:Number = 0
var sp:ScrollPane = new ScrollPane();
sp.setSize(335, 360);
sp.move(195,13)
var textSource:MovieClip = new MovieClip();
for (var i:int = 0; i < authorList.length(); i++) {
var authorElement:XML = authorList*;
var myTextArea:TextArea = new TextArea()
myTextArea.setSize(300, 50);
myTextArea.move(0, yLoc);
textSource.addChild(myTextArea);
myTextArea.editable =false
myTextArea.text = authorElement
yLoc = yLoc + 50
addressArray.push(authorElement);
//trace(authorElement);
}
sp.source = textSource
addChild(sp);
}