1 Reply Latest reply on Jun 20, 2007 12:44 PM by ntsiii

    Handle and modify dynamically added sprite

    kerst001 Level 1
      I have a loop that reads information in from an xml file, then for each item draws a line to show a relationship:

      var child:Sprite = new Sprite();
      child.graphics.lineStyle(2,0x999999,1);
      child.graphics.beginFill(0);
      child.graphics.moveTo(x1, y1);
      child.graphics.lineTo(x2, y2);
      child.graphics.endFill();
      child.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
      cont.addChild(child);

      However, since I am looping through and adding them I do not know how to modify it in the event handler. What I would like to do is be able to change the color of it as you mouseover. Anyone have any direction on how to modify the sprite in the event handler?

      Thanks,