Hi list...
I'm still relatively new with E4X. I can't get seem to get this function to
return the name of the floor that the department is on. I.E., pass a string,
traverse the xml, get the parent's name attribute. In my second attempt, I
figured to test for the property name first, because the root node doesn't have
@name, but still no luck. This should be easy, right? It's probably obvious.
Thanks,
- Michael M.
private function getFloor(deptName:String):void{
// always errors
var theFilteredList:XMLList = FloorplanData..*.(@name==thisLabel);
// this doesn't work either
var f:XMLList = FloorplanData.*.(hasOwnProperty("name") &&
attribute("name")==thisLabel);
}
<?xml version="1.0" encoding="utf-8"?>
<FloorplanData>
<floor name="1">
<dept name="Administration"/>
<dept name="Reception"/>
</floor>
<floor name="2">
<dept name="Human Resources"/>
<dept name="Finance"/>
</floor>
<floor name="3">
<dept name="Marketing"/>
<dept name="Accounting"/>
</floor>
<floor name="4">
<dept name="Sales"/>
<dept name="Legal"/>
</floor>
</FloorplanData>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders