<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>ActionSnippet</title>
	<atom:link href="http://actionsnippet.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://actionsnippet.com</link>
	<description>paste it in your timeline - or in your constructor</description>
	<pubDate>Thu, 08 Jul 2010 17:50:51 +0000</pubDate>
	
	<language>en</language>
			<item>
		<title>Quick IE Test</title>
		<link>http://actionsnippet.com/?p=2940</link>
		<comments>http://actionsnippet.com/?p=2940#comments</comments>
		<pubDate>Thu, 08 Jul 2010 17:50:51 +0000</pubDate>
		<dc:creator>Zevan</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://actionsnippet.com/?p=2940</guid>
		<description><![CDATA[Found this today, not related to actionscript but rather nice. It allows you to take a screen shot of your website in IE&#8230; if your on a mac without windows this is a quick way to test in a pinch:
http://ipinfo.info/netrenderer/index.php
]]></description>
			<content:encoded><![CDATA[<p>Found this today, not related to actionscript but rather nice. It allows you to take a screen shot of your website in IE&#8230; if your on a mac without windows this is a quick way to test in a pinch:</p>
<p><a href="http://ipinfo.info/netrenderer/index.php">http://ipinfo.info/netrenderer/index.php</a></p>
]]></content:encoded>
			<wfw:commentRss>http://actionsnippet.com/?feed=rss2&amp;p=2940</wfw:commentRss>
		</item>
		<item>
		<title>Circle Fitting</title>
		<link>http://actionsnippet.com/?p=2938</link>
		<comments>http://actionsnippet.com/?p=2938#comments</comments>
		<pubDate>Sat, 05 Jun 2010 14:29:24 +0000</pubDate>
		<dc:creator>Zevan</dc:creator>
		
		<category><![CDATA[Graphics]]></category>

		<category><![CDATA[misc]]></category>

		<category><![CDATA[motion]]></category>

		<category><![CDATA[actionscript]]></category>

		<category><![CDATA[as3]]></category>

		<category><![CDATA[flash]]></category>

		<category><![CDATA[s]]></category>

		<guid isPermaLink="false">http://actionsnippet.com/?p=2938</guid>
		<description><![CDATA[CLICK HERE TO COPY
Actionscript:




var circs:Array = &#91;&#93;


var circNum:int = 600;


addEventListener&#40;Event.ENTER_FRAME, onAdd&#41;;


function onAdd&#40;evt:Event&#41;:void &#123;


&#160; &#160; if &#40;circs.length &#60;circNum&#41;&#123;


&#160; &#160; &#160; &#160; makeGrowable&#40;&#41;;


&#160; &#160; &#125;


&#125;


&#160;


function makeGrowable&#40;&#41;&#123;


&#160; &#160; 


&#160; &#160; var s:MovieClip = MovieClip&#40;addChild&#40;new MovieClip&#40;&#41;&#41;&#41;;


&#160; &#160; s.x = Math.random&#40;&#41; * stage.stageWidth;


&#160; &#160; s.y = Math.random&#40;&#41; * stage.stageHeight;


&#160; &#160; with&#40;s.graphics&#41;&#123;


&#160; &#160; &#160; &#160; lineStyle&#40;0,0&#41;;


&#160; &#160; &#160; &#160; drawCircle&#40;0,0,10&#41;;


&#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<div class="igBar"><span id="lactionscript-2"><a href="#" onclick="javascript:showPlainTxt('actionscript-2'); return false;">CLICK HERE TO COPY</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-2">
<div class="actionscript" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">var</span> circs:<span style="color: #0066CC;">Array</span> = <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">var</span> circNum:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;color:#800000;">600</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">addEventListener<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>, onAdd<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">function</span> onAdd<span style="color: #66cc66;">&#40;</span>evt:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>circs.<span style="color: #0066CC;">length</span> <span style="color: #66cc66;">&lt;</span>circNum<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; makeGrowable<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">function</span> makeGrowable<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> s:<span style="color: #0066CC;">MovieClip</span> = <span style="color: #0066CC;">MovieClip</span><span style="color: #66cc66;">&#40;</span>addChild<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">MovieClip</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; s.<span style="color: #006600;">x</span> = <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">*</span> <span style="color: #0066CC;">stage</span>.<span style="color: #006600;">stageWidth</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; s.<span style="color: #006600;">y</span> = <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">*</span> <span style="color: #0066CC;">stage</span>.<span style="color: #006600;">stageHeight</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #0066CC;">with</span><span style="color: #66cc66;">&#40;</span>s.<span style="color: #006600;">graphics</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">lineStyle</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">0</span>,<span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; drawCircle<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">0</span>,<span style="color: #cc66cc;color:#800000;">0</span>,<span style="color: #cc66cc;color:#800000;">10</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; s.<span style="color: #006600;">scaleX</span> = s.<span style="color: #006600;">scaleY</span> = <span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; circs.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span>s<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; s.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>, onScaleUp<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">function</span> onScaleUp<span style="color: #66cc66;">&#40;</span>evt:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> c:<span style="color: #0066CC;">MovieClip</span> = <span style="color: #0066CC;">MovieClip</span><span style="color: #66cc66;">&#40;</span>evt.<span style="color: #006600;">currentTarget</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; c.<span style="color: #006600;">scaleX</span> = c.<span style="color: #006600;">scaleY</span> += <span style="color: #cc66cc;color:#800000;">0.05</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;color:#800000;">0</span>; i<span style="color: #66cc66;">&lt;</span>circs.<span style="color: #0066CC;">length</span>; i++<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> circ:<span style="color: #0066CC;">MovieClip</span> = circs<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>circ <span style="color: #66cc66;">!</span>= c<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> amt:<span style="color: #0066CC;">Number</span> = circ.<span style="color: #0066CC;">width</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;color:#800000;">2</span> + c.<span style="color: #0066CC;">width</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;color:#800000;">2</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> dx:<span style="color: #0066CC;">Number</span> = circ.<span style="color: #006600;">x</span> - c.<span style="color: #006600;">x</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> dy:<span style="color: #0066CC;">Number</span> = circ.<span style="color: #006600;">y</span> - c.<span style="color: #006600;">y</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> dist:<span style="color: #0066CC;">Number</span> = <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">sqrt</span><span style="color: #66cc66;">&#40;</span>dx <span style="color: #66cc66;">*</span> dx + dy <span style="color: #66cc66;">*</span> dy<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>amt<span style="color: #66cc66;">&gt;</span> dist<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; c.<span style="color: #006600;">removeEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>, onScaleUp<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>c.<span style="color: #006600;">scaleX</span> <span style="color: #66cc66;">&lt;</span><span style="color: #cc66cc;color:#800000;">0.1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>contains<span style="color: #66cc66;">&#40;</span>c<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; removeChild<span style="color: #66cc66;">&#40;</span>c<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Circle fitting is one of those things I've never bothered to do... today I figured I'd give it a try and this is what I came up with. I posted it on wonderfl:</p>
<div style="text-align:center;width:465px;"><iframe title="CircleFitting - wonderfl build flash online" scrolling="no" src="http://wonderfl.net/blogparts/hZCr" width="465" height="490" style="border:1px black solid;"></iframe><a href="http://wonderfl.net/c/hZCr" title="CircleFitting - wonderfl build flash online">CircleFitting - wonderfl build flash online</a></div>
]]></content:encoded>
			<wfw:commentRss>http://actionsnippet.com/?feed=rss2&amp;p=2938</wfw:commentRss>
		</item>
		<item>
		<title>Fill in the Blank</title>
		<link>http://actionsnippet.com/?p=2936</link>
		<comments>http://actionsnippet.com/?p=2936#comments</comments>
		<pubDate>Fri, 04 Jun 2010 14:56:41 +0000</pubDate>
		<dc:creator>Zevan</dc:creator>
		
		<category><![CDATA[TextField]]></category>

		<category><![CDATA[UI]]></category>

		<category><![CDATA[actionscript]]></category>

		<category><![CDATA[as3]]></category>

		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://actionsnippet.com/?p=2936</guid>
		<description><![CDATA[CLICK HERE TO COPY
Actionscript:




var story:String = &#34;Fill in the _____.&#34;;


&#160;


&#160;


var txt:TextField = new TextField&#40;&#41;;


txt.defaultTextFormat = new TextFormat&#40;&#34;Georgia&#34;, 20&#41;;


txt.width = stage.stageWidth;


txt.multiline = true;


txt.wordWrap = true;


txt.text = story;


addChild&#40;txt&#41;;


&#160;


var alph:Array = &#34;abcdefghijklmnopqrstuvwxyz&#34;.split&#40;&#34;&#34;&#41;;


var keys:Object = &#123;&#125;;


for &#40;var i:int = 0; i&#60;alph.length; i++&#41;&#123;


&#160; &#160; keys&#91;65 + i&#93; = alph&#91;i&#93;;


&#125;


stage.addEventListener&#40;KeyboardEvent.KEY_DOWN, onKeyPressed&#41;;


function onKeyPressed&#40;evt:KeyboardEvent&#41;:void&#123;


&#160; &#160; &#160;


&#160; &#160; if &#40;evt.keyCode == Keyboard.ENTER&#41;&#123;


&#160; &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<div class="igBar"><span id="lactionscript-4"><a href="#" onclick="javascript:showPlainTxt('actionscript-4'); return false;">CLICK HERE TO COPY</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-4">
<div class="actionscript" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">var</span> story:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;Fill in the _____.&quot;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">var</span> txt:<span style="color: #0066CC;">TextField</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">TextField</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">txt.<span style="color: #006600;">defaultTextFormat</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">TextFormat</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Georgia&quot;</span>, <span style="color: #cc66cc;color:#800000;">20</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">txt.<span style="color: #0066CC;">width</span> = <span style="color: #0066CC;">stage</span>.<span style="color: #006600;">stageWidth</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">txt.<span style="color: #0066CC;">multiline</span> = <span style="color: #000000; font-weight: bold;">true</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">txt.<span style="color: #0066CC;">wordWrap</span> = <span style="color: #000000; font-weight: bold;">true</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">txt.<span style="color: #0066CC;">text</span> = story;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">addChild<span style="color: #66cc66;">&#40;</span>txt<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">var</span> alph:<span style="color: #0066CC;">Array</span> = <span style="color: #ff0000;">&quot;abcdefghijklmnopqrstuvwxyz&quot;</span>.<span style="color: #0066CC;">split</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;&quot;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">var</span> keys:<span style="color: #0066CC;">Object</span> = <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;color:#800000;">0</span>; i<span style="color: #66cc66;">&lt;</span>alph.<span style="color: #0066CC;">length</span>; i++<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; keys<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">65</span> + i<span style="color: #66cc66;">&#93;</span> = alph<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0066CC;">stage</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>KeyboardEvent.<span style="color: #006600;">KEY_DOWN</span>, onKeyPressed<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">function</span> onKeyPressed<span style="color: #66cc66;">&#40;</span>evt:KeyboardEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>evt.<span style="color: #006600;">keyCode</span> == Keyboard.<span style="color: #0066CC;">ENTER</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; story = <span style="color: #ff0000;">&quot;Fill in the _____.&quot;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; txt.<span style="color: #0066CC;">text</span> = story;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;color:#800000;">0</span>; i<span style="color: #66cc66;">&lt;</span>story.<span style="color: #0066CC;">length</span>; i++<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>story.<span style="color: #0066CC;">charAt</span><span style="color: #66cc66;">&#40;</span>i<span style="color: #66cc66;">&#41;</span> == <span style="color: #ff0000;">&quot;_&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> head:<span style="color: #0066CC;">String</span> = story.<span style="color: #0066CC;">substr</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">0</span>, i<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> tail:<span style="color: #0066CC;">String</span> = story.<span style="color: #0066CC;">substr</span><span style="color: #66cc66;">&#40;</span>i + <span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> letter:<span style="color: #0066CC;">String</span> = keys<span style="color: #66cc66;">&#91;</span>evt.<span style="color: #006600;">keyCode</span><span style="color: #66cc66;">&#93;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">!</span>letter<span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; story = head + letter + tail;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; txt.<span style="color: #0066CC;">text</span> = story;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">break</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>I needed to do a fill in the blank for a personal project that I'm working on and this is what I came up with. Have a look at the swf here:</p>
<p>(you need to click first so you can type with the keyboard):<br />
<a href="http://actionsnippet.com/swfs/text_entry.html" target="blank">Fill in the blank</a></p>
]]></content:encoded>
			<wfw:commentRss>http://actionsnippet.com/?feed=rss2&amp;p=2936</wfw:commentRss>
		</item>
		<item>
		<title>Epicycloid Again</title>
		<link>http://actionsnippet.com/?p=2933</link>
		<comments>http://actionsnippet.com/?p=2933#comments</comments>
		<pubDate>Fri, 14 May 2010 15:54:50 +0000</pubDate>
		<dc:creator>Zevan</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[actionscript]]></category>

		<category><![CDATA[as3]]></category>

		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://actionsnippet.com/?p=2933</guid>
		<description><![CDATA[CLICK HERE TO COPY
Actionscript:




var xp:Number = 0;


var yp:Number = 0;


var t:Number = 0;


var a:Number = 100;


var b:Number = 10;


x = stage.stageWidth / 2;


y = stage.stageHeight / 2;


&#160;


graphics.lineStyle&#40;0,0x000000&#41;;


addEventListener&#40;Event.ENTER_FRAME, onRun&#41;;


function onRun&#40;evt:Event&#41;:void &#123;


&#160; &#160; var p:Number = &#40;&#40;a + b&#41;/b&#41;*t


&#160; &#160; xp = &#40;a + b&#41; * Math.cos&#40;t&#41; - b * Math.cos&#40;p&#41;;


&#160; &#160; yp = &#40;a + b&#41; [...]]]></description>
			<content:encoded><![CDATA[<div class="igBar"><span id="lactionscript-6"><a href="#" onclick="javascript:showPlainTxt('actionscript-6'); return false;">CLICK HERE TO COPY</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-6">
<div class="actionscript" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">var</span> xp:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">var</span> yp:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">var</span> t:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">var</span> a:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;color:#800000;">100</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">var</span> b:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;color:#800000;">10</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">x = <span style="color: #0066CC;">stage</span>.<span style="color: #006600;">stageWidth</span> <span style="color: #66cc66;">/</span> <span style="color: #cc66cc;color:#800000;">2</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">y = <span style="color: #0066CC;">stage</span>.<span style="color: #006600;">stageHeight</span> <span style="color: #66cc66;">/</span> <span style="color: #cc66cc;color:#800000;">2</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">graphics.<span style="color: #0066CC;">lineStyle</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">0</span>,0x000000<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">addEventListener<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>, onRun<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">function</span> onRun<span style="color: #66cc66;">&#40;</span>evt:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> p:<span style="color: #0066CC;">Number</span> = <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>a + b<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">/</span>b<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span>t</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; xp = <span style="color: #66cc66;">&#40;</span>a + b<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">*</span> <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">cos</span><span style="color: #66cc66;">&#40;</span>t<span style="color: #66cc66;">&#41;</span> - b <span style="color: #66cc66;">*</span> <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">cos</span><span style="color: #66cc66;">&#40;</span>p<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; yp = <span style="color: #66cc66;">&#40;</span>a + b<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">*</span> <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">sin</span><span style="color: #66cc66;">&#40;</span>t<span style="color: #66cc66;">&#41;</span> - b <span style="color: #66cc66;">*</span> <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">sin</span><span style="color: #66cc66;">&#40;</span>p<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>t == <span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; graphics.<span style="color: #0066CC;">moveTo</span><span style="color: #66cc66;">&#40;</span>xp, yp<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; graphics.<span style="color: #0066CC;">lineTo</span><span style="color: #66cc66;">&#40;</span>xp, yp<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; t += <span style="color: #cc66cc;color:#800000;">0.05</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>I've messed with Epicycloids in the past - browsing mathworld I decided to create this snippet. It will draw a curve like this:</p>
<p><img src="http://actionsnippet.com/wp-content/epi.gif" /></p>
]]></content:encoded>
			<wfw:commentRss>http://actionsnippet.com/?feed=rss2&amp;p=2933</wfw:commentRss>
		</item>
		<item>
		<title>Fish Curve</title>
		<link>http://actionsnippet.com/?p=2927</link>
		<comments>http://actionsnippet.com/?p=2927#comments</comments>
		<pubDate>Thu, 13 May 2010 15:44:08 +0000</pubDate>
		<dc:creator>Zevan</dc:creator>
		
		<category><![CDATA[Math]]></category>

		<category><![CDATA[misc]]></category>

		<category><![CDATA[actionscript]]></category>

		<category><![CDATA[as3]]></category>

		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://actionsnippet.com/?p=2927</guid>
		<description><![CDATA[CLICK HERE TO COPY
Actionscript:




var xp:Number = 0;


var yp:Number = 0;


var t:Number = 0;


var a:Number = 200;


x = stage.stageWidth / 2;


y = stage.stageHeight / 2;


&#160;


graphics.lineStyle&#40;0,0x000000&#41;;


addEventListener&#40;Event.ENTER_FRAME, onRun&#41;;


function onRun&#40;evt:Event&#41;:void &#123;


&#160; &#160; xp = a * Math.cos&#40;t&#41; - &#40;a * Math.pow&#40;Math.sin&#40;t&#41;,2&#41;&#41;/Math.sqrt&#40;2&#41;;


&#160; &#160; yp = a * Math.cos&#40;t&#41; * Math.sin&#40;t&#41;;


&#160; &#160; if &#40;t == 0&#41;&#123;


&#160; &#160; &#160; graphics.moveTo&#40;xp, yp&#41;;


&#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<div class="igBar"><span id="lactionscript-8"><a href="#" onclick="javascript:showPlainTxt('actionscript-8'); return false;">CLICK HERE TO COPY</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-8">
<div class="actionscript" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">var</span> xp:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">var</span> yp:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">var</span> t:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">var</span> a:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;color:#800000;">200</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">x = <span style="color: #0066CC;">stage</span>.<span style="color: #006600;">stageWidth</span> <span style="color: #66cc66;">/</span> <span style="color: #cc66cc;color:#800000;">2</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">y = <span style="color: #0066CC;">stage</span>.<span style="color: #006600;">stageHeight</span> <span style="color: #66cc66;">/</span> <span style="color: #cc66cc;color:#800000;">2</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">graphics.<span style="color: #0066CC;">lineStyle</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">0</span>,0x000000<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">addEventListener<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>, onRun<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">function</span> onRun<span style="color: #66cc66;">&#40;</span>evt:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; xp = a <span style="color: #66cc66;">*</span> <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">cos</span><span style="color: #66cc66;">&#40;</span>t<span style="color: #66cc66;">&#41;</span> - <span style="color: #66cc66;">&#40;</span>a <span style="color: #66cc66;">*</span> <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">pow</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">sin</span><span style="color: #66cc66;">&#40;</span>t<span style="color: #66cc66;">&#41;</span>,<span style="color: #cc66cc;color:#800000;">2</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">/</span><span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">sqrt</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">2</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; yp = a <span style="color: #66cc66;">*</span> <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">cos</span><span style="color: #66cc66;">&#40;</span>t<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">*</span> <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">sin</span><span style="color: #66cc66;">&#40;</span>t<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>t == <span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; graphics.<span style="color: #0066CC;">moveTo</span><span style="color: #66cc66;">&#40;</span>xp, yp<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; graphics.<span style="color: #0066CC;">lineTo</span><span style="color: #66cc66;">&#40;</span>xp, yp<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; t += <span style="color: #cc66cc;color:#800000;">0.05</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>While surfing mathworld I stumbled upon the equation for something called the <a href="http://mathworld.wolfram.com/FishCurve.html">Fish Curve</a>. This snippet will draw something like this:</p>
<p><img src="http://actionsnippet.com/wp-content/fishcurve.gif" /></p>
]]></content:encoded>
			<wfw:commentRss>http://actionsnippet.com/?feed=rss2&amp;p=2927</wfw:commentRss>
		</item>
		<item>
		<title>Astroid Pedal Curve Variation</title>
		<link>http://actionsnippet.com/?p=2923</link>
		<comments>http://actionsnippet.com/?p=2923#comments</comments>
		<pubDate>Wed, 12 May 2010 15:32:36 +0000</pubDate>
		<dc:creator>Zevan</dc:creator>
		
		<category><![CDATA[Math]]></category>

		<category><![CDATA[misc]]></category>

		<category><![CDATA[actionscript]]></category>

		<category><![CDATA[as3]]></category>

		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://actionsnippet.com/?p=2923</guid>
		<description><![CDATA[CLICK HERE TO COPY
Actionscript:




var xp:Number = 0;


var yp:Number = 0;


var t:Number = 0;


var r:Number = 200;


x = stage.stageWidth / 2;


y = stage.stageHeight / 2;


&#160;


graphics.lineStyle&#40;0,0x000000&#41;;


addEventListener&#40;Event.ENTER_FRAME, onRun&#41;;


function onRun&#40;evt:Event&#41;:void &#123;


&#160; &#160; r = 200 * Math.cos&#40;t / 10&#41;;


&#160; &#160; xp = r * Math.pow&#40;Math.cos&#40;t&#41;, 3&#41;;


&#160; &#160; yp = r * Math.pow&#40;Math.sin&#40;t&#41;, 3&#41;;


&#160; &#160; if &#40;t == 0&#41;&#123;


&#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<div class="igBar"><span id="lactionscript-10"><a href="#" onclick="javascript:showPlainTxt('actionscript-10'); return false;">CLICK HERE TO COPY</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-10">
<div class="actionscript" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">var</span> xp:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">var</span> yp:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">var</span> t:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">var</span> r:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;color:#800000;">200</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">x = <span style="color: #0066CC;">stage</span>.<span style="color: #006600;">stageWidth</span> <span style="color: #66cc66;">/</span> <span style="color: #cc66cc;color:#800000;">2</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">y = <span style="color: #0066CC;">stage</span>.<span style="color: #006600;">stageHeight</span> <span style="color: #66cc66;">/</span> <span style="color: #cc66cc;color:#800000;">2</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">graphics.<span style="color: #0066CC;">lineStyle</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">0</span>,0x000000<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">addEventListener<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>, onRun<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">function</span> onRun<span style="color: #66cc66;">&#40;</span>evt:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; r = <span style="color: #cc66cc;color:#800000;">200</span> <span style="color: #66cc66;">*</span> <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">cos</span><span style="color: #66cc66;">&#40;</span>t <span style="color: #66cc66;">/</span> <span style="color: #cc66cc;color:#800000;">10</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; xp = r <span style="color: #66cc66;">*</span> <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">pow</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">cos</span><span style="color: #66cc66;">&#40;</span>t<span style="color: #66cc66;">&#41;</span>, <span style="color: #cc66cc;color:#800000;">3</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; yp = r <span style="color: #66cc66;">*</span> <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">pow</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">sin</span><span style="color: #66cc66;">&#40;</span>t<span style="color: #66cc66;">&#41;</span>, <span style="color: #cc66cc;color:#800000;">3</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>t == <span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; graphics.<span style="color: #0066CC;">moveTo</span><span style="color: #66cc66;">&#40;</span>xp, yp<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; graphics.<span style="color: #0066CC;">lineTo</span><span style="color: #66cc66;">&#40;</span>xp, yp<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; t += <span style="color: #cc66cc;color:#800000;">0.1</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>While browsing mathworld I decided to do a variation on <a href="http://mathworld.wolfram.com/AstroidPedalCurve.html">this curve </a>. The above snippet will draw something like this:</p>
<p><img src="http://actionsnippet.com/wp-content/apedal.gif" /></p>
]]></content:encoded>
			<wfw:commentRss>http://actionsnippet.com/?feed=rss2&amp;p=2923</wfw:commentRss>
		</item>
		<item>
		<title>Color Project</title>
		<link>http://actionsnippet.com/?p=2918</link>
		<comments>http://actionsnippet.com/?p=2918#comments</comments>
		<pubDate>Tue, 11 May 2010 14:44:26 +0000</pubDate>
		<dc:creator>Zevan</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://actionsnippet.com/?p=2918</guid>
		<description><![CDATA[I've been working on a project for the led facade at medialab prado. The project has an online component that allows users to name colors, these names are then searched on twitter and displayed on the led facade. Right now our color database has about 530 colors about 20% of which are in spanish. We're [...]]]></description>
			<content:encoded><![CDATA[<p>I've been working on a project for the led facade at <a href="http://medialab-prado.es/">medialab prado</a>. The project has an online component that allows users to name colors, these names are then searched on twitter and displayed on the led facade. Right now our color database has about 530 colors about 20% of which are in spanish. We're lookiing to get more colors named particularly in spanish. If you feel up to it, you can enter and name colors, simply pick a color, enter your name and name the color... <a href="http://mtcanvas.com/co/data_pop_sp.html" target="blank">here for spanish</a><br />
<a href="http://mtcanvas.com/co/data_pop.html" target="blank">and here for english.</a></p>
<p>If you did it correctly you'll see your color show up in our list of colors <a href="http://mtcanvas.com/co/browser.html" target="blank">here</a></p>
<p><img src="http://actionsnippet.com/wp-content/color_flyer1.jpg" /></p>
]]></content:encoded>
			<wfw:commentRss>http://actionsnippet.com/?feed=rss2&amp;p=2918</wfw:commentRss>
		</item>
		<item>
		<title>3D Ring</title>
		<link>http://actionsnippet.com/?p=2916</link>
		<comments>http://actionsnippet.com/?p=2916#comments</comments>
		<pubDate>Mon, 03 May 2010 14:50:19 +0000</pubDate>
		<dc:creator>Zevan</dc:creator>
		
		<category><![CDATA[3D]]></category>

		<category><![CDATA[Graphics]]></category>

		<category><![CDATA[MovieClip]]></category>

		<category><![CDATA[UI]]></category>

		<category><![CDATA[arrays]]></category>

		<category><![CDATA[motion]]></category>

		<category><![CDATA[sortOn]]></category>

		<category><![CDATA[actionscript]]></category>

		<category><![CDATA[as3]]></category>

		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://actionsnippet.com/?p=2916</guid>
		<description><![CDATA[CLICK HERE TO COPY
Actionscript:




&#91;SWF&#40;width = 500, height=500&#41;&#93;


var ring:MovieClip = createRing&#40;&#41;;


ring.x = stage.stageWidth / 2;


ring.y = stage.stageHeight / 2;


addChild&#40;ring&#41;;


&#160;


function createRing&#40;sectionNum:int = 30&#41;:MovieClip&#123;


&#160; &#160; var container:MovieClip = new MovieClip&#40;&#41;;


&#160; &#160; container.circles = &#91;&#93;;


&#160; &#160; container.theta = 0;


&#160; &#160; container.thetaDest = 0;


&#160; &#160; var step:Number = &#40;Math.PI * 2&#41; / sectionNum;


&#160; &#160; for &#40;var i:int = 0; i&#60;sectionNum; [...]]]></description>
			<content:encoded><![CDATA[<div class="igBar"><span id="lactionscript-12"><a href="#" onclick="javascript:showPlainTxt('actionscript-12'); return false;">CLICK HERE TO COPY</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-12">
<div class="actionscript" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&#91;</span>SWF<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">width</span> = <span style="color: #cc66cc;color:#800000;">500</span>, <span style="color: #0066CC;">height</span>=<span style="color: #cc66cc;color:#800000;">500</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">var</span> ring:<span style="color: #0066CC;">MovieClip</span> = createRing<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">ring.<span style="color: #006600;">x</span> = <span style="color: #0066CC;">stage</span>.<span style="color: #006600;">stageWidth</span> <span style="color: #66cc66;">/</span> <span style="color: #cc66cc;color:#800000;">2</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">ring.<span style="color: #006600;">y</span> = <span style="color: #0066CC;">stage</span>.<span style="color: #006600;">stageHeight</span> <span style="color: #66cc66;">/</span> <span style="color: #cc66cc;color:#800000;">2</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">addChild<span style="color: #66cc66;">&#40;</span>ring<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">function</span> createRing<span style="color: #66cc66;">&#40;</span>sectionNum:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;color:#800000;">30</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">MovieClip</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> container:<span style="color: #0066CC;">MovieClip</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">MovieClip</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; container.<span style="color: #006600;">circles</span> = <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; container.<span style="color: #006600;">theta</span> = <span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; container.<span style="color: #006600;">thetaDest</span> = <span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> step:<span style="color: #0066CC;">Number</span> = <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">PI</span> <span style="color: #66cc66;">*</span> <span style="color: #cc66cc;color:#800000;">2</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">/</span> sectionNum;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;color:#800000;">0</span>; i<span style="color: #66cc66;">&lt;</span>sectionNum; i++<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> c:<span style="color: #0066CC;">MovieClip</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">MovieClip</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">with</span> <span style="color: #66cc66;">&#40;</span>c.<span style="color: #006600;">graphics</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">lineStyle</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">0</span>,0x000000<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">beginFill</span><span style="color: #66cc66;">&#40;</span>0xCCCCCC<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; drawCircle<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">0</span>,<span style="color: #cc66cc;color:#800000;">0</span>,<span style="color: #cc66cc;color:#800000;">20</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; c.<span style="color: #006600;">thetaOffset</span> = step <span style="color: #66cc66;">*</span> i;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; container.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>c<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; container.<span style="color: #006600;">circles</span>.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span>c<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; container.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>, onRun<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #b1b100;">return</span> container;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">function</span> onRun<span style="color: #66cc66;">&#40;</span>evt:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> container:<span style="color: #0066CC;">MovieClip</span> = <span style="color: #0066CC;">MovieClip</span><span style="color: #66cc66;">&#40;</span>evt.<span style="color: #006600;">currentTarget</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> num:<span style="color: #0066CC;">int</span> = container.<span style="color: #006600;">circles</span>.<span style="color: #0066CC;">length</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;color:#800000;">0</span>; i<span style="color: #66cc66;">&lt;</span>num; i++<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> c:<span style="color: #0066CC;">MovieClip</span> = container.<span style="color: #006600;">circles</span><span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> angle:<span style="color: #0066CC;">Number</span> = container.<span style="color: #006600;">theta</span> + c.<span style="color: #006600;">thetaOffset</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; c.<span style="color: #006600;">x</span> = <span style="color: #cc66cc;color:#800000;">200</span> <span style="color: #66cc66;">*</span> <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">cos</span><span style="color: #66cc66;">&#40;</span>angle<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; c.<span style="color: #006600;">y</span> = <span style="color: #cc66cc;color:#800000;">100</span> <span style="color: #66cc66;">*</span> <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">sin</span><span style="color: #66cc66;">&#40;</span>angle<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; c.<span style="color: #006600;">scaleX</span> = <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">100</span> + c.<span style="color: #006600;">y</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">/</span> <span style="color: #cc66cc;color:#800000;">120</span> + <span style="color: #cc66cc;color:#800000;">0.2</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; c.<span style="color: #006600;">scaleY</span> = c.<span style="color: #006600;">scaleX</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; container.<span style="color: #006600;">circles</span>.<span style="color: #0066CC;">sortOn</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;y&quot;</span>, <span style="color: #0066CC;">Array</span>.<span style="color: #006600;">NUMERIC</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span>i = <span style="color: #cc66cc;color:#800000;">0</span>; i<span style="color: #66cc66;">&lt;</span>num; i++<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; container.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>container.<span style="color: #006600;">circles</span><span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>container.<span style="color: #006600;">mouseX</span> <span style="color: #66cc66;">&lt;</span>-<span style="color: #cc66cc;color:#800000;">100</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; container.<span style="color: #006600;">thetaDest</span> -= <span style="color: #cc66cc;color:#800000;">0.05</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>container.<span style="color: #006600;">mouseX</span><span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;color:#800000;">100</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; container.<span style="color: #006600;">thetaDest</span> += <span style="color: #cc66cc;color:#800000;">0.05</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; container.<span style="color: #006600;">theta</span> += <span style="color: #66cc66;">&#40;</span>container.<span style="color: #006600;">thetaDest</span> &nbsp;- container.<span style="color: #006600;">theta</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">/</span> <span style="color: #cc66cc;color:#800000;">12</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>This snippet shows how to create a 3D ring navigation using sine and cosine. Have a look:</p>
<div style="text-align:center;width:465px;"><iframe title="Ring - wonderfl build flash online" scrolling="no" src="http://wonderfl.net/blogparts/9e8B" width="465" height="490" style="border:1px black solid;"></iframe><a href="http://wonderfl.net/c/9e8B" title="Ring - wonderfl build flash online">Ring - wonderfl build flash online</a></div>
]]></content:encoded>
			<wfw:commentRss>http://actionsnippet.com/?feed=rss2&amp;p=2916</wfw:commentRss>
		</item>
		<item>
		<title>Propeller Sketch</title>
		<link>http://actionsnippet.com/?p=2913</link>
		<comments>http://actionsnippet.com/?p=2913#comments</comments>
		<pubDate>Mon, 03 May 2010 14:32:04 +0000</pubDate>
		<dc:creator>Zevan</dc:creator>
		
		<category><![CDATA[motion]]></category>

		<category><![CDATA[actionscript]]></category>

		<category><![CDATA[as3]]></category>

		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://actionsnippet.com/?p=2913</guid>
		<description><![CDATA[CLICK HERE TO COPY
Actionscript:




makeFlyer&#40;&#41;;


&#160;


function makeFlyer&#40;&#41;:void&#123;


&#160; &#160; var thing:MovieClip = new MovieClip&#40;&#41;;


&#160; &#160; thing.x = 200;


&#160; &#160; thing.y = 200;


&#160; &#160; 


&#160; &#160; addChild&#40;thing&#41;;


&#160; &#160; 


&#160; &#160; var prop:Shape = new Shape&#40;&#41;;


&#160; &#160; with &#40;prop.graphics&#41;&#123;


&#160; &#160; &#160; &#160; lineStyle&#40;0,0x000000&#41;;


&#160; &#160; &#160; &#160; beginFill&#40;0x000000&#41;;


&#160; &#160; &#160; &#160; moveTo&#40;-100,0&#41;;


&#160; &#160; &#160; &#160; curveTo&#40;-100, -30, 0, 0&#41;;


&#160; &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<div class="igBar"><span id="lactionscript-14"><a href="#" onclick="javascript:showPlainTxt('actionscript-14'); return false;">CLICK HERE TO COPY</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-14">
<div class="actionscript" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">makeFlyer<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">function</span> makeFlyer<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> thing:<span style="color: #0066CC;">MovieClip</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">MovieClip</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; thing.<span style="color: #006600;">x</span> = <span style="color: #cc66cc;color:#800000;">200</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; thing.<span style="color: #006600;">y</span> = <span style="color: #cc66cc;color:#800000;">200</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; addChild<span style="color: #66cc66;">&#40;</span>thing<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> prop:Shape = <span style="color: #000000; font-weight: bold;">new</span> Shape<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #0066CC;">with</span> <span style="color: #66cc66;">&#40;</span>prop.<span style="color: #006600;">graphics</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">lineStyle</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">0</span>,0x000000<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">beginFill</span><span style="color: #66cc66;">&#40;</span>0x000000<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">moveTo</span><span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;color:#800000;">100</span>,<span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">curveTo</span><span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;color:#800000;">100</span>, -<span style="color: #cc66cc;color:#800000;">30</span>, <span style="color: #cc66cc;color:#800000;">0</span>, <span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">curveTo</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">100</span>, <span style="color: #cc66cc;color:#800000;">30</span>, <span style="color: #cc66cc;color:#800000;">100</span>, <span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">curveTo</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">100</span>, -<span style="color: #cc66cc;color:#800000;">30</span>, <span style="color: #cc66cc;color:#800000;">0</span>, <span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">curveTo</span><span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;color:#800000;">100</span>, <span style="color: #cc66cc;color:#800000;">30</span>, -<span style="color: #cc66cc;color:#800000;">100</span>, <span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; prop.<span style="color: #006600;">scaleX</span> = prop.<span style="color: #006600;">scaleY</span> = <span style="color: #cc66cc;color:#800000;">0.5</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> container:<span style="color: #0066CC;">MovieClip</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">MovieClip</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//container.x = -50;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; container.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>prop<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; container.<span style="color: #006600;">scaleY</span> = <span style="color: #cc66cc;color:#800000;">0.6</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; thing.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>container<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> body:Shape = <span style="color: #000000; font-weight: bold;">new</span> Shape<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #0066CC;">with</span> <span style="color: #66cc66;">&#40;</span>body.<span style="color: #006600;">graphics</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">lineStyle</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">0</span>, 0x000000<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">beginFill</span><span style="color: #66cc66;">&#40;</span>0x000000<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">lineTo</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">0</span>,<span style="color: #cc66cc;color:#800000;">80</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; drawCircle<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">0</span>,<span style="color: #cc66cc;color:#800000;">80</span>,<span style="color: #cc66cc;color:#800000;">10</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; thing.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>body<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; thing.<span style="color: #006600;">velX</span> = <span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; thing.<span style="color: #006600;">velY</span> = <span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; thing.<span style="color: #006600;">posX</span> = thing.<span style="color: #006600;">x</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; thing.<span style="color: #006600;">posY</span> = thing.<span style="color: #006600;">y</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; thing.<span style="color: #006600;">theta</span> = <span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; thing.<span style="color: #006600;">prop</span> = prop;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; thing.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>, onRun<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">function</span> onRun<span style="color: #66cc66;">&#40;</span>evt:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> t:<span style="color: #0066CC;">MovieClip</span> = <span style="color: #0066CC;">MovieClip</span><span style="color: #66cc66;">&#40;</span>evt.<span style="color: #006600;">currentTarget</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; t.<span style="color: #006600;">prop</span>.<span style="color: #006600;">rotation</span> += <span style="color: #cc66cc;color:#800000;">10</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; t.<span style="color: #006600;">velY</span> = <span style="color: #cc66cc;color:#800000;">3</span> <span style="color: #66cc66;">*</span> <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">cos</span><span style="color: #66cc66;">&#40;</span>t.<span style="color: #006600;">theta</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; t.<span style="color: #006600;">velX</span> = <span style="color: #cc66cc;color:#800000;">3</span> <span style="color: #66cc66;">*</span> <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">sin</span><span style="color: #66cc66;">&#40;</span>t.<span style="color: #006600;">theta</span> <span style="color: #66cc66;">/</span> <span style="color: #cc66cc;color:#800000;">2</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; t.<span style="color: #006600;">theta</span> += <span style="color: #cc66cc;color:#800000;">0.05</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; t.<span style="color: #006600;">posX</span> += t.<span style="color: #006600;">velX</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; t.<span style="color: #006600;">posY</span> += t.<span style="color: #006600;">velY</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; t.<span style="color: #006600;">x</span> = t.<span style="color: #006600;">posX</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; t.<span style="color: #006600;">y</span> = t.<span style="color: #006600;">posY</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>This snippet creates a small flying object that moves with sine and cosine.</p>
<p><a href="http://www.actionsnippet.com/swfs/propeller.html" target="blank"><br />
Have a look at the swf...<br />
<img src="http://actionsnippet.com/wp-content/propeller.gif" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://actionsnippet.com/?feed=rss2&amp;p=2913</wfw:commentRss>
		</item>
		<item>
		<title>Drawings and Animations</title>
		<link>http://actionsnippet.com/?p=2911</link>
		<comments>http://actionsnippet.com/?p=2911#comments</comments>
		<pubDate>Fri, 30 Apr 2010 15:38:21 +0000</pubDate>
		<dc:creator>Zevan</dc:creator>
		
		<category><![CDATA[Announcements]]></category>

		<category><![CDATA[projects]]></category>

		<category><![CDATA[actionscript]]></category>

		<category><![CDATA[as3]]></category>

		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://actionsnippet.com/?p=2911</guid>
		<description><![CDATA[So there are 434 posts on this site to date. I hope to keep posting but it isn't always easy to come up with new ideas. Another project I've been working on is a series of drawings and interactive animations over at my other website (shapevent). I've been creating entries for this part of shapevent [...]]]></description>
			<content:encoded><![CDATA[<p>So there are 434 posts on this site to date. I hope to keep posting but it isn't always easy to come up with new ideas. Another project I've been working on is a series of drawings and interactive animations over at my other website (shapevent). I've been creating entries for this part of shapevent pretty regularly - go have a look:</p>
<p><a href="http://www.shapevent.com/log/">http://www.shapevent.com/log/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://actionsnippet.com/?feed=rss2&amp;p=2911</wfw:commentRss>
		</item>
	</channel>
</rss>
