I am facing problem in read text from xml file

Hi all,

I am facing problem in displaying data on mouseover on the moviclip. My requirement is fill color to the movie clip reading color code from xml file and when rollover on the movie clip the respective data should display. I am able to fill color but failed to display data (data I have mentioned in “range” in my xml file. Please see the code below.

Please help me.

import mx.utils.Delegate;
var dots:XML = new XML();
dots.load(’…/xml_doc/dist_aber.xml’);
_global.style.setStyle(“fontFamily”, “Verdana”);
_global.style.setStyle(“fontSize”, 11);
dots.onLoad = function(success:Boolean){
if(success){
if(dots.status == 0){
var dotsToXMLString:String = new String(); // initializes a new string variable
dotsToXMLString = dots.toString(); // converts dots XML object to a string and stores it in dotsToXMLString.

var dotsXML:XML = new XML(dotsToXMLString);// creates new XML object with the string contents from above.
dotsXML.parseXML(dotsToXMLString);   // parses the string from above.

var dotsNodes:Object = dotsXML.firstChild; // Saves the firstChild (in this case, the outermost element) as an object
var dotsNodesChildren:Object = dotsNodes.childNodes; // Saves the childNodes of firstChild as an object
   
for(i=0;i<dotsNodesChildren.length;i++){  
var newObj:Object = dotsNodes.childNodes*.attributes.id;
var newtextObj:Object = dotsNodes.childNodes*.attributes.id;// creates a new object out of the child node's id.

var newObjColor:Color = new Color(newObj); // creates a new color object with newObj as its target
var theColor:Number = dotsNodes.childNodes*.attributes.color; //retrieves the hex code value (number) of the attribute color        
var newObjText:Object = new Object(newtextObj);
var theText:TextField = dotsNodes.childNodes*.attributes.range;

newObjColor.setRGB(theColor); // sets the RGB value of newObjColor.    
textBox.text = _root.theText; 
}

} else {
trace(“Problem parsing XML.”);
}
} else{
trace(“Could not load XML”);
}
}

XML

<dots>
<dot id=“d1_mc” color=“0xc10016” range=“asfasfasf” />
<dot id=“d2_mc” color=“0xc10016” range=“asfasfasf” />
<dot id=“d3_mc” color=“0xCC0099” range=“fqwtqwt” />
<dot id=“d4_mc” color=“0xCC0099” range=“qwtwt” />
<dot id=“d5_mc” color=“0xc10016” range=“qtqwtq” />
<dot id=“d6_mc” color=“0x000000” range=“qwtqwt” />
<dot id=“d7_mc” color=“0xCC0099” range=“qtqwtq” />
<dot id=“d8_mc” color=“0xc10016” range=“wtwtq” />
<dot id=“d9_mc” color=“0xc10016” range=“qwttq” />
<dot id=“d10_mc” color=“0x000000” range=“qtqwt” />
<dot id=“d11_mc” color=“0xc10016” range=“qwtwtq” />
<dot id=“d12_mc” color=“0xc10016” range=“qwtqwet” />
</dots>