<?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>Eoin Griffin &#187; Flash</title>
	<atom:link href="http://www.eoingriffin.com/tag/flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.eoingriffin.com</link>
	<description>Web/Multimedia Design &#38; Development Portfolio</description>
	<lastBuildDate>Thu, 18 Mar 2010 05:04:27 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Useful hints: #1 &#8211; Odd/Even numbers (Modulo operator [%] and Bitwise And [&amp;])</title>
		<link>http://www.eoingriffin.com/code-hints/useful-hints-1-oddeven-numbers-modulo-operator/</link>
		<comments>http://www.eoingriffin.com/code-hints/useful-hints-1-oddeven-numbers-modulo-operator/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 19:21:50 +0000</pubDate>
		<dc:creator>Eoin</dc:creator>
				<category><![CDATA[Code hints]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[modulo]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.eoingriffin.com/?p=212</guid>
		<description><![CDATA[I&#8217;m going to start posting some useful little bits of code up here as i think of them.
This is partly to help with my exceptionally poor memory, and partly to help out anyone who might be interested. I encourage anyone else who knows of some similar little helpful tips to send them to me and [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m going to start posting some useful little bits of code up here as i think of them.<br />
This is partly to help with my exceptionally poor memory, and partly to help out anyone who might be interested. I encourage anyone else who knows of some similar little helpful tips to send them to me and i&#8217;ll post them up here.</p>
<p>Ok, so here&#8217;s a nice simple one to start off. What&#8217;s an easy and simple method to determine if a number is odd or even?<br />
The answer lies with the modulo operator (%) or the bitwise AND operator (&#038;).</p>
<div class="codecolorer-container actionscript3 dawn" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">i<span style="color: #000066; font-weight: bold;">%</span>2</div></td></tr></tbody></table></div>
<p>Whatever <strong>i</strong> is, <strong>i%2</strong> will evaluate to either 0 or 1.<br />
Or a faster method for determining odd or even numbers would be the Bitwise AND operator (represented by a single ampersand: &#038;):</p>
<div class="codecolorer-container actionscript3 dawn" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">i<span style="color: #000066; font-weight: bold;">&amp;</span><span style="color: #000000; font-weight:bold;">1</span></div></td></tr></tbody></table></div>
<p>So what use is this?<br />
<span id="more-212"></span><br />
Let&#8217;s say you&#8217;ve got a for loop:</p>
<div class="codecolorer-container actionscript3 dawn" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0033ff; font-weight: bold;">for</span><span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">var</span> i<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=int%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:int.html"><span style="color: #004993;">int</span></a> = <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">;</span> i <span style="color: #000066; font-weight: bold;">&amp;</span>lt<span style="color: #000066; font-weight: bold;">;</span> <span style="color: #000000; font-weight:bold;">50</span><span style="color: #000066; font-weight: bold;">;</span> i<span style="color: #000066; font-weight: bold;">++</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>i<span style="color: #000066; font-weight: bold;">%</span>2<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span> <span style="color: #009900; font-style: italic;">// Or i&amp;1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//do something for odd numbers</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><span style="color: #0033ff; font-weight: bold;">else</span><span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//do something else for even numbers</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<span style="color: #000000;">&#125;</span></div></td></tr></tbody></table></div>
<p>So why would we use the modulo operator if a bitwise AND is faster?<br />
To take this further, you could specify separate code for every nth number:</p>
<div class="codecolorer-container actionscript3 dawn" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br /></div></td><td><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0033ff; font-weight: bold;">for</span><span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">var</span> i<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=int%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:int.html"><span style="color: #004993;">int</span></a> = <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">;</span> i <span style="color: #000066; font-weight: bold;">&amp;</span>lt<span style="color: #000066; font-weight: bold;">;</span> <span style="color: #000000; font-weight:bold;">50</span><span style="color: #000066; font-weight: bold;">;</span> i<span style="color: #000066; font-weight: bold;">++</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">switch</span><span style="color: #000000;">&#40;</span>i<span style="color: #000066; font-weight: bold;">%</span>4<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">case</span> 0<span style="color: #000066; font-weight: bold;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">trace</span> <span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;run every 4 iterations starting from 0&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">break</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">case</span> 1<span style="color: #000066; font-weight: bold;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">trace</span> <span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;run every 4 iterations starting from 1&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">break</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">case</span> 2<span style="color: #000066; font-weight: bold;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">trace</span> <span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;run every 4 iterations starting from 2&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">break</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">case</span> 3<span style="color: #000066; font-weight: bold;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">trace</span> <span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;run every 4 iterations starting from 3&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">break</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<span style="color: #000000;">&#125;</span></div></td></tr></tbody></table></div>]]></content:encoded>
			<wfw:commentRss>http://www.eoingriffin.com/code-hints/useful-hints-1-oddeven-numbers-modulo-operator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Phone GUI project</title>
		<link>http://www.eoingriffin.com/portfolio/phone-gui-project/</link>
		<comments>http://www.eoingriffin.com/portfolio/phone-gui-project/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 02:10:18 +0000</pubDate>
		<dc:creator>Eoin</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[GUI]]></category>
		<category><![CDATA[Illustrator]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Phone]]></category>
		<category><![CDATA[Photoshop]]></category>

		<guid isPermaLink="false">http://www.eoingriffin.com/?p=124</guid>
		<description><![CDATA[Created as part of a GUI studies assigment. The task was to create a prototype interface for an imaginary competitor to the iphone.
All design, image creation and coding was implemented by me (with the exception of the Firefox and RSS logos).
Uses: Actionscript, Flash, Illustrator, Photoshop












Icon set:]]></description>
			<content:encoded><![CDATA[<p>Created as part of a <acronym title="Graphical User Interface">GUI</acronym> studies assigment. The task was to create a prototype interface for an imaginary competitor to the iphone.<br />
All design, image creation and coding was implemented by me (with the exception of the Firefox and <acronym title="Really Simple Syndication">RSS</acronym> logos).</p>
<pre>Uses: Actionscript, Flash, Illustrator, Photoshop
</pre>
<p>
<object width="320" height="480">
<param name="movie" value="http://www.eoingriffin.com/images/gui/eoingriffin_gui.swf"></param>
<param name="quality" value="high"></param>
<param name="wmode" value="window"></param>
<param name="menu" value="false"></param>
<param name="bgcolor" value="#FFFFFF"></param>
<embed type="application/x-shockwave-flash" width="320" height="480" src="http://www.eoingriffin.com/images/gui/eoingriffin_gui.swf" quality="high" bgcolor="#FFFFFF" wmode="window" menu="false" ></embed>
</object>
<br />
<span id="more-124"></span><br />
Icon set:</p>
<div id="attachment_132" class="wp-caption aligncenter" style="width: 242px"><a href="http://www.eoingriffin.com/wp-content/uploads/2010/01/icons-e1264637254275.jpg"><img class="size-medium wp-image-132" title="icons" src="http://www.eoingriffin.com/wp-content/uploads/2010/01/icons-e1264637254275-232x300.jpg" alt="Icons" width="232" height="300" /></a><p class="wp-caption-text">Icon set created for the interface. Click for larger version.</p></div>]]></content:encoded>
			<wfw:commentRss>http://www.eoingriffin.com/portfolio/phone-gui-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Internet Storytime</title>
		<link>http://www.eoingriffin.com/portfolio/internet-storytime/</link>
		<comments>http://www.eoingriffin.com/portfolio/internet-storytime/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 20:45:05 +0000</pubDate>
		<dc:creator>Eoin</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[eBook]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.eoingriffin.com/?p=55</guid>
		<description><![CDATA[Internet Storytime is a project I&#8217;m currently involved in as a Flash and Actionscript developer.
The goal of the application is to create a book player that will allow people with little or no Flash scripting skills to easily create children&#8217;s storybooks for an online audience.
What makes this player stand apart from a regular book or [...]]]></description>
			<content:encoded><![CDATA[<p>Internet Storytime is a project I&#8217;m currently involved in as a Flash and Actionscript developer.<br />
The goal of the application is to create a book player that will allow people with little or no Flash scripting skills to easily create children&#8217;s storybooks for an online audience.<br />
What makes this player stand apart from a regular book or other online books is its versatility. The <acronym title="Internet Storytime">IST</acronym> book player allows a person to easily script text, images with animations and audio in their books to create a unique interactive experience that will help them engage a young audience.</p>
<p><a href="http://www.internetstorytime.com"><img class="aligncenter size-full wp-image-60" title="InternetStorytime.com" src="http://www.eoingriffin.com/wp-content/uploads/2010/01/IW_logo-e1264633153474.jpg" alt="InternetStorytime.com logo" width="360" height="119" /></a><br />
<span id="more-55"></span><br />
The instructions for the player are received from an accompanying <acronym title="Extensible Markup Language"><acronym title="eXtensible Markup Language">XML</acronym></acronym> file which I have designed to be as simple as possible, human-readable yet still remain robust and versatile. Flash is not needed to create or edit a book&#8217;s <acronym title="Extensible Markup Language"><acronym title="eXtensible Markup Language">XML</acronym></acronym> file.</p>
<p>This project is currently under development. Please not that the content inside does not reflect how the final version will look, however the code (because that&#8217;s what i do) is top notch <img src='http://www.eoingriffin.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<pre>Uses: Actionscript, Flash, <acronym title="eXtensible Markup Language">XML</acronym></pre>
<div id="attachment_111" class="wp-caption aligncenter" style="width: 356px"><a href="http://www.eoingriffin.com/internetstorytime/"><img class="size-full wp-image-111" title="internetstorytime" src="http://www.eoingriffin.com/wp-content/uploads/2010/01/internetstorytime.jpg" alt="IST Book Player screenshot" width="346" height="487" /></a><p class="wp-caption-text">IST Book Player screenshot</p></div>]]></content:encoded>
			<wfw:commentRss>http://www.eoingriffin.com/portfolio/internet-storytime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
