Quantunet.com

My Account

Joins Us
Flash 8 Actionscript 2.0 Knowledgebase
Drawing A Line  

Download .fla

How to draw this line with Actionscript.

Actionscript

_root.lineStyle(3, 0x0000FF, 100);
_root.lineTo(150, 100);





The first section of code: " _root.lineStyle(3, 0x0000FF, 100); " tells flash HOW to draw the line. First it specifies the thickness of the line in pixels, the color of the line in hexadecimal then the level of transparency (alpha channel percentage).

 

The second line of code: " _root.lineTo(150, 100); " commands flash to "draw a line". Since Flash by begins drawing the line a the point (0,0) by default the line is drawn from (0,0) to (150,100). The numbers 150 and 100 correspond the the coordinates of x and y respectively.


© 2008 Quantunet LLC All Rights Reserved | Intellectual Property | Terms of Use | Privacy
Home | About Quantunet | FAQ's | Contact Us