I am just starting to look at the drawing capabilities of Flex.  I'm
trying to get an example working from the Essential ActionScript 3.0
book but it does not work for me.  It seems awfully simple.  Here is
what the book gives for the example to draw 4 different lines:

                        var canvas:Shape = new Shape();
                        canvas.graphics.lineStyle(1, 0x000000);
                        canvas.graphics.lineTo(100, 0);
                        canvas.graphics.lineStyle(5, 0xFF0000);
                        canvas.graphics.lineTo(100, 100);
                        canvas.graphics.lineStyle(10, 0x00FF00);
                        canvas.graphics.lineTo(0, 100);
                        canvas.graphics.lineStyle(15, 0x0000FF);
                        canvas.graphics.lineTo(0, 0);
                        
                        addChild(canvas);                       

I created a mxml application and placed the above code in a myInit()
function and I call the myInit() function from the creationComplete
event of the Application object.

When I run the application, nothing happens.  The book says it should
show a simple box with different sized lines.  

Anything else I need to do?

Thanks!

Reply via email to