3 Replies Latest reply on Dec 12, 2007 11:09 PM by Pratap Reddy

    Problem draw line

    y.muny
      I have one problem with this code for draw line

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" mouseMove="fn_init()">
      <mx:Script>
      <![CDATA[
      private function fn_init():void{
      var g:Graphics = graphics;
      this.removeAllChildren();
      g.lineStyle(1, 0x999999);
      g.lineTo(0,0);
      g.moveTo(this.mouseX, this.mouseY);
      this.addChild(g);
      }
      ]]>
      </mx:Script>
      </mx:Application>

      Above this code it display error when i complie it
      "1067: Implicit coercion of a value of type flash.display:Graphics to an unrelated type flash.display:DisplayObject."

      Please help me to solve this problem.