Menu

Line class

Help
2007-01-08
2013-04-01
  • -==AIRWOLF==-

    -==AIRWOLF==- - 2007-01-08

    To draw a line using this class is not a problem. Nevertheless, I do not understand how this line can be modified after being drawn (i.e. without adding a new line).

    For example: a line was drawn with a thickness of 10, color red and alpha 50%. This line should, in the next step, become (change) a line with a thickness of 5, color green and alpha 90%.

    What can i do??

    Thx for helping!

    Best Regards
    AIRWOLF2k

     
    • Alex Uhlmann

      Alex Uhlmann - 2007-01-10

      You could clear the existing curve, change the line styles and draw (or animate) it again. Like the below:

      var myLine:Line = new Line(0,0,275,200);
      myLine.lineStyle(20,0xff0000,50);
      myLine.draw();

      someButton.onRelease = function()
      {
          trace( "onRelease" );
          myLine.clear();
          myLine.lineStyle(2,0x000000,100);
          myLine.draw();
      }

       
      • Alex Uhlmann

        Alex Uhlmann - 2007-01-10

        Actually, you won't even need that clear.

         

Log in to post a comment.