<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>FlashArt</title>
	<atom:link href="http://flashart.ca/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://flashart.ca</link>
	<description></description>
	<lastBuildDate>Fri, 19 Feb 2010 02:44:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>How To Install Red5 on OSX</title>
		<link>http://flashart.ca/?p=1590</link>
		<comments>http://flashart.ca/?p=1590#comments</comments>
		<pubDate>Fri, 19 Feb 2010 02:37:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Advanced]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://flashart.ca/?p=1590</guid>
		<description><![CDATA[Red5 Media Server is one of my favourite open source tools, but setting it up on a mac can be difficult. Here&#8217;s the process that works for me. 1. Download Red5 (be sure to get the ZIP form, not the DMG!) 2. Unzip and place in Applications directory 3. Open Terminal, navigate to your red5 [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://flashart.ca/wp-content/uploads/2010/02/red5logo.png"><img src="http://flashart.ca/wp-content/uploads/2010/02/red5logo-300x119.png" alt="" title="red5logo" width="300" height="119" class="alignnone size-medium wp-image-1589" /></a><br />
<a href="http://code.google.com/p/red5/">Red5 Media Server</a> is one of my favourite open source tools, but setting it up on a mac can be difficult. Here&#8217;s the process that works for me.</p>
<p>1. <a href="http://code.google.com/p/red5/">Download Red5</a> (be sure to get the ZIP form, not the DMG!)<br />
2. Unzip and place in Applications directory<br />
3. Open Terminal, navigate to your red5 directory (ex. cd /Applications/red5-0.9.0/)<br />
4. Run the Red5 shell script with: sh ./red5.sh<br />
5. Verify that it is running by visiting: http://localhost:5080 and click Install to install sample apps </p>
]]></content:encoded>
			<wfw:commentRss>http://flashart.ca/?feed=rss2&amp;p=1590</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Organic Code Drawing API Experiments</title>
		<link>http://flashart.ca/?p=1577</link>
		<comments>http://flashart.ca/?p=1577#comments</comments>
		<pubDate>Tue, 05 Jan 2010 02:34:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Demos w/ Source]]></category>

		<guid isPermaLink="false">http://flashart.ca/?p=1577</guid>
		<description><![CDATA[A small collection of classes for drawing irregular spirals, waves and circles This is SineMonger, which instantiates a sequence of sine waves to produce a more complex visual pattern. This is GrinchSpiral2D, which creates a series of Fibonacci2D instances to create what appears like Dr. Seuss hair. This is Circutron, which will continuously draw scribbles [...]]]></description>
			<content:encoded><![CDATA[<p>A small collection of classes for drawing irregular spirals, waves and circles<br />
<a href="http://flashart.ca/wp-content/uploads/2010/01/wave1.png"><img src="http://flashart.ca/wp-content/uploads/2010/01/wave1.png" alt="wave1" title="wave1" width="410" height="206" class="alignnone size-full wp-image-1578" /></a><br />
This is SineMonger, which instantiates a sequence of sine waves to produce a more complex visual pattern.<br />
<span id="more-1577"></span><br />
<a href="http://flashart.ca/wp-content/uploads/2010/01/spiral1.png"><img src="http://flashart.ca/wp-content/uploads/2010/01/spiral1.png" alt="spiral1" title="spiral1" width="400" height="253" class="alignnone size-full wp-image-1581" /></a><br />
This is GrinchSpiral2D, which creates a series of Fibonacci2D instances to create what appears like Dr. Seuss hair.<br />
<a href="http://flashart.ca/wp-content/uploads/2010/01/circle1.png"><img src="http://flashart.ca/wp-content/uploads/2010/01/circle1.png" alt="circle1" title="circle1" width="338" height="346" class="alignnone size-full wp-image-1582" /></a><br />
This is Circutron, which will continuously draw scribbles in a semi-randomized circle pattern.</p>
<p>Download all source files for these examples (as a Flex Project) <a href="http://flashart.ca/wp-content/uploads/2010/01/OrganicCode.zip">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://flashart.ca/?feed=rss2&amp;p=1577</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Loading External SWFs</title>
		<link>http://flashart.ca/?p=1555</link>
		<comments>http://flashart.ca/?p=1555#comments</comments>
		<pubDate>Fri, 19 Jun 2009 15:09:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Demos w/ Source]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[external swf]]></category>
		<category><![CDATA[loader class]]></category>

		<guid isPermaLink="false">http://flashart.ca/?p=1555</guid>
		<description><![CDATA[Sometimes it is handy to work on parts of your project as separate swf files and have a mother swf that loads the child swfs. It is a bit of overkill in this example to be loading the screen content as a separate swf but I think you can see where this is going. Once [...]]]></description>
			<content:encoded><![CDATA[<p>
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_0" width="550" height="400">
      <param name="movie" value="http://flashart.ca/wp-content/uploads/2009/06/externalSWF.swf" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://flashart.ca/wp-content/uploads/2009/06/externalSWF.swf" width="550" height="400">
      <!--<![endif]-->
        <p>The Flash plugin is required to view this object.</p>
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>
<br />
Sometimes it is handy to work on parts of your project as separate swf files and have a mother swf that loads the child swfs. It is a bit of overkill in this example to be loading the screen content as a separate swf but I think you can see where this is going.  Once the swf is loaded in you can talk to it like you would any other movieclip object- accessing/manipulating properties of the child swf and such.<br />
<span id="more-1555"></span><br />
Basically this example loads in the screen content, and if you click on the keyboard it calls the compute function in the external swf to generate the visuals.</p>
<p>The code in the document class of the main .fla file:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> <span style="color: #000000;">&#123;</span>
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.net</span>.<span style="color: #004993;">URLRequest</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">Loader</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">Sprite</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">MovieClip</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">Event</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">MouseEvent</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">ProgressEvent</span>;
&nbsp;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> Main extends <span style="color: #004993;">Sprite</span> <span style="color: #000000;">&#123;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> mc_screen<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">MovieClip</span>;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>
			startLoad<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> pressedKeyboard<span style="color: #000000;">&#40;</span>myEvent<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">MouseEvent</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><span style="color: #000000;">&#123;</span>
			mc_screen.compute<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> startLoad<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> swfLoad<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Loader</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Loader</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> swfRequest<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">URLRequest</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">URLRequest</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;http://flashart.ca/wp-content/uploads/2009/06/compScreen.swf&quot;</span><span style="color: #000000;">&#41;</span>;
			swfLoad.<span style="color: #004993;">contentLoaderInfo</span>.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span>.<span style="color: #004993;">COMPLETE</span>, onCompleteHandler<span style="color: #000000;">&#41;</span>;
			swfLoad.<span style="color: #004993;">contentLoaderInfo</span>.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">ProgressEvent</span>.<span style="color: #004993;">PROGRESS</span>, onProgressHandler<span style="color: #000000;">&#41;</span>;
			swfLoad.<span style="color: #004993;">load</span><span style="color: #000000;">&#40;</span>swfRequest<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> onCompleteHandler<span style="color: #000000;">&#40;</span>loadEvent<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			mc_screen = loadEvent.<span style="color: #004993;">currentTarget</span>.<span style="color: #004993;">content</span>;
			<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>mc_screen<span style="color: #000000;">&#41;</span>;
&nbsp;
			mc_screen.<span style="color: #004993;">x</span> = <span style="color: #000000; font-weight:bold;">50</span>;
			mc_screen.<span style="color: #004993;">y</span> = <span style="color: #000000; font-weight:bold;">94</span>;
&nbsp;
			b_keyboard.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span>.<span style="color: #004993;">MOUSE_DOWN</span>, pressedKeyboard<span style="color: #000000;">&#41;</span>;
&nbsp;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> onProgressHandler<span style="color: #000000;">&#40;</span>mProgress<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">ProgressEvent</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
&nbsp;
			<span style="color: #6699cc; font-weight: bold;">var</span> percent<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = mProgress.<span style="color: #004993;">bytesLoaded</span><span style="color: #000000; font-weight: bold;">/</span>mProgress.<span style="color: #004993;">bytesTotal</span>;
			<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span>percent<span style="color: #000000;">&#41;</span>;
&nbsp;
		<span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>And the source for the child swf&#8217;s document class (CompScreen.as):</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> <span style="color: #000000;">&#123;</span>
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">MovieClip</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">Event</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.filters</span>.<span style="color: #004993;">GlowFilter</span>;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> CompScreen extends <span style="color: #004993;">MovieClip</span><span style="color: #000000;">&#123;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> isComputing<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span> = <span style="color: #0033ff; font-weight: bold;">false</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> counter<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span> = <span style="color: #000000; font-weight:bold;">0</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> myString<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">String</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> CompScreen<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>
&nbsp;
			txt_box.<span style="color: #004993;">filters</span> = <span style="color: #000000;">&#91;</span><span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">GlowFilter</span><span style="color: #000000;">&#40;</span>0xFFFFFF, <span style="color: #000000; font-weight:bold;">1</span>, <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>;
			<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span>.<span style="color: #004993;">ENTER_FRAME</span>, update<span style="color: #000000;">&#41;</span>;
&nbsp;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> compute<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><span style="color: #000000;">&#123;</span>
&nbsp;
			<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;ROTATE&quot;</span><span style="color: #000000;">&#41;</span>;
			counter = <span style="color: #000000; font-weight:bold;">0</span>;
			isComputing = <span style="color: #0033ff; font-weight: bold;">true</span>;
&nbsp;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> update<span style="color: #000000;">&#40;</span>myEvent<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><span style="color: #000000;">&#123;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>isComputing == <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>
				counter<span style="color: #000000; font-weight: bold;">++</span>;
				txt_box.<span style="color: #004993;">text</span> = <span style="color: #004993;">String</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Math</span>.<span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #000000; font-weight:bold;">999999999999999999999</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #004993;">String</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Math</span>.<span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #000000; font-weight:bold;">99999999</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>counter <span style="color: #000000; font-weight: bold;">&gt;</span>= <span style="color: #000000; font-weight:bold;">50</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>
				isComputing = <span style="color: #0033ff; font-weight: bold;">false</span>;
				txt_box.<span style="color: #004993;">text</span> = <span style="color: #990000;">&quot;SIMULATION COMPLETE...&quot;</span>;
&nbsp;
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #000000;">&#125;</span></pre></div></div>

<p><a href="http://flashart.ca/wp-content/uploads/2009/06/externalSWF1.zip">Download Source Files</a></p>
]]></content:encoded>
			<wfw:commentRss>http://flashart.ca/?feed=rss2&amp;p=1555</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Flash Talks to Arduino</title>
		<link>http://flashart.ca/?p=1534</link>
		<comments>http://flashart.ca/?p=1534#comments</comments>
		<pubDate>Sat, 09 May 2009 14:47:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Advanced]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[physical computing]]></category>

		<guid isPermaLink="false">http://flashart.ca/?p=1534</guid>
		<description><![CDATA[There are many instances where interacting with a computer via keyboard and mouse just doesn&#8217;t cut it. The Arduino is a mini-computer that can be used to take inputs from things like light and motion sensors, ultrasonic range detectors, touch sensors etc, and stream that data out to a computer that visualizes it using Flash. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://flashart.ca/wp-content/uploads/2009/05/arduino.jpg"><img class="alignnone size-full wp-image-1535" title="arduino" src="http://flashart.ca/wp-content/uploads/2009/05/arduino.jpg" alt="arduino" width="360" height="340" /></a></p>
<p>There are many instances where interacting with a computer via keyboard and mouse just doesn&#8217;t cut it. The <a href="http://arduino.cc">Arduino</a> is a mini-computer that can be used to take inputs from things like light and motion sensors, ultrasonic range detectors, touch sensors etc, and stream that data out to a computer that visualizes it using Flash. It can also be used in the inverse scenario where Flash is telling the Arduino to turn on outputs like motors, lights, or any other electromechanical contraption.</p>
<p><span id="more-1534"></span>First you need to setup the Arduino. Download the <a href="http://www.arduino.cc/en/Main/Software">software here</a> (Get the one at the bottom called Serial Proxy).</p>
<p>Next you need a program to run on your Arduino. This sample program works with analog sensors like <a href="http://www.arduino.cc/en/Tutorial/Potentiometer">potentiometers</a>, <a href="http://www.acroname.com/robotics/parts/R48-IR12.html">IR range sensors</a>, <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=8502">sonar</a> etc.<br />
Copy this code into a new Arduino sketch:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/*
* Sample Program for reading an analog sensor such as a potentiometer, IR range detector, sonar etc.
*/</span>
<span style="color: #339933;">#define anIn 2 // sensor pin</span>
<span style="color: #993333;">int</span> iAnVal<span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">// sensor value</span>
&nbsp;
<span style="color: #993333;">void</span> setup<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
Serial.<span style="color: #202020;">begin</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">19200</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">void</span> loop<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
  iAnVal <span style="color: #339933;">=</span> analogRead<span style="color: #009900;">&#40;</span>anIn<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   <span style="color: #666666; font-style: italic;">// read a value from the sensor</span>
  Serial.<span style="color: #202020;">println</span><span style="color: #009900;">&#40;</span>iAnVal<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// output value to serial</span>
&nbsp;
  delay<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">30</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Upload your Arduino code to the Arduino. After it starts running it will be sending out a stream of sensor data via serial to a computer. However Flash cannot directly access this information. You need what is called a serial proxy to run alongside your Flash file to transform the data coming into the computer from the Arduino into a form that Flash can work with. There are many serial proxy programs out there, but probably the most straight forward approach is to use the Arduino software&#8217;s built in serial proxy feature. Click on the button on the far right of the main toolbar to activate the proxy.</p>
<p><a href="http://flashart.ca/wp-content/uploads/2009/05/proxy.png"><img class="alignnone size-full wp-image-1540" title="proxy" src="http://flashart.ca/wp-content/uploads/2009/05/proxy.png" alt="proxy" width="237" height="40" /></a></p>
<p>Now you should see your sensor streaming data out at the bottom. An important consideration is speed of conversation between the arduino and your computer. This is called the baud rate in the context of serial communication. You need to make sure that whichever baud rate you use, both the Arduino and the serial proxy are speaking to each other at the same speed. Change the baud rate with the pull-down menu near the bottom right. Since in the code we set the baud rate to 19200, select that number from the pull-down.</p>
<p><a href="http://flashart.ca/wp-content/uploads/2009/05/proxyport.png"><img class="alignnone size-full wp-image-1541" title="proxyport" src="http://flashart.ca/wp-content/uploads/2009/05/proxyport.png" alt="proxyport" width="259" height="115" /></a></p>
<p>Also take note of the port number that is stated in the section above (in this case port 11100). Your actionscript code will need to have this port number for the serial proxy to talk to Flash.</p>
<p>Download this <a href="http://flashart.ca/wp-content/uploads/2009/05/arduinoflash.fla">flash source file</a>. It is already configured to read data on port 11100. This file is expecting to see a number between 0-512 in the serial data stream from a device like the <a href="http://www.maxbotix.com/">Maxbotix EZ1</a> so you will have to modify it if your analog sensor is putting out higher numbers. The swf will simply scrub the timeline of a rectangle movieclip based on the numbers coming in. You may wish to experiment with the smoothInt variable which combines the incoming data with past data to smooth out any irregular numbers coming through the data stream.</p>
]]></content:encoded>
			<wfw:commentRss>http://flashart.ca/?feed=rss2&amp;p=1534</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FAIL</title>
		<link>http://flashart.ca/?p=1515</link>
		<comments>http://flashart.ca/?p=1515#comments</comments>
		<pubDate>Sun, 19 Apr 2009 20:52:13 +0000</pubDate>
		<dc:creator>Karie</dc:creator>
				<category><![CDATA[Project 4]]></category>

		<guid isPermaLink="false">http://flashart.ca/?p=1515</guid>
		<description><![CDATA[I failed to finish my animation!!!  However, it can be watched in poor quality at: http://www.youtube.com/watch?v=29TT5DegXcU Nice meeting you all. Please take care and may all your flash dreams come true. Thank you Jess for a great class!!!]]></description>
			<content:encoded><![CDATA[<p>I failed to finish my animation!!! <br />
However, it can be watched in poor quality at:</p>
<p>http://www.youtube.com/watch?v=29TT5DegXcU</p>
<p>Nice meeting you all. Please take care and may all your flash dreams come true.</p>
<p>Thank you Jess for a great class!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://flashart.ca/?feed=rss2&amp;p=1515</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OKay this is project 4 for real</title>
		<link>http://flashart.ca/?p=1513</link>
		<comments>http://flashart.ca/?p=1513#comments</comments>
		<pubDate>Sun, 19 Apr 2009 11:15:23 +0000</pubDate>
		<dc:creator>k</dc:creator>
				<category><![CDATA[Project 4]]></category>

		<guid isPermaLink="false">http://flashart.ca/?p=1513</guid>
		<description><![CDATA[http://www.howlongcanyoutreadwater.com/TreadingWater/TreadingWater.html I posted this earlier put i forgot the html part]]></description>
			<content:encoded><![CDATA[<p>http://www.howlongcanyoutreadwater.com/TreadingWater/TreadingWater.html</p>
<p>I posted this earlier put i forgot the html part</p>
]]></content:encoded>
			<wfw:commentRss>http://flashart.ca/?feed=rss2&amp;p=1513</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shittiest Project Evar</title>
		<link>http://flashart.ca/?p=1510</link>
		<comments>http://flashart.ca/?p=1510#comments</comments>
		<pubDate>Sun, 19 Apr 2009 05:10:33 +0000</pubDate>
		<dc:creator>peaz</dc:creator>
				<category><![CDATA[Project 4]]></category>

		<guid isPermaLink="false">http://flashart.ca/?p=1510</guid>
		<description><![CDATA[So, my butt is sore from being raped by Actionscript. This was SUPPOSED to be a combination story/game, in which game sequences laced together seamelessly with action sequences. It didn&#8217;t work. It&#8217;s a stillborn project. I call it a stillborn project because that term is more marketable than the truth, which is &#8220;Hi My Name [...]]]></description>
			<content:encoded><![CDATA[<p>So, my butt is sore from being raped by Actionscript. This was SUPPOSED to be a combination story/game, in which game sequences laced together seamelessly with action sequences.</p>
<p>It didn&#8217;t work. It&#8217;s a stillborn project. I call it a stillborn project because that term is more marketable than the truth, which is &#8220;Hi My Name Is Alan and I Am Very Stupid And Here is A Stupid Project That Stupidly Refuses to Work Because Actionscript and Bono and Also Alan are Very Stupid Stupidheads.&#8221;</p>
<p>HATE HATE HATE HATE HATE.</p>
<p>Rah.</p>

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_1" width="550" height="400">
      <param name="movie" value="http://flashart.ca/wp-content/uploads/2009/04/zompocaplypse-animation.swf" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://flashart.ca/wp-content/uploads/2009/04/zompocaplypse-animation.swf" width="550" height="400">
      <!--<![endif]-->
        <p>The Flash plugin is required to view this object.</p>
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>

]]></content:encoded>
			<wfw:commentRss>http://flashart.ca/?feed=rss2&amp;p=1510</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rabbit Game</title>
		<link>http://flashart.ca/?p=1505</link>
		<comments>http://flashart.ca/?p=1505#comments</comments>
		<pubDate>Sun, 19 Apr 2009 01:01:49 +0000</pubDate>
		<dc:creator>samar</dc:creator>
				<category><![CDATA[Project 4]]></category>

		<guid isPermaLink="false">http://flashart.ca/?p=1505</guid>
		<description><![CDATA[Hi, So here it is! A new game for project 3 and 4! enjoy p.s. i couldn&#8217;t figure out how to do the score]]></description>
			<content:encoded><![CDATA[<p>
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_2" width="550" height="400">
      <param name="movie" value="http://flashart.ca/wp-content/uploads/2009/04/project31.swf" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://flashart.ca/wp-content/uploads/2009/04/project31.swf" width="550" height="400">
      <!--<![endif]-->
        <p>The Flash plugin is required to view this object.</p>
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>
 Hi,</p>
<p>So here it is! A new game for project 3 and 4!</p>
<p>enjoy</p>
<p>p.s. i couldn&#8217;t figure out how to do the score <img src='http://flashart.ca/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://flashart.ca/?feed=rss2&amp;p=1505</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>web_face</title>
		<link>http://flashart.ca/?p=1501</link>
		<comments>http://flashart.ca/?p=1501#comments</comments>
		<pubDate>Sat, 18 Apr 2009 21:36:28 +0000</pubDate>
		<dc:creator>canxerart</dc:creator>
				<category><![CDATA[Project 4]]></category>

		<guid isPermaLink="false">http://flashart.ca/?p=1501</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_3" width="600" height="800">
      <param name="movie" value="http://flashart.ca/wp-content/uploads/2009/04/web.swf" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://flashart.ca/wp-content/uploads/2009/04/web.swf" width="600" height="800">
      <!--<![endif]-->
        </p>
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>

]]></content:encoded>
			<wfw:commentRss>http://flashart.ca/?feed=rss2&amp;p=1501</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cat and Mouse Game</title>
		<link>http://flashart.ca/?p=1497</link>
		<comments>http://flashart.ca/?p=1497#comments</comments>
		<pubDate>Sat, 18 Apr 2009 17:36:13 +0000</pubDate>
		<dc:creator>elsewhere</dc:creator>
				<category><![CDATA[Project 4]]></category>

		<guid isPermaLink="false">http://flashart.ca/?p=1497</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_4" width="550" height="400">
      <param name="movie" value="http://flashart.ca/wp-content/uploads/2009/04/final-cat.swf" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://flashart.ca/wp-content/uploads/2009/04/final-cat.swf" width="550" height="400">
      <!--<![endif]-->
        <p>The Flash plugin is required to view this object.</p>
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>

]]></content:encoded>
			<wfw:commentRss>http://flashart.ca/?feed=rss2&amp;p=1497</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
