1 Reply Latest reply on Aug 14, 2007 3:49 AM by koushks

    Draw line

    y.muny
      Hi everyone.

      Now i have some problem with draw line in Flex Builder 2. I want to draw only one line with this code, but it display nothing.
      so i don't know how to solve this problem. Can you help me?

      var g:Graphics = graphics;
      g.lineStyle(1, 0x999999);
      g.lineTo(0,0);
      g.moveTo(this.mouseX, this.mouseY);

        • 1. Re: Draw line
          koushks
          The code you have written creates a graphic object like you need it. The only thing left is to add it to the parent application, so that it shows up there.

          At the end, just add:
          this.addChild(g);

          This should do it.