14 Replies Latest reply on Jun 10, 2010 5:35 AM by RonnieCR7

    Drawing a line and changing its color on clicking


      Hi All,

      I wanna be able to change the color of a line on clicking it. How do i do it?


      Sample code:

      var drawLine : MovieClip = new MovieClip();

      drawLine.lineStyle(1, 0x0000)

      drawLine.moveTo(x1, y1)

      drawLine.lineTo(x2, y2)

      drawLine.addEventListener(MouseEvent.CLICK, func);


      Now inside the func() function, what should i do to change its color????