<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: lineTo code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Tue, 07 Oct 2008 18:27:55 GMT</pubDate>
    <description>DZone Snippets: lineTo code</description>
    <item>
      <title>Actionscript Draw Box</title>
      <link>http://snippets.dzone.com/posts/show/3377</link>
      <description>Function to draw a box with a specified width, height, and color, and return the box MovieClip&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;function draw_box(w,h,c){&lt;br /&gt;	var new_box = this.createEmptyMovieClip("new_box", this.getNextDepth());&lt;br /&gt;	new_box.beginFill(c);&lt;br /&gt;	new_box.lineStyle(0,0x000000,0);&lt;br /&gt;	new_box.moveTo(0, 0);&lt;br /&gt;	new_box.lineTo(w, 0);&lt;br /&gt;	new_box.lineTo(w, h);&lt;br /&gt;	new_box.lineTo(0, h);&lt;br /&gt;	new_box.lineTo(0, 0);&lt;br /&gt;	new_box.endFill();&lt;br /&gt;	return new_box;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Sample function call draws a 200w x 25h pixel, black box:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;draw_box(200,25,0x000000);&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sat, 27 Jan 2007 03:00:29 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3377</guid>
      <author>bgidge (Bryan Gidge)</author>
    </item>
  </channel>
</rss>
