title: my shapes aren't changing colors I'm not sure why
body: <p>I have a code that draws a bunch of customized shapes from an xml... I want to make each shape select-able /de-selectable by changing the color of the object and changing backk all other colors when things change but my codes broken but i'm not getting any errors or anything it just doesn't work. </p>
  
  <pre><code>        var graphicsShape
  
   function drawLayer(layer){
      for (var i =0; i &lt; xmlDoc.getElementsByTagName("polygon").length; i++)
          {
              if (layer == xmlDoc.getElementsByTagName("polygon")[i].childNodes[0].attributes[4].value)
                 { drawSegment(i);
                 }
          }
  
      }
       // layer = index z     
  
   function drawSegment(a){
  
      var vertexList =  xmlDoc.getElementsByTagName("polygon")[a].childNodes;
      var graphicsObject = new createjs.Graphics();
  
      graphicsShape = new createjs.Shape(graphicsObject);
  
  
  
      graphicsObject.setStrokeStyle(1);
      graphicsObject.beginStroke(createjs.Graphics.getRGB(0,0,0));
      graphicsObject.beginFill(createjs.Graphics.getRGB(255,0,0));
  
  
      for(var i = 0; i &lt; vertexList.length; i++){ 
  
             graphicsObject.lineTo(vertexList[i].attributes[2].value,  vertexList[i].attributes[3].value)
  
             stage.addChild(graphicsShape);
  
             }
  
     segmentsArray.push(graphicsShape);
     //createContainer(segmentsArray[i]);
     }
  
  
   function createArraysForSegments() {
  
       for(var i=0; i &lt;segmentsArray.length; i++){
            segmentsData[i] = new Array;
            }
       }
  
  
   function ColorChangeAddEventListener() {
       for(var i = 0; i &lt; segmentsArray.length; i++){ 
             segmentsArray[i].addEventListener('click', colorChange(i));
             }
       }
  
   function colorChange(index){
       segmentsArray[index].graphics.beginFill('white');
       stage.update();
       }
  </code></pre>
  
  <p>i call the functions later
       ColorChangeAddEventListener();
       drawLayer(0);
       stage.update(); </p>
  
  <p>if i type segmentsArray[0].alpha =0.5; it works for that shape, but when I put it in segmentsArray[0].addEventsListener('click', function){segmentsArray[0].alpha=0.5;}) that doesn't work</p>