I've created an amount of MC based on my XMLlist, and each assign with an attribute/ID stated in the XML. I'm now trying to trace back the parent of the assigned MC properties, how could I do that?
The XML:
<MEMBER NAME="Todd" ID="001">
<MEMBER NAME="Popia" ID="003">
</MEMBER>
<MEMBER NAME="Popia2" ID="004">
<MEMBER NAME="Awesome" ID="005">
</MEMBER>
</MEMBER>
</MEMBER>
And here'es the Actionscript
private function Members():void {
//trace(myXML.children().attribute("ID"));
xmlList=myXML.children();
for each (myXML in xmlList) {
circles.x=Math.floor(Math.random()*100)-50;
circles.y=Math.floor(Math.random()*100)-50;
circles.buttonMode=true;
circles.addEventListener(MouseEvent.CLICK, clickTarget);
addChild(circles);
circles.name=myXML.attribute("ID");
}
}
private function clickTarget(event:MouseEvent):void {
//trace(event.target.name);
//trace(event.target.parent().attribute("ID"));
//trying to trace previous assgined att MC position
trace("click");
}