# Drawing API Tutorial

**URL:** <https://forum.kirupa.com/t/drawing-api-tutorial/146095>\
**Category:** Uncategorized\
**Created:** [April 28, 2005, 5:55am UTC](https://forum.kirupa.com/t/drawing-api-tutorial/146095 "2005-04-28T05:55:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shinji3c](https://avatars.discourse-cdn.com/v4/letter/s/8c91f0/32.png) [@shinji3c](https://forum.kirupa.com/u/shinji3c)\
**Post date:** [April 28, 2005, 5:55am UTC](https://forum.kirupa.com/t/drawing-api-tutorial/146095/1 "2005-04-28T05:55:07Z")

</div>

Hi  
I was trying to learn some script from the tutorial but in drawing API tutorial,  
this script to draw polygon;

\_root.createEmptyMovieClip(“holder”,1);  
holder.lineStyle(1,0,100);  
width=30;  
myPoints=[[50-width,50-width],[50+width,50-width],[50+width,50+width],[50-width,50+width],[50-width,50-width]];  
holder.moveTo(this.myPoints[0][0],this.myPoints[0][1]);  
for (var j=1;j \< myPoints.length;j++)  
holder.lineTo(this.myPoints[j][0],this.myPoints[j][1]);

but all it does is draw square…  
I copied and pasted in my flash but i only end up drawing square. What am i doing wrong???  
Thanks in advance
