# moveTo, lineTo

**URL:** <https://forum.kirupa.com/t/moveto-lineto/8012>\
**Category:** flash\
**Created:** [November 12, 2002, 12:36pm UTC](https://forum.kirupa.com/t/moveto-lineto/8012 "2002-11-12T12:36:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![maggi](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@maggi](https://forum.kirupa.com/u/maggi)\
**Post date:** [November 12, 2002, 12:36pm UTC](https://forum.kirupa.com/t/moveto-lineto/8012/1 "2002-11-12T12:36:03Z")

</div>

hai guys,🙂

i m just trying to draw a square using “moveTo” and “lineTo”, but i m not able to understand the parameters of this command, i.e , how give the x value and y value, can any body clearly explain how to draw a sqaure using these command

thx  
maggi

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 12, 2002, 2:16pm UTC](https://forum.kirupa.com/t/moveto-lineto/8012/2 "2002-11-12T14:16:24Z")

</div>

imagine that there is a hidden pencil which can be moved to any place by moveTo and a line can be drawn between 2 points with it by using lineTo.  
first you need to move the pencil to the first corner of the square.  
e.g. line.moveTo(100,100);  
then you need to draw a line to the 2nd corner using lineTo  
e.g. line.lineTo(100,200);  
[http://www.kirupa.com/developer/actionscript/as\_tricks.asp](http://www.kirupa.com/developer/actionscript/as_tricks.asp)  
choose drawing API. Ilyas can explain better than me…🙂
