title: read data from xml - read only last value
body: <p>I have xml file with data like name, discription and Xcor, Ycor.
  I made each of object display on stage in this place what write in xml X and Ycor
  I also made for each diffrent name other MC - it's work well
  But when i try option trace to show name of MC after rollOver on it - it always show name "Karkow" - but is wrong becouse every of this MC had diffrent name in xml file</p>
  
  <p>Do You have any idea why it's always see Krakow against other name?</p>
  
  <p>This is my xml code:</p>
  
  <pre><code>  &lt;?xml version="1.0" encoding="utf-8" ?&gt; 
  - &lt;XML&gt;
  - &lt;myXMLList&gt;
  - &lt;object&gt;
    &lt;name&gt;Warszawa&lt;/name&gt; 
    &lt;opis&gt;jakis opis&lt;/opis&gt; 
    &lt;Xcor&gt;100&lt;/Xcor&gt; 
    &lt;Ycor&gt;50&lt;/Ycor&gt; 
    &lt;/object&gt;
  - &lt;object&gt;
    &lt;name&gt;Wroclaw&lt;/name&gt; 
    &lt;opis&gt;jakis opis2&lt;/opis&gt; 
    &lt;Xcor&gt;20&lt;/Xcor&gt; 
    &lt;Ycor&gt;200&lt;/Ycor&gt; 
    &lt;/object&gt;
  - &lt;object&gt;
    &lt;name&gt;Krakow&lt;/name&gt; 
    &lt;opis&gt;jakis opis3&lt;/opis&gt; 
    &lt;Xcor&gt;50&lt;/Xcor&gt; 
    &lt;Ycor&gt;250&lt;/Ycor&gt; 
    &lt;/object&gt;
    &lt;/myXMLList&gt;
    &lt;/XML&gt;
  </code></pre>
  
  <p>And this my as3 code:</p>
  
  <pre><code>import flash.display.MovieClip;
  import flash.display.Shape;
  import flash.accessibility.Accessibility;
  import flash.display.DisplayObject;
  import flash.geom.Point;
  import flash.events.Event;
  import flash.events.MouseEvent;
  
  
  
  
  // Initialize the XML, place the xml file name, initialize the URLRequest
  // put URLRequest into a new URLLoader, and add event listener on 
  // myLoader listening for when the XML loading is complete
  var myXML:XML = new XML();
  var XML_URL:String = "miasta.xml";
  var myXMLURL:URLRequest = new URLRequest(XML_URL);
  var myLoader:URLLoader = new URLLoader(myXMLURL);
  myLoader.addEventListener("complete", xmlLoaded);
  
  // Create the xmlLoaded function
  function xmlLoaded(event:Event):void {
  
      // Place the xml data into the myXML object
      myXML = XML(myLoader.data);
      // Initialize and give var name to the new external XMLDocument
      var xmlDoc:XMLDocument = new XMLDocument();
      // Ignore spacing around nodes
      xmlDoc.ignoreWhite = true;
      // Define a new name for the loaded XML that is the data in myLoader
      var menuXML:XML = XML(myLoader.data);
      // Parse the XML data into a readable format
      xmlDoc.parseXML(menuXML.toXMLString());
  
           // Run the "for each" loop to iterate through all of the menu items listed in the external XML file
           for each (var object:XML in myXML..object) {
  
                   // Access the value of the "name" node in our external XML file
                   var name:String = object.name.toString();
                   // Access the value of the "opis" node in our external XML file
                   var opis:String = object.opis.toString();
                   // zmiana koordynat na string
                   var Xcor:String = object.Xcor.toString();
                   var Ycor:String = object.Ycor.toString();
                   //change coordinate to number
                   var XcorNum = Number(Xcor);
                   var YcorNum = Number(Ycor);
  
  
  
                   if (name == "Warszawa") {
                       var myMovieClip:MovieClip = new Policja();
  
  
                   }
  
                   else if (name == "Wroclaw") {
  
                   var myMovieClip:MovieClip = new owal();
  
                   }
  
                    else if (name == "Krakow") {
  
                   var myMovieClip:MovieClip = new city();
  
                   }
  addChild(myMovieClip);
  // Set the location of the new MovieClip
  myMovieClip.x = XcorNum;
  myMovieClip.y = YcorNum;
  
  myMovieClip.addEventListener(MouseEvent.ROLL_OVER, onRollOverHandler);
  
  
  
  myMovieClip.buttonMode = true;
  myMovieClip.useHandCursor = true;
  
  
  
  
  function onRollOverHandler(myEvent:MouseEvent){
      trace (name);
  }
  </code></pre>