11 Replies Latest reply on Aug 19, 2009 1:46 AM by Nishant28

    Problem with drawing a new Shape in Flex


      Hi There!


      I'm new at Flex and AS3 (don't laugh at me). I have a problem trying to draw a shape. The Alert fires, but the shape doesn't display. Looking for help.


      The code:









      <?xml version="1.0" encoding="utf-8"?>




      xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="drawTrapecio();"








      import mx.graphics.*;







      import flash.display.*;



      import mx.controls.Alert;






      public function drawTrapecio():void





      var trapecio:Shape = new Shape;


      // eventually, I replace Sprite for Shape, like this: var trapecio:Sprite = new Sprite, to no avail.

      trapecio.graphics.lineStyle(5, 0x000000);

      trapecio.graphics.moveTo(100, 100);

      trapecio.graphics.lineTo(200, 50);

      trapecio.graphics.lineTo(200, 350);

      trapecio.graphics.lineTo(50, 400);









      I really appreciate any help you can give.