<?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>aloft</title>
	<atom:link href="http://www.aloft.nl/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.aloft.nl</link>
	<description>web development &#38; more</description>
	<lastBuildDate>Wed, 21 Mar 2012 13:40:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Tweets in your HTML page</title>
		<link>http://www.aloft.nl/2012/03/tweets-in-your-html-page/</link>
		<comments>http://www.aloft.nl/2012/03/tweets-in-your-html-page/#comments</comments>
		<pubDate>Wed, 21 Mar 2012 11:31:28 +0000</pubDate>
		<dc:creator>Manno</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://www.aloft.nl/?p=331</guid>
		<description><![CDATA[[More or less for the class I teach now] For showing your tweets (or anyone&#8217;s for that matter) in a website, twitter offers two JavaScript files, blogger.js and user_timeline.json. To make it work, there&#8217;s three steps to take: Add one specific HTML element as a placeholder for the tweets Embed two JavaScript files into your [...]]]></description>
			<content:encoded><![CDATA[<p>[More or less for the class I teach now]</p>
<p>For showing your tweets (or anyone&#8217;s for that matter) in a website, twitter offers two JavaScript files, blogger.js and user_timeline.json. To make it work, there&#8217;s three steps to take:</p>
<ol>
<li>Add one specific HTML element as a placeholder for the tweets</li>
<li>Embed two JavaScript files into your page</li>
<li>Add some CSS to have it show the way you want</li>
</ol>
<p>Following is a short explanation of how it works.</p>
<h2>The HTML</h2>
<p>You only need to place one HTML element in your page into which the tweets end up. This element needs to have the id attribute set to <em>twitter_update_list</em>. This is because the scripts need to know where to put the tweets. In the example below I use a unordered list ( &lt;ul&gt; ) as a placeholder. So, somewhere in my page there is this code:</p>
<div class="codecolorer-container html4strict default" 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 /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;">&lt;!-- placeholder for the tweets --&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/ul.html"><span style="color: #000000; font-weight: bold;">ul</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;twitter_update_list&quot;</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/ul.html"><span style="color: #000000; font-weight: bold;">ul</span></a>&gt;</span></div></td></tr></tbody></table></div>
<h2>The JavaScript files</h2>
<p>The two files can be linked to your page from the twitter server, so no need to host them yourselves. The embedding can be done by copy pasting the following code right below the HTML seen above.</p>
<div class="codecolorer-container html4strict default" 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 /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://twitter.com/javascripts/blogger.js&quot;</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://api.twitter.com/1/statuses/user_timeline.json?screen_name=mannobult&amp;include_rts=1&amp;callback=twitterCallback2&amp;count=4&quot;</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span></div></td></tr></tbody></table></div>
<p>The first can be embedded as is, there&#8217;s no settings to it, nor the real need to change it&#8217;s code. The second does need some settings. They are discussed after the next section.</p>
<h3>blogger.js</h3>
<p>The file you just need to embed, nothing more. This file contains two functions to parse the incoming data into chunks of HTML. Each incoming tweet is placed inside a list item (&lt;li&gt;). Usernames (words preceded with the at-char (@)) are made into links to the twitter timeline of that person. Furthermore, all links are wrapped in an anchor tag. Lastly a link to the actual tweet is created from the id of the tweet. The tekst linking to the tweet is the indication how long ago the tweet was placed. This leads to, for instance, the following HTML structure:</p>
<div class="codecolorer-container html4strict default" 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 /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/span.html"><span style="color: #000000; font-weight: bold;">span</span></a>&gt;</span>@<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://twitter.com/druiven&quot;</span>&gt;</span>druiven<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;</span> tja, al met al niet goedkoop met overnachting enzo :( early bird en docentenkeurtings helpen gelukkig wel...<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/span.html"><span style="color: #000000; font-weight: bold;">span</span></a>&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;font-size:85%&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://twitter.com/mannobult/statuses/178219079629418496&quot;</span>&gt;</span>11 days ago<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span></div></td></tr></tbody></table></div>
<p>Nasty detail IMHO here is the inline styling of the link to the tweet. I guess they had better left it to the CSS of the user. Fortunately there is the !important rule to override it.</p>
<p>    The function that does the parsing looks for an element with the id &#8216;twitter_update_list&#8217; to place all the list items in. Since the parser places the individual tweets into list items, it makes sense to use a list ( (&lt;ul&gt; or (&lt;ol&gt; ) as this html element. </p>
<h3>user_timeline.json</h3>
<p>	This is the script that does the actual request to twitter. Here you can set a number of options to determine what is retrieved from the twitter server. Here is a short overview: 	</p>
<dl>
<dt>user_id</dt>
<dd>The id of the user you want to show the tweets of.</dd>
<dt>screen_name</dt>
<dd>The screen name of the user you want to show the tweets of (this is the name that appears in the browser address bar when you view that user&#8217;s timeline on twitter). Either this one or the user_id needs to be provided, not both.</dd>
<dt>include_rts</dt>
<dd>Show what you retweeted or not. 0 or 1.</dd>
<dt>count</dt>
<dd>How many tweets you want to show. 1 or more.</dd>
<dt>callback</dt>
<dd>Required. Leave as is or write your own JavaScript to parse the data coming in from the server.</dd>
</dl>
<p>    For a more detailed description, see: the <a href="https://dev.twitter.com/docs/api/1/get/statuses/user_timeline">twitter docs</a></p>
<p>All the settings are done as GET parameters on the URL of the script. So, broken into separate lines it reads like:<br />
http://api.twitter.com/1/statuses/user_timeline.json?<br />screen_name=mannobult<br />&#038;include_rts=1<br />&#038;callback=twitterCallback2<br />&#038;count=4</p>
<h2>The CSS</h2>
<p>The CSS you want to add is of course entirely up to you. However, knowing what HTML output the JavaScript generates is necessary.<br />
So you may want CSS for the following elements:</p>
<ul>
<li>The element you placed yourselves (with id=&#8221;twitter_update_list&#8221;)</li>
<li>List items that appear inside it (containing all info of one tweet)</li>
<li>A span element inside the list items</li>
<li>Anchor elements inside the span for any links in the tweet</li>
<li>The anchor element which is a child of the list item (with the link to the tweet)</li>
</ul>
<p>Below an example of what the CSS could look like (comments in the code):</p>
<div class="codecolorer-container css default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:350px;"><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 />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;style type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span><span style="color: #00AA00;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/* The placeholder in which the tweets are placed */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #cc00cc;">#twitter_update_list</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">list-style-type</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">300px</span><span style="color: #00AA00;">;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> Verdana<span style="color: #00AA00;">,</span> Geneva<span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00AA00;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/* Each tweet is wrapped inside a list item, have them spaced by a margin */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #cc00cc;">#twitter_update_list</span> li<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">.2em</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00AA00;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/* have alternating colors for subsequent tweets */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #cc00cc;">#twitter_update_list</span> li<span style="color: #3333ff;">:nth-</span>child<span style="color: #00AA00;">&#40;</span>even<span style="color: #00AA00;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#0CF</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00AA00;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #cc00cc;">#twitter_update_list</span> li<span style="color: #3333ff;">:nth-</span>child<span style="color: #00AA00;">&#40;</span>odd<span style="color: #00AA00;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#09F</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00AA00;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/* the tweet text itself */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #cc00cc;">#twitter_update_list</span> li span<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span>inline-<span style="color: #993333;">block</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">.8em</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0.5em</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00AA00;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/* Links inside the tweet */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #cc00cc;">#twitter_update_list</span> li span a<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00AA00;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/* The link of how long ago the tweet was placed. Note the !important rule to override the inline style rule created by blogger.js */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #cc00cc;">#twitter_update_list</span> li <span style="color: #00AA00;">&gt;</span> a<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0.8em</span> !important<span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#FFF</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0.2em</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> rgba<span style="color: #00AA00;">&#40;</span> <span style="color: #cc66cc;">128</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">128</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">128</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0.7</span> <span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00AA00;">&#125;</span><br />
&nbsp; &nbsp; &lt;/style<span style="color: #00AA00;">&gt;</span></div></td></tr></tbody></table></div>
<p>All the above results in the following:<br />
<img src="/wp-content/uploads/images/tweet shot.png" alt="example of embedded tweets" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aloft.nl/2012/03/tweets-in-your-html-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing HTML5 Game Development by Jesse Freeman (O&#8217;Reilly Media)</title>
		<link>http://www.aloft.nl/2012/02/introducing-html5-game-development-by-jesse-freeman-oreilly-media/</link>
		<comments>http://www.aloft.nl/2012/02/introducing-html5-game-development-by-jesse-freeman-oreilly-media/#comments</comments>
		<pubDate>Mon, 27 Feb 2012 18:41:44 +0000</pubDate>
		<dc:creator>Manno</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[game development]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[impact]]></category>

		<guid isPermaLink="false">http://www.aloft.nl/?p=303</guid>
		<description><![CDATA[Jesse Freeman&#8216;s Introducing HTML5 Game Development, Developing Games with Impact is an excellent read for anyone willing to get their hands dirty with JavaScript as language of choice for game development. It offers general insights on what is needed to develop a game. Topics include writing game design docs, using in game stats to analize [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jessefreeman.com/">Jesse Freeman</a>&#8216;s Introducing HTML5 Game Development, Developing Games with Impact is an excellent read for anyone willing to get their hands dirty with JavaScript as language of choice for game development. It offers general insights on what is needed to develop a game. Topics include writing game design docs, using in game stats to analize player behavior, some asset preparation and more. However, it mainly offers a head start in developing JavaScript based games with the <a href="http://impactjs.com/">Impact game engine</a>, covering next to all it&#8217;s features.</p>
<h2>Disclaimer</h2>
<p>I did not get myself a copy of Impact. Just reviewing the book and not the Impact framework I did not see it as nessecary. Had impact been on sale like it was about a month or so ago I might have gotten my on copy (notch, notch, wink, wink).</p>
<h2>The positives</h2>
<p>Let&#8217;s start with those according to the feedback rules&#8230;</p>
<p>To me te book feels like a cookbook to get one specific game done (&#8220;type this here &#8230;&#8221;) at times. It however gives a good overview of most if not all &#8216;classes&#8217; and possibilities of Impact and how to get up to speed with building a relatively small game with it. Using the accompanying level editor called Weltmeister Jesse shows you how to design levels, how to load them in Impact and bring the level to life. What else can you ask for?</p>
<p>Next to that more or less main goal of the book, you&#8217;ll get an overview of the whole process of game development. From initial idea to publishing (and possible deployment on iOS with a template Xcode project that comes with Impact). Good insights from someone who knows what he is talking about.</p>
<p>Finally it contains some heads up on HTML5 development. I&#8217;m afraid that is still nessecary with the way browser support is at the moment.</p>
<h2>The negatives</h2>
<p>The subtitle of book is a nice pun (and the name of the game framework is well chosen), but may be somewhat misleading for the less informed buyer of the book. Actually tagging along with Jesse in building your own game will set you back $99: the subtitle&#8217;s &#8220;Impact&#8221; refers not only to the effect games may aim to have on their player, but also to the commercial Impact game framework written in JavaScript. Just a fair warning ahead.</p>
<p>Another downside I think there is to the book is the intended audience as it states. Personally I don&#8217;t think this book is much use without having prior programming knowledge. If you have none, you&#8217;ll end up with a working game nonetheless, but I doubt you&#8217;ll understand why, how to change it or to build your own in any reasonable fashion.</p>
<p>Finally, usage of stats to analyze players behaviors is stressed, however, the examples may have been a bit more clear (I&#8217;m pretty much a GA noob)</p>
<h2>Impact</h2>
<p>Without having used the software, it seems like a real nice environment to work with. It comes with a good map editor, several debugging and profiling features. To help with the game mechanics there&#8217;s collision detection and particle systems and most needed features of the box so you can focus on the creative process.</p>
<h2>Concluding</h2>
<p>I&#8217;d by the book if you want to do some JavaScript game dev, especially if it involves platform games. If you have no programming experience I would get some basics done first but I guess it all depends on your individual talent to pick up programming.<br />
It is a quick read and gets you up to speed with Impact in about a day (or two).</p>
<p><a href="http://shop.oreilly.com/product/0636920022633.do">Get HTML5 Game Development</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aloft.nl/2012/02/introducing-html5-game-development-by-jesse-freeman-oreilly-media/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hack, slash &amp; play with kinect at FITC Amsterdam  2012</title>
		<link>http://www.aloft.nl/2012/02/hack-slash-play-with-kinect-at-fitc-amsterdam-2012/</link>
		<comments>http://www.aloft.nl/2012/02/hack-slash-play-with-kinect-at-fitc-amsterdam-2012/#comments</comments>
		<pubDate>Sun, 26 Feb 2012 16:52:51 +0000</pubDate>
		<dc:creator>Manno</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[AIRKinect]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[fitc]]></category>
		<category><![CDATA[kinect]]></category>

		<guid isPermaLink="false">http://www.aloft.nl/?p=284</guid>
		<description><![CDATA[Today the workshops of FITC 2012 took place. I visited Koen De Weggheleire en Wouter Verweirder their Kinect workshop. Koen and Wouter are developers of AIRKinect of which version two is almost to be released. Unfortunately my lovely new MacBook refused to install some of the drivers despite Wouter&#8217;s persistence. Fortunately they had a spare [...]]]></description>
			<content:encoded><![CDATA[<p>Today the workshops of FITC 2012 took place. I visited Koen De Weggheleire en Wouter Verweirder their Kinect workshop.</p>
<p>Koen and Wouter are developers of <a href="http://www.as3nui.com/airkinect-1-7-1/">AIRKinect</a> of which version two is almost to be released. Unfortunately my lovely new MacBook refused to install some of the drivers despite Wouter&#8217;s persistence. Fortunately they had a spare laptop to use (thanks!).</p>
<p>I&#8217;d seen demos and fooled around with the depth image before, but the next version of AIRKinect, used as <a href="http://www.adobe.com/devnet/air/articles/extending-air.html">native extension</a> offers lots more then I&#8217;d ever seen possible in AIR (may of course be my ignorance).</p>
<p>Some of the features of the 2.0 preview we got to play with were:</p>
<ul>
<li>depth image</li>
<li>point cloud</li>
<li>point cloud regions</li>
<li>skeletons</li>
<li>poses</li>
</ul>
<h2>Depth image</h2>
<p>The depth image shows the image the IR camera registers in greyscale. Nearby white, far black. My first ever experiment was that I used this to, pixel by pixel, reconstruct a 2.5D image with Flash&#8217;s z-property of sprites. But&#8230;</p>
<h2>Point cloud</h2>
<p>The point cloud is a ByteArray with for each &#8220;pixel&#8221; an x-, y-, and z-position. This allows for precise tracking of, for instance, the closest thing the IR camera registers. Extend your arm and move stuff around, the famous <a href="http://www.google.nl/search?q=minority+report+interface">Minority Report interface</a> in the making.</p>
<h2>Point cloud regions</h2>
<p>Point cloud regions allow use of hotspots. If a certain region (a box) contains more than a set number of points from the cloud (the count is done by the extension), you could start whatever action you see fit. Du du, du du, du du, du du, ta ta! I can feel it coming in the air tonight &#8230; Drum like Phil Collins for instance.</p>
<h2>Skeletons</h2>
<p>The skeletons you may have seen before. AIRKinect supports 4 skeletons and then some additional center of mass registrations. With the skeletons you have access to the main joints, their position in 3D space, position projected onto the webcam image, orientation and more.</p>
<h2>Poses</h2>
<p>With the skeletons you can create poses, this is actually not done in the extension, but with a few classes in which you can define poses like assertions: right elbow, above, right shoulder. Combine a few of these rules and you can create complex poses which are easy to check. </p>
<p>There is no doubt more, but the distraction of and annoyance over the failures of installing macports probably made me miss out on some&#8230;</p>
<p>All together it requires a somewhat elaborate install sequence (which they will no doubt publish at due time) on the Mac, mine being the odd one out resisting all attempts to get it running. On windows it&#8217;s a <del>bit</del> lot less elaborate. Definitely will try at home to get it running on my desktop. When I succeed, hours of fun will be waiting <img src='http://www.aloft.nl/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><img src="/wp-content/uploads/images/pointcloud.png" alt="Pointcloud" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aloft.nl/2012/02/hack-slash-play-with-kinect-at-fitc-amsterdam-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Limit orientation on devices with ActionScript and the application descriptor</title>
		<link>http://www.aloft.nl/2011/12/limit-orientation-on-devices/</link>
		<comments>http://www.aloft.nl/2011/12/limit-orientation-on-devices/#comments</comments>
		<pubDate>Thu, 01 Dec 2011 21:25:57 +0000</pubDate>
		<dc:creator>Manno</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[AIR 3]]></category>
		<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://www.aloft.nl/?p=266</guid>
		<description><![CDATA[A short one&#8230; To limit orientation of the stage on devices you don&#8217;t need much. In this example I want the application to only be displayed in landscape mode. Loop up the aspectRatio and autoOrients tags in the application descriptor file, and make sure it looks like the following: 12345&#60;initialWindow&#62; &#160; &#160; ... &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>A short one&#8230;</p>
<p>To limit orientation of the stage on devices you don&#8217;t need much. In this example I want the application to only be displayed in landscape mode.</p>
<p>Loop up the aspectRatio and autoOrients tags in the application descriptor file, and make sure it looks like the following:</p>
<div class="codecolorer-container xml default" 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 /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;initialWindow<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; ...<br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;aspectRatio<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>landscape<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/aspectRatio<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;autoOrients<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/autoOrients<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/initialWindow<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p>Then, in the application code, check if the stage is set to auto orient, and if so, listen to the ORIENTATION_CHANGING event:</p>
<div class="codecolorer-container actionscript3 default" 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 /></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;">if</span><span style="color: #000000;">&#40;</span> <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span>autoOrients <span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span> StageOrientationEvent<span style="color: #000066; font-weight: bold;">.</span>ORIENTATION_CHANGING<span style="color: #000066; font-weight: bold;">,</span> autoOrient <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div></td></tr></tbody></table></div>
<p>In the eventlistener, check what the futute orientation will be, it is stored in the event parameter as it&#8217;s afterOrientation property. If that orientation is NOT what you would like it to be, call the event&#8217;s preventDefault() method. The stage will not orient itself.</p>
<p>Below you see the two orientations defining the portrait orientation, StageOrientation.DEFAULT and StageOrientation.UPSIDE_DOWN. The other two, StageOrientation.ROTATED_RIGHT and StageOrientation.ROTATED_LEFT represent the landscape orientation. Since the latter are what I want, the first are prevented.</p>
<div class="codecolorer-container actionscript3 default" 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 /></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: #3f5fbf;">/**<br />
&nbsp;* Rotate only to landscape orientations <br />
&nbsp;* @param event<br />
&nbsp;* <br />
&nbsp;*/</span> &nbsp; &nbsp; <br />
<span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> autoOrient<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span>StageOrientationEvent<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">switch</span><span style="color: #000000;">&#40;</span> event<span style="color: #000066; font-weight: bold;">.</span>afterOrientation <span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">case</span> StageOrientation<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">DEFAULT</span><span style="color: #000066; font-weight: bold;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">case</span> StageOrientation<span style="color: #000066; font-weight: bold;">.</span>UPSIDE_DOWN<span style="color: #000066; font-weight: bold;">:</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; event<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">preventDefault</span><span style="color: #000000;">&#40;</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>
<p>You can find more options at: <a href="http://www.adobe.com/devnet/flash/articles/screen_orientation_apis.html">Adobe&#8217;s website</a></p>
<p>(It turned out to be much easier than reading out the accelerometer and rotating the stage yourself&#8230;)</p>
<p>Folowing code is a more complete example in case you want to test some code. It is the main (and only) class from a Flash Builder project (uses AIR 3 and <a href="http://www.bit-101.com">Keith Peters</a> (AKA Bit-101) his <a href="http://www.minimalcomps.com/">minimalcomps</a>):</p>
<div class="codecolorer-container actionscript3 default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:350px;"><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 />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br />88<br />89<br />90<br />91<br />92<br />93<br />94<br />95<br />96<br />97<br />98<br />99<br />100<br />101<br />102<br />103<br />104<br />105<br />106<br />107<br />108<br />109<br />110<br />111<br />112<br />113<br />114<br />115<br />116<br />117<br />118<br />119<br />120<br />121<br />122<br />123<br />124<br />125<br />126<br />127<br />128<br />129<br />130<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: #9900cc; font-weight: bold;">package</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> com<span style="color: #000066; font-weight: bold;">.</span>bit101<span style="color: #000066; font-weight: bold;">.</span>components<span style="color: #000066; font-weight: bold;">.</span>CheckBox<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> com<span style="color: #000066; font-weight: bold;">.</span>bit101<span style="color: #000066; font-weight: bold;">.</span>components<span style="color: #000066; font-weight: bold;">.</span>TextArea<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=sprite%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:sprite.html"><span style="color: #004993;">Sprite</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=stagealign%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:stagealign.html"><span style="color: #004993;">StageAlign</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span>StageOrientation<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=stagescalemode%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:stagescalemode.html"><span style="color: #004993;">StageScaleMode</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span><span style="color: #000066; font-weight: bold;">.</span>StageOrientationEvent<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000;">&#91;</span>SWF<span style="color: #000000;">&#40;</span> <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;1024&quot;</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;768&quot;</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> RotationResearch <span style="color: #0033ff; font-weight: bold;">extends</span> <a href="http://www.google.com/search?q=sprite%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:sprite.html"><span style="color: #004993;">Sprite</span></a><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> noRotationCheckBox<span style="color: #000066; font-weight: bold;">:</span>CheckBox<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> noPortraitCheckBox<span style="color: #000066; font-weight: bold;">:</span>CheckBox<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> noLandscapeCheckBox<span style="color: #000066; font-weight: bold;">:</span>CheckBox<span style="color: #000066; font-weight: bold;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> noRotation<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=boolean%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:boolean.html"><span style="color: #004993;">Boolean</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> noPortrait<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=boolean%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:boolean.html"><span style="color: #004993;">Boolean</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> noLandscape<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=boolean%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:boolean.html"><span style="color: #004993;">Boolean</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> textArea<span style="color: #000066; font-weight: bold;">:</span>TextArea<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> scaleModifier<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;">3</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> RotationResearch<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// support autoOrients</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">align</span> = <a href="http://www.google.com/search?q=stagealign%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:stagealign.html"><span style="color: #004993;">StageAlign</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">TOP_LEFT</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">scaleMode</span> = <a href="http://www.google.com/search?q=stagescalemode%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:stagescalemode.html"><span style="color: #004993;">StageScaleMode</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">NO_SCALE</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span>autoOrients <span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span> StageOrientationEvent<span style="color: #000066; font-weight: bold;">.</span>ORIENTATION_CHANGING<span style="color: #000066; font-weight: bold;">,</span> handleOrientation <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span> StageOrientationEvent<span style="color: #000066; font-weight: bold;">.</span>ORIENTATION_CHANGE<span style="color: #000066; font-weight: bold;">,</span> onOrientation <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buildUI<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3f5fbf;">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* Create User interface <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*/</span> &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> buildUI<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; noRotationCheckBox = <span style="color: #0033ff; font-weight: bold;">new</span> CheckBox<span style="color: #000000;">&#40;</span> <span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">40</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">40</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #990000;">&quot;Stop all rotation&quot;</span><span style="color: #000066; font-weight: bold;">,</span> allRotationCheckboxHandler <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; noRotationCheckBox<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">scaleX</span> = noRotationCheckBox<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">scaleY</span> = scaleModifier<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; noPortraitCheckBox = <span style="color: #0033ff; font-weight: bold;">new</span> CheckBox<span style="color: #000000;">&#40;</span> <span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">40</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">height</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #000000; font-weight:bold;">40</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #990000;">&quot;Stop portrait orientation&quot;</span><span style="color: #000066; font-weight: bold;">,</span> portraitRotationCheckboxHandler <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; noPortraitCheckBox<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">scaleX</span> = noPortraitCheckBox<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">scaleY</span> = scaleModifier<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; noLandscapeCheckBox = <span style="color: #0033ff; font-weight: bold;">new</span> CheckBox<span style="color: #000000;">&#40;</span> <span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">40</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">height</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #000000; font-weight:bold;">40</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #990000;">&quot;Stop landscape orientation&quot;</span><span style="color: #000066; font-weight: bold;">,</span> landscapeRotationCheckboxHandler <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; noLandscapeCheckBox<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">scaleX</span> = noLandscapeCheckBox<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">scaleY</span> = scaleModifier<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; textArea = <span style="color: #0033ff; font-weight: bold;">new</span> TextArea<span style="color: #000000;">&#40;</span> <span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">40</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">height</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #000000; font-weight:bold;">40</span> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; textArea<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">scaleX</span> = textArea<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">scaleY</span> = scaleModifier<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3f5fbf;">/*<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* Checkbox eventhandlers<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> allRotationCheckboxHandler<span style="color: #000000;">&#40;</span> event<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span> &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; noRotation = noRotationCheckBox<span style="color: #000066; font-weight: bold;">.</span>selected<span style="color: #000066; font-weight: bold;">;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> portraitRotationCheckboxHandler<span style="color: #000000;">&#40;</span> event<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; noPortrait = noPortraitCheckBox<span style="color: #000066; font-weight: bold;">.</span>selected<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> landscapeRotationCheckboxHandler<span style="color: #000000;">&#40;</span> event<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; noLandscape = noLandscapeCheckBox<span style="color: #000066; font-weight: bold;">.</span>selected<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3f5fbf;">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* Output of last rotation after the fact<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* @param event<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*/</span> &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> onOrientation<span style="color: #000000;">&#40;</span> event<span style="color: #000066; font-weight: bold;">:</span>StageOrientationEvent <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; textArea<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span> = <span style="color: #990000;">&quot;orientation was: &quot;</span> <span style="color: #000066; font-weight: bold;">+</span> event<span style="color: #000066; font-weight: bold;">.</span>beforeOrientation <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #990000;">&quot;<span style="">\n</span>orientation is: &quot;</span> <span style="color: #000066; font-weight: bold;">+</span> event<span style="color: #000066; font-weight: bold;">.</span>afterOrientation<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3f5fbf;">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* Triggered before rotaion takes place.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* Checks which orientations are allowed based on the checkboxes<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* @param event<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*/</span> &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> handleOrientation<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span>StageOrientationEvent<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> noRotation <span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; event<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">preventDefault</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">return</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">switch</span><span style="color: #000000;">&#40;</span> event<span style="color: #000066; font-weight: bold;">.</span>afterOrientation <span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">case</span> StageOrientation<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">DEFAULT</span><span style="color: #000066; font-weight: bold;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> noPortrait <span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; event<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">preventDefault</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &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; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">case</span> StageOrientation<span style="color: #000066; font-weight: bold;">.</span>UPSIDE_DOWN<span style="color: #000066; font-weight: bold;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> noPortrait <span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; event<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">preventDefault</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &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; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">case</span> StageOrientation<span style="color: #000066; font-weight: bold;">.</span>ROTATED_LEFT<span style="color: #000066; font-weight: bold;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> noLandscape <span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; event<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">preventDefault</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &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; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">case</span> StageOrientation<span style="color: #000066; font-weight: bold;">.</span>ROTATED_RIGHT<span style="color: #000066; font-weight: bold;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> noLandscape <span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; event<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">preventDefault</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &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; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</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.aloft.nl/2011/12/limit-orientation-on-devices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Determine iOS device type with ActionScript 3.0</title>
		<link>http://www.aloft.nl/2011/11/determine-ios-device-type-with-actionscript-3-0/</link>
		<comments>http://www.aloft.nl/2011/11/determine-ios-device-type-with-actionscript-3-0/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 15:05:45 +0000</pubDate>
		<dc:creator>Manno</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://www.aloft.nl/?p=244</guid>
		<description><![CDATA[Since I couldn&#8217;t find any articles offering the following solution to the problem of figuring out what specific iOS device an AIR app is running on I figured I&#8217;d post this short one. For a current project I need to know what version of the iPad an AIR app is running on. I saw solutions [...]]]></description>
			<content:encoded><![CDATA[<p>Since I couldn&#8217;t find any articles offering the following solution to the problem of figuring out what specific iOS device an AIR app is running on I figured I&#8217;d post this short one.</p>
<p>For a current project I need to know what version of the iPad an AIR app is running on. I saw solutions measuring screen resolutions to get info whether an app runs in iPhone or iPad, but no posts on differentiating between iPad 1 and iPad 2. The <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/system/Capabilities.html">Capabilities</a> class seems to have the solution. Below is the output of the</p>
<div class="codecolorer-container actionscript3 default" 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"><a href="http://www.google.com/search?q=capabilities%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:capabilities.html"><span style="color: #004993;">Capabilities</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">os</span></div></td></tr></tbody></table></div>
<p>property for the iPhone 4, iPad 1 and iPad 2.</p>
<p>iPhone 4 gives you:<br />
iPhone OS 5.0 iPhone3,1</p>
<p>iPad 1 gives you:<br />
iPhone OS 4.2.1 iPad1,1</p>
<p>iPad 2 gives you:<br />
iPhone OS 5.0 iPad2,1</p>
<p>This info breaks down into:</p>
<ul>
<li>The OS (the name apparently always is iPhone OS) with it&#8217;s version number (the iPad one in my case still running iOS 4)</li>
<li>The device id which holds the device name and the device ID</li>
</ul>
<p>The device name and its ID apparently are different as for example the <a href="http://www.techet.net/projects/sysstat">System Status</a> reports. System Status for instance has &#8220;iPhone 4&#8243; listed as being the Device and &#8220;iPhone3,1&#8243; as the Device ID. The device IDs for the iPad are more descriptive, but once you know what to look for it does not really matter what it lists I guess&#8230;</p>
<p>Anyone have the info for the iPhone 3?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aloft.nl/2011/11/determine-ios-device-type-with-actionscript-3-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GPU accelerated rendering with Starling</title>
		<link>http://www.aloft.nl/2011/10/gpu-accelerated-rendering-with-starling/</link>
		<comments>http://www.aloft.nl/2011/10/gpu-accelerated-rendering-with-starling/#comments</comments>
		<pubDate>Wed, 19 Oct 2011 21:10:40 +0000</pubDate>
		<dc:creator>Manno</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[2D]]></category>
		<category><![CDATA[AIR 3]]></category>
		<category><![CDATA[Flash player 11]]></category>
		<category><![CDATA[GPU]]></category>
		<category><![CDATA[starling]]></category>

		<guid isPermaLink="false">http://www.aloft.nl/2011/10/gpu-accelerated-rendering-with-starling/</guid>
		<description><![CDATA[A note to myself: I need to experiment with GPU accelerated rendering. Really&#8230; With the new GPU rendering capabilities of Flash player 11 and AIR 3, which go under the name Stage3D (formerly known as MoleHill) performance should be greatly improved in &#8230; some, all(?) cases. Since it has been a long time I did [...]]]></description>
			<content:encoded><![CDATA[<p>A note to myself: I need to experiment with GPU accelerated rendering. Really&#8230;</p>
<p>With the new GPU rendering capabilities of Flash player 11 and AIR 3, which go under the name Stage3D (formerly known as MoleHill) performance should be greatly improved in &#8230; some, all(?) cases. Since it has been a long time I did anything with actual 3D modeling, the logical place to start is 2D. Dreading <a href="http://www.bytearray.org/?p=2555">the complexity of the Stage3D API&#8217;s</a> I will focus on the Starling framework. There is a nice <a href="http://www.adobe.com/devnet/flashplayer/articles/introducing_Starling.html">example of what complexity Starling hides from you</a> on the Adobe devnet pages. The following links will be my first information providers while experimenting I guess.</p>
<p>Of course the <a href="http://doc.starling-framework.org/core/">Starling API documentation</a>.</p>
<p>Also: Lee Brimelow has two video tutorials on his gotoAndLearn site. One <a href="http://gotoandlearn.com/play.php?id=147">introducing the Starling framework</a> and one explaining <a href="http://gotoandlearn.com/play.php?id=151">how to use particles in the Starling framework</a> with <a href="http://onebyonedesign.com/flash/particleeditor/">one by one design&#8217;s particle editor</a>. Lee will also host a workshop at <a href="http://www.fitc.ca/news/?p=1442">Flash in the Can Amsterdam 2012</a>.</p>
<p>The framework was written by the Austrian <a href="http://gamua.com/">Gamua</a>, also responsible for <a href="http://www.sparrow-framework.org/">the sparrow framework for objective-C</a> (another thing which desperately needs being looked in to) which in it&#8217;s turn is loosly based on the Flash display list API.</p>
<p>If you wonder why a separate library is needed in stead of using the standard display list, the following article explains <a href="http://blog.kaourantin.net/?p=138">why Starling is a good idea for 2D GPU rendered content</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aloft.nl/2011/10/gpu-accelerated-rendering-with-starling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Random and constrained circular motion</title>
		<link>http://www.aloft.nl/2011/04/random-and-constrained-circular-motion/</link>
		<comments>http://www.aloft.nl/2011/04/random-and-constrained-circular-motion/#comments</comments>
		<pubDate>Fri, 01 Apr 2011 18:30:51 +0000</pubDate>
		<dc:creator>Manno</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[circular]]></category>
		<category><![CDATA[motion]]></category>
		<category><![CDATA[random]]></category>

		<guid isPermaLink="false">http://www.aloft.nl/?p=161</guid>
		<description><![CDATA[For a small project in the near future I could need some objects to move fairly random, but constrained to a specific area. After a quick look on the web I thought of something I read before but could not find anymore. It involves movement aided by two circles and is (IMHO) really easy to [...]]]></description>
			<content:encoded><![CDATA[<p>For a small project in the near future I could need some objects to move fairly random, but constrained to a specific area. After a quick look on the web I thought of something I read before but could not find anymore. It involves movement aided by two circles and is (IMHO) really easy to grasp. Here&#8217;s a quick explanation.</p>
<p>Imagine (if you can&#8217;t, there a picture below doing it for you) one circle in the middle. OK, now imagine another circle centered on the edge of the first. This second circle moves over the circumference of the first, thus describing a circular motion. Now place something on the edge of the second circle and have it move over it&#8217;s circumference. Depending on the size of the circles and the rotation speeds the object on the outer circle describes a lot of different motions looking a bit like a <a href="http://en.wikipedia.org/wiki/Spirograph">spirograph</a>.</p>
<div class="wp-caption alignnone" style="width: 238px"><img title="random circles" src="/wp-content/uploads/images/motion-circles.png" alt="" width="228" height="228" /><p class="wp-caption-text">The two circles and the moving object (blue)</p></div>
<p>In the above image, the red circle is the first one. The green one moves over the circumference of the red one. The blue dot moves over the circumference of the green circle. It cannot get outside of the blue circle.</p>
<p>This however is a very regular motion. Not what I had in mind or promised you with the title of this post. There&#8217;s no long explanation to it, so I&#8217;ll get to it right away: To make the motion random, just have the direction of both the rotations alter at random intervals. Not to often or the final object moves in a jittery fashion (and may not even leave it&#8217;s position), not to few or the object moves to predictable. In the example below you can alter the frequency of the direction change as well as the speed of rotation (with thanks to <a href="http://www.minimalcomps.com/">http://www.minimalcomps.com/</a>).</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_RandomMotion_13882637"
			class="flashmovie"
			width="400"
			height="500">
	<param name="movie" value="/wp-content/uploads/RandomMotion.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/wp-content/uploads/RandomMotion.swf"
			name="fm_RandomMotion_13882637"
			width="400"
			height="500">
	<!--<![endif]-->
		<a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>Right-click on the flash file to view the source files.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aloft.nl/2011/04/random-and-constrained-circular-motion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fullscreen with masks not added to stage</title>
		<link>http://www.aloft.nl/2011/03/fullscreen-with-masks-not-added-to-stage/</link>
		<comments>http://www.aloft.nl/2011/03/fullscreen-with-masks-not-added-to-stage/#comments</comments>
		<pubDate>Fri, 11 Mar 2011 18:20:39 +0000</pubDate>
		<dc:creator>Manno</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[fullscreen]]></category>
		<category><![CDATA[mask]]></category>
		<category><![CDATA[stage]]></category>

		<guid isPermaLink="false">http://www.aloft.nl/?p=122</guid>
		<description><![CDATA[Just so anyone else won&#8217;t waste any time on this&#8230; Situation You want a Flash file allowing fullscreen playback in the browser. Next to this you have a DisplayObject somewhere on the stage with a mask applied to it by script. Problem The mask does not work properly in fullscreen mode. When going fullscreen, the [...]]]></description>
			<content:encoded><![CDATA[<p>Just so anyone else won&#8217;t waste any time on this&#8230;</p>
<h3>Situation</h3>
<p>You want a Flash file allowing fullscreen playback in the browser. Next to this you have a DisplayObject somewhere on the stage with a mask applied to it by script.</p>
<h3>Problem</h3>
<p>The mask does not work properly in fullscreen mode. When going fullscreen, the content scales as it should but the mask shows only a portion of what it showed before.</p>
<h3>Solution</h3>
<p>If you dit not add the mask to the stage (which you don&#8217;t really need to do if nothing is about to scale), the mask does not scale with the rest of the content when the StageDisplayState goes FULL_SCREEN. Because of this it reveals the same area in square pixels (w x h), but since all the rest is scaled up, this is only a small surface compared to what it revealed before.</p>
<p>So, the lesson to be learned: If you&#8217;re gonna allow fullscreen mode in your application and use masks, add them to the display list. Maybe just add them to the display list, period. The few times not having to type the line:</p>
<div class="codecolorer-container actionscript3 default" 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"><span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span> theMask <span style="color: #000000;">&#41;</span></div></td></tr></tbody></table></div>
<p>probably saved less time than I had to spend hunting this error. Below an example showing the error (above) and the proper result (below).</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_NotAddedMask_1510413083"
			class="flashmovie"
			width="320"
			height="240">
	<param name="movie" value="/wp-content/uploads/NotAddedMask.swf" />
	<param name="allowfullscreen" value="true" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/wp-content/uploads/NotAddedMask.swf"
			name="fm_NotAddedMask_1510413083"
			width="320"
			height="240">
		<param name="allowfullscreen" value="true" />
	<!--<![endif]-->
		<a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_AddedMask_715758256"
			class="flashmovie"
			width="320"
			height="240">
	<param name="movie" value="/wp-content/uploads/AddedMask.swf" />
	<param name="allowfullscreen" value="true" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/wp-content/uploads/AddedMask.swf"
			name="fm_AddedMask_715758256"
			width="320"
			height="240">
		<param name="allowfullscreen" value="true" />
	<!--<![endif]-->
		<a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<h3>Code</h3>
<div class="codecolorer-container actionscript3 default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:350px;"><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 />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br />88<br />89<br />90<br />91<br />92<br />93<br />94<br />95<br />96<br />97<br />98<br />99<br />100<br />101<br />102<br />103<br />104<br />105<br />106<br />107<br />108<br />109<br />110<br />111<br />112<br />113<br />114<br />115<br />116<br />117<br />118<br />119<br />120<br />121<br />122<br />123<br />124<br />125<br />126<br />127<br />128<br />129<br />130<br />131<br />132<br />133<br />134<br />135<br />136<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: #9900cc; font-weight: bold;">package</span> &nbsp;<br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=sprite%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:sprite.html"><span style="color: #004993;">Sprite</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=stagescalemode%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:stagescalemode.html"><span style="color: #004993;">StageScaleMode</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=stagealign%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:stagealign.html"><span style="color: #004993;">StageAlign</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=event%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:event.html"><span style="color: #004993;">Event</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.geom</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=point%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:point.html"><span style="color: #004993;">Point</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=textfield%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:textfield.html"><span style="color: #004993;">TextField</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=textformat%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:textformat.html"><span style="color: #004993;">TextFormat</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=textformatalign%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:textformatalign.html"><span style="color: #004993;">TextFormatAlign</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=textfieldautosize%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:textfieldautosize.html"><span style="color: #004993;">TextFieldAutoSize</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.geom</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=matrix%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:matrix.html"><span style="color: #004993;">Matrix</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=spreadmethod%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:spreadmethod.html"><span style="color: #004993;">SpreadMethod</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=gradienttype%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:gradienttype.html"><span style="color: #004993;">GradientType</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #3f5fbf;">/**<br />
&nbsp; &nbsp; &nbsp;* Class to demonstrate a mask needs to be added to stage <br />
&nbsp; &nbsp; &nbsp;* in order to function properly and scale up along with the rest<br />
&nbsp; &nbsp; &nbsp;* when stuff goes fullscreen<br />
&nbsp; &nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> AddedMask <span style="color: #0033ff; font-weight: bold;">extends</span> <a href="http://www.google.com/search?q=sprite%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:sprite.html"><span style="color: #004993;">Sprite</span></a> <br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// the mask</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> m<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=sprite%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:sprite.html"><span style="color: #004993;">Sprite</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3f5fbf;">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* build some interface and animation to make clear what is going on<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> AddedMask<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">scaleMode</span> = <a href="http://www.google.com/search?q=stagescalemode%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:stagescalemode.html"><span style="color: #004993;">StageScaleMode</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">SHOW_ALL</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">align</span> = <a href="http://www.google.com/search?q=stagealign%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:stagealign.html"><span style="color: #004993;">StageAlign</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">TOP_LEFT</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; drawText<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> fsButton = <span style="color: #0033ff; font-weight: bold;">new</span> FSButton<span style="color: #000000;">&#40;</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: #004993;">addChild</span><span style="color: #000000;">&#40;</span> fsButton <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; drawBackground<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; drawMask<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3f5fbf;">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* Funciton which draws the mask (in this case across the whole stage)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* More or less what it's all about<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> drawMask<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// the mask</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=sprite%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:sprite.html"><span style="color: #004993;">Sprite</span></a><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">graphics</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">beginFill</span><span style="color: #000000;">&#40;</span> 0x000000 <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">graphics</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">drawRect</span><span style="color: #000000;">&#40;</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">stageWidth</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">stageHeight</span> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">graphics</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">endFill</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// make sure the mask is added to the display list...</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span> m <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">mask</span> = m<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3f5fbf;">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* function to fill the background<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> drawBackground<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> matr<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=matrix%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:matrix.html"><span style="color: #004993;">Matrix</span></a> = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=matrix%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:matrix.html"><span style="color: #004993;">Matrix</span></a><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; matr<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">createGradientBox</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">50</span><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> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0</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: #6699cc; font-weight: bold;">var</span> spreadMethod<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a> = <a href="http://www.google.com/search?q=spreadmethod%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:spreadmethod.html"><span style="color: #004993;">SpreadMethod</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">REFLECT</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">graphics</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">beginGradientFill</span><span style="color: #000000;">&#40;</span> <a href="http://www.google.com/search?q=gradienttype%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:gradienttype.html"><span style="color: #004993;">GradientType</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">LINEAR</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000;">&#91;</span> 0x666666<span style="color: #000066; font-weight: bold;">,</span> 0xCCCCCC <span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000;">&#91;</span> 0x00<span style="color: #000066; font-weight: bold;">,</span> 0xFF <span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">,</span> matr<span style="color: #000066; font-weight: bold;">,</span> spreadMethod <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">graphics</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">drawRect</span><span style="color: #000000;">&#40;</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">stageWidth</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">stageHeight</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: #004993;">graphics</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">endFill</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3f5fbf;">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* some text<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> drawText<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> tf<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=textfield%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:textfield.html"><span style="color: #004993;">TextField</span></a> = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=textfield%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:textfield.html"><span style="color: #004993;">TextField</span></a><span style="color: #000000;">&#40;</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: #6699cc; font-weight: bold;">var</span> tfm<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=textformat%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:textformat.html"><span style="color: #004993;">TextFormat</span></a> = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=textformat%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:textformat.html"><span style="color: #004993;">TextFormat</span></a><span style="color: #000000;">&#40;</span> <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">24</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000066; font-weight: bold;">,</span> <a href="http://www.google.com/search?q=textformatalign%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:textformatalign.html"><span style="color: #004993;">TextFormatAlign</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">CENTER</span> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tf<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">autoSize</span> = <a href="http://www.google.com/search?q=textfieldautosize%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:textfieldautosize.html"><span style="color: #004993;">TextFieldAutoSize</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">CENTER</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tf<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">defaultTextFormat</span> = tfm<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tf<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span> = <span style="color: #990000;">&quot;See if you can still read this <span style="">\n</span> after going FullScreen&quot;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tf<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span> = <span style="color: #000000;">&#40;</span><span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">stageWidth</span> <span style="color: #000066; font-weight: bold;">-</span> tf<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">width</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">/</span> <span style="color: #000000; font-weight:bold;">2</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tf<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span> = <span style="color: #000000;">&#40;</span><span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">stageHeight</span> <span style="color: #000066; font-weight: bold;">-</span> tf<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">height</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">/</span> <span style="color: #000000; font-weight:bold;">2</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span> tf <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<span style="color: #000000;">&#125;</span><br />
<br />
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=sprite%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:sprite.html"><span style="color: #004993;">Sprite</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span>StageDisplayState<span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=textfield%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:textfield.html"><span style="color: #004993;">TextField</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=textfieldautosize%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:textfieldautosize.html"><span style="color: #004993;">TextFieldAutoSize</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=textformat%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:textformat.html"><span style="color: #004993;">TextFormat</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=textformatalign%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:textformatalign.html"><span style="color: #004993;">TextFormatAlign</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
<br />
<span style="color: #9900cc; font-weight: bold;">class</span> FSButton <span style="color: #0033ff; font-weight: bold;">extends</span> <a href="http://www.google.com/search?q=sprite%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:sprite.html"><span style="color: #004993;">Sprite</span></a><br />
<span style="color: #000000;">&#123;</span> <br />
&nbsp; &nbsp; <span style="color: #339966; font-weight: bold;">function</span> FSButton<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">graphics</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">beginFill</span><span style="color: #000000;">&#40;</span> 0x6666FF <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">graphics</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">drawRect</span><span style="color: #000000;">&#40;</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0</span><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> <span style="color: #000000; font-weight:bold;">50</span> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">graphics</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">endFill</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// some text</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> tf<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=textfield%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:textfield.html"><span style="color: #004993;">TextField</span></a> = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=textfield%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:textfield.html"><span style="color: #004993;">TextField</span></a><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> tfm<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=textformat%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:textformat.html"><span style="color: #004993;">TextFormat</span></a> = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=textformat%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:textformat.html"><span style="color: #004993;">TextFormat</span></a><span style="color: #000000;">&#40;</span> <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">12</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000066; font-weight: bold;">,</span> <a href="http://www.google.com/search?q=textformatalign%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:textformatalign.html"><span style="color: #004993;">TextFormatAlign</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">CENTER</span> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; tf<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">defaultTextFormat</span> = tfm<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; tf<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">autoSize</span> = <a href="http://www.google.com/search?q=textfieldautosize%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:textfieldautosize.html"><span style="color: #004993;">TextFieldAutoSize</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">LEFT</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; tf<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span> = <span style="color: #990000;">&quot;Press<span style="">\n</span>me&quot;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; tf<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span> = <span style="color: #000000;">&#40;</span><span style="color: #004993;">width</span> <span style="color: #000066; font-weight: bold;">-</span> tf<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">width</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">/</span> <span style="color: #000000; font-weight:bold;">2</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; tf<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span> = <span style="color: #000000;">&#40;</span><span style="color: #004993;">height</span> <span style="color: #000066; font-weight: bold;">-</span> tf<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">height</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">/</span> <span style="color: #000000; font-weight:bold;">2</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; tf<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">selectable</span> = <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; tf<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">mouseEnabled</span> = <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span> tf <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">buttonMode</span> = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span> <a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">CLICK</span><span style="color: #000066; font-weight: bold;">,</span> fs <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> fs<span style="color: #000000;">&#40;</span> event<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span> <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">displayState</span> <span style="color: #000066; font-weight: bold;">!</span>= StageDisplayState<span style="color: #000066; font-weight: bold;">.</span>FULL_SCREEN <span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">displayState</span> = StageDisplayState<span style="color: #000066; font-weight: bold;">.</span>FULL_SCREEN<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">displayState</span> = StageDisplayState<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">NORMAL</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.aloft.nl/2011/03/fullscreen-with-masks-not-added-to-stage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FITC, day two</title>
		<link>http://www.aloft.nl/2011/03/fitc-day-two/</link>
		<comments>http://www.aloft.nl/2011/03/fitc-day-two/#comments</comments>
		<pubDate>Thu, 10 Mar 2011 20:57:06 +0000</pubDate>
		<dc:creator>Manno</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[fitc]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[unity]]></category>

		<guid isPermaLink="false">http://www.aloft.nl/?p=78</guid>
		<description><![CDATA[The second day of FITC Amsterdam was another day full of great presentations. This is what I saw (and remembered). Paul Trani He showed optimization tips in the Flash IDE. Tips however were more general than that. First thing he mentioned was the huge PPI differences across devices. Ranging from 120 to 300something (a huge difference). [...]]]></description>
			<content:encoded><![CDATA[<p>The second day of <a href="http://www.fitc.ca/events/about/?event=115">FITC Amsterdam</a> was another day full of great presentations. This is what I saw (and remembered).</p>
<h3>Paul Trani</h3>
<p>He showed optimization tips in the Flash IDE. Tips however were more general than that. First thing he mentioned was the huge PPI differences across devices. Ranging from 120 to 300something (a huge difference). Scaling interface elements based on Capabilities.screenDPI is one of the solutions for it: setting an object&#8217;s width to the Capabilities.screenDPI makes it one inch wide. Build your own little app that reads <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/system/Capabilities.html">the capabilities of a device</a> before you start developing for it. This brings back memories of &#8220;best viewed in &#8230;&#8221; days where cross browser development was not as easy as nowadays, however, Adobe seems to do a good job with the next releases in accommodating for all the different devices. The multi screen development as they call it. It remains a wild, wild world out there however. The examples Paul showed had timeline code (for which he apologized <img src='http://www.aloft.nl/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ) but had a nice way of sort of seperating the model and view. His example shooter ran with just one document class for all devices and decive specific code in the document itself.</p>
<p>To save some of the precious screen real estate, you need to make sure you know the capabilities of the device and what the general user expects to use to navigate. You can get rid of a lot of the buttons and let gestures be used for navigation, so like Stacy said yesterday, think really well about what you&#8217;re designing for.</p>
<p>Furtermore there were tips on all kinds of performance thingies:</p>
<ul>
<li>bitmaps instead of vecors</li>
<li><a href="http://www.adobe.com/devnet/flex/articles/actionscript_blitting.html">blitting for faster drawing</a> (see <a href="http://www.bit-101.com/blog/?p=2948">SWFSheet</a> from Bit 101 or <a href="http://gskinner.com/blog/archives/2011/02/zoe-export-swf-animation-as-easeljs-spritesheets.html">Zoë </a> by Grant Skinner to aid creating spritesheets)</li>
<li>use cacheAsBitmap for elements only moving (x and y axis only)</li>
<li>use cacheAsBitmapMatrix for elements rotating and scaling etc</li>
<li>move displayobjects over whole pixels, not subpixels</li>
<li>use Graphics over Sprite over MovieClips if you can to preserve memory</li>
<li>remember to remove (unloadandstop of removechild) ojects when not needed anymore</li>
<li>take redraw regions into account ()</li>
<li>Use <a href="http://help.adobe.com/en_US/as3/mobile/WS948100b6829bd5a6-19cd3c2412513c24bce-8000.html">object pooling</a></li>
</ul>
<p>This it can be found too on <a href="http://www.bytearray.org/?p=1363">Thibault&#8217;s blog</a> <a href="http://help.adobe.com/en_US/as3/mobile/index.html">and</a> <a href="http://www.riagora.com/2010/04/flash-optimization-on-mobile/">other</a> <a href="http://blog.benstucki.net/?p=65">places</a>. So much reading to do&#8230; <img src='http://www.aloft.nl/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Next to a Space Invaders type of demo he showed, a nice piece of eyecandy shown was <a href="http://www.google.nl/search?q=flash%20silk">Flash Silk</a> (I think only available for Android devices).</p>
<h3>Deepa Subramaniam &amp; Andrew Shorten</h3>
<p>Paul&#8217;s presentation more or less seamlessly went over into the one of Deepa &amp; Andrew talking about the new stuff in Flex 4.5 and Flash Builder 4.5 of which a tiny glimps was already given at the keynote of day one. Here we got the full story. Deepa showed the new templates based on navigation paradigms present on devices, the new versions of the Spark components retrofitted for mobile with separate skins for Android and iOS and the debugging while testing on the device trough either USB or WiFi. The SDK is also improved at several points, more Spark components replacing Halo components (datagrid, form, image, busycursor) as well as local aware formatters, improved modularization to accommodate or speed up development of big ass projects.</p>
<p>Andrew showed some of the new coding features which let it compete with FDT (which already has those features AFAIK). Al kinds of code assist among which code assist for meta tags, even for frameworks like <a href="http://www.robotlegs.org/">Robotlegs</a> (if they provide the proper XML file). There was a real short part on Catalyst, but to be honest I never used it, so the &#8220;NEW!&#8221; remarks did not make much sense to me. I understood the &#8220;better streamlined, also for use by developers&#8221;, but that was about it, sorry.</p>
<h3>Alyoka &amp; Jooony Emergence + reflection = emerection</h3>
<p>No, not the reflection in a fancy black mirror&#8230; The first part done by Alyoka who started with a introduction to the ever mesmerizing <a href="http://en.wikipedia.org/wiki/Conway's_Game_of_Life">Game of Life from John Conway</a>. Next she showed a nifty implementation of some of Wolfram&#8217;s rules applied to a combination of byteArrays and bitmapdata (does not seem to be on their blog) to demonstrate the principles behind emersion. The presentation went on to give an introduction into the technical possibilities ActionScript has to help with reflection / introspection like describeType(). Jooony took over with  something that ended in peak &amp; poke for ActionScript. Due to the lack of time and some hard to read sheets the story did not come across as it should have, but the punchline was that he read the bytes of a SWF file and found a way to more or less decompile it. With all the info gathered he was able to alter classes at runtime. Pretty impressive and true emersion but sometimes hard to follow. I wonder what will come out of his experiments.</p>
<h3>Richard Jewson &amp; Oskar Sundberg</h3>
<p>&#8220;Speech&#8221; did not really have anything to do with it as the title of the presentation suggested, it was a transcription error from email to program booklet. The presentation was about procedural content and generative art.</p>
<p>Both work at <a href="http://www.blastradius.com/">Blastradius</a>. A very brief overview of generative art was given, Islamic art with it&#8217;s complicated mathematical rulesets, <a href="https://ccrma.stanford.edu/~blackrse/algorithm.html#mozart">Mozart&#8217;s algorithmic composition</a> with dice and a deck of card to some computer facilitated generative art. Today we can use similar algorithms from long ago to do more with it aided by the computing power of modern times.</p>
<p>Then the procedural content creation of Elite and Exile (Both BBC Acorn, I&#8217;m old enough to have seen some working remains of those) was discussed. In Elite the galaxies were generated by algorithms and in Exile the game map. With the use of the proper input for an algorithm (randomseed for instance) you&#8217;ll be able to generate the same &#8216;random&#8217; map over and over so you don&#8217;t need to manually define it in the game. It may take a while though before you end up with an acceptable random map.</p>
<p>If those techniques back in the days may have been used to safe memory, nowadays with an abundance of memory, the algorithms can be used to save time (otherwise needed for manual asset creation).</p>
<p>A presentation was given of a Nivea project their company did(for the life of me I can&#8217;t find it online&#8230;). Users could create a leaf on a tree as sort of a crowdsourced artwork. The tree was created with an variation of an <a href="http://en.wikipedia.org/wiki/L-system">L-System</a> with some wind and dynamics that respond to mouse movements added to it. Added to that were very dynamic brushes inspired by the ingredients of the product.</p>
<p>Finally there were some examples on the more playful side:</p>
<ul>
<li><a href="http://www.susannestahl.com/seebeforereading.html">see before reading</a></li>
<li><a href="http://www.fastcodesign.com/1663378/mit-media-labs-brilliant-new-logo-has-40000-permutations-video">MIT medialab logo</a></li>
<li><a href="http://vimeo.com/12121825">Wurst apparatus</a></li>
</ul>
<p>The introduction of a project in the making of them selves called Binory.com topped it off. For this project they still need input in the form of people that can provide algorithms that create content that people then can order on print. There&#8217;s a buck in there for the algorithm owner. Mail:  hellobinory [ a t ] gmail  [ full stop ] com.</p>
<h3>Bartek Drozdz</h3>
<p>3D workflow for the New Era</p>
<p><a href="http://everyday3d.com">Bartek</a> talked about his history in 3D development in Flash and Unity. From his first project in Flash with Papervision to a Unity project with an 80+ inch touchscreen in a 6 company project and the changes his roll as a developer went through. His first project he did everything himself and build the skateboard model from scratch in code, later on he build his own assets in Blender and now he has to let modelers do the modeling since 3D project have become to complex to do on you own. The capabilities have increased so much over the last few years that each part of the project has too much of it&#8217;s own expertise that one person can do it alone. He had a nice overview of the work areas involved in 3D application development:</p>
<h4>Low level stuff</h4>
<p>(what most people will never touch or see) WebGL, OpenGL ES, Molehill</p>
<h4>Engines most developers work with</h4>
<p>JS engines (<a href="http://mrdoob.com/blog/post/693">Three.js</a>), <a href="http://unity3d.com/">Unity</a> (C#, js, as3), AS3 engines (<a href="http://away3d.com/">Away3D</a>)</p>
<h3>Workflow tools</h3>
<p>This is the glue between assetcreators and coders ( python, maxscript, unity editor api )</p>
<h3>The art / design tools</h3>
<p>3D editors (Maya, Blender etc), Gamelevel editors (Unity)</p>
<h3>Data input</h3>
<p>Generative art, physical input motion data etc.</p>
<p>At the moment Bartek is impressed with Unity, easy in use and coding (C# is a lot like AS3), the API is easy to learn and the coding done only has to deal with game logic.</p>
<p>The case study, done in Unity, he showed was a project that runs at a Swedish airport and is called <a href="http://www.woodbotpilots.com/">Woodbot pilots</a>. Quite an impressive project done with 6 different companies and Bartek himself. It involves a portrait positioned touchscreen with a 3D camera (no, no kinetic) above it to capture the movement of the player which is translated to the direction the bot is steered through a rocky landscape, check out the video on his website.</p>
<p>The things he learned from this whole project were (among others):</p>
<ul>
<li>Concept art is not  to be used in the final product (even if it is 3D concept art). Maybe that was why a lot of concept art is done drawing on paper (although the concept art for Woodbot pilot was beautifull)</li>
<li>Make prototypes to test concepts and the gameplay. You cannot think it all through, you must experience.</li>
<li>Talk (a lot) with 3D artists, there is so much that can go wrong and could use extra attention that the artist cannot work out on it&#8217;s own. Things to take into consideration are: polycount low where needed, higher where possible, textures &amp; shaders work different in model software and the engine of choice, structure of models (pivots, groups etc) require attention, procedural content could be easier to use, depending on useage and engine.</li>
<li>Automate the asset pipeline: use editor script wisely to, for instance, inspect models. (After having spent numerous hours inspecting models, Bartek decided to write scripts to do it for him, time investment but in the end saves time and frustration)</li>
<li>Build levels in game editor, seperate the phase of modeling from level design because then you&#8217;ll know what it looks like exactly as well as that you&#8217;llbe able to use features specific to the engine which the modeling software does not have.</li>
</ul>
<p>The conclusion however was that there is no ideal workflow across technologies / tools, just rules of thumb&#8230;</p>
<h3>Evan Roth</h3>
<p>He was last but certainly not least. You really need to look up his work (as advised, <a href="http://www.google.nl/search?sourceid=chrome&amp;ie=UTF-8&amp;q=bad+ass+mother+fucker">a google search for &#8220;bad ass motherfucker&#8221;</a> will do just fine). His story was about empowerment, open source and open data. This single sentence does not do his work any justice. And since most of it is visual, check out the website. His work can be seen as aesthetic but with substance as his lollypop infographic explained. Sometimes it can be seen as <a href="http://graffitiresearchlab.com/projects/laser-tag/">pure aesthetic</a>, sometimes a bit <a href="http://evan-roth.com/anti-seat-back.php">juvenile mischievous</a>, sometimes <a href="http://evan-roth.com/jay-z.php">pretty &#8216;pofessional&#8217;</a> and sometimes with <a href="http://www.eyewriter.org/">unexpected backgrounds</a> but always good. Something to think about on the train ride home without any more battery life left <img src='http://www.aloft.nl/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>It ware three very nice days with loads of info. Although it costs some, it is definitely worth it. Hope to be able to again go next year!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aloft.nl/2011/03/fitc-day-two/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FITC, day one</title>
		<link>http://www.aloft.nl/2011/03/fitc-day-one/</link>
		<comments>http://www.aloft.nl/2011/03/fitc-day-one/#comments</comments>
		<pubDate>Tue, 08 Mar 2011 13:40:44 +0000</pubDate>
		<dc:creator>Manno</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[fitc]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[unity]]></category>

		<guid isPermaLink="false">http://www.aloft.nl/?p=58</guid>
		<description><![CDATA[Tom Higgins (Unity) Kicked off today with Tom Higgins&#8217; Unity 3D presentation. Bit more on the marketing side than I had hoped. Would have liked to see more of the application. Good news, albeit a bit old if you followed the Flash Gaming Summit news from about a week ago is the SWF exporter from [...]]]></description>
			<content:encoded><![CDATA[<h3>Tom Higgins (Unity)</h3>
<p>Kicked off today with Tom Higgins&#8217; Unity 3D presentation. Bit more on the marketing side than I had hoped. Would have liked to see more of the application. Good news, albeit a bit old if you followed the <a href="http://www.flashgamingsummit.com/">Flash Gaming Summit</a> news from about a week ago is the <a href="http://blogs.unity3d.com/2011/02/27/unity-flash-3d-on-the-web/">SWF exporter from Unity</a>. Tom could not say much about it because Flash Player&#8217;s molehill is still subject to change. Unity however is aiming for day zero support and the exporter will probably not support as much features as Unity&#8217;s own web player. Not that I use Unity but the following items were new to me: The <a href="http://unity3d.com/unity/whats-new/unity-3.3">remote &#8216;player&#8217; for mobile devices will be available on all licences</a>, also the free licence. The remote allows you to test on on a device while working in Unity on your dev machine. There is an in-app store (with free content too) for 3d models and scripts (maybe even I can get some stuff done now). To me there also was a mystery solved: Unity exports an XCode project if you wanna publish for iOS. Probably therefore wasn&#8217;t banned like Flash was for a while.</p>
<h3>Stacy Mulcahy (bitchwhocodes)</h3>
<p>Stacy talked about the design and User Experience (UX) considerations when developing for devices. Next to the obvious of for example screen real estate there were lovely insights to be gained. <a href="http://en.wikipedia.org/wiki/Fitts's_law">Fitts&#8217; law</a> passed with the side note that there&#8217;s no containing borders on a device (the finger her being the pointer is not restricted to the screen as a mouse is), <a href="http://www.ted.com/talks/scott_mccloud_on_comics.html">Stcott McCloud</a> passed with his TED talk about comics, vision and representation of images and stories on new media. Simple tips like larger hit area&#8217;s compared to visible size, &#8216;activity touch zones of a device (near where your hands are when you hold it) but also <a href="http://en.wikipedia.org/wiki/Skeuomorph">Skeuomorphic design</a> (which appears to work pretty well), the <a href="http://en.wikipedia.org/wiki/Uncanny_valley">Uncanny valley</a> applied to UX and we got advised to read the <a href="http://developer.apple.com/library/mac/#documentation/userexperience/conceptual/applehiguidelines/XHIGHIDesign/XHIGHIDesign.html">Apple Human Interface Guidelines</a> even if it was just for the good read it is. Like many presentations there wasn&#8217;t time enough&#8230;</p>
<h3>Grant Skinner</h3>
<p>He was up next with ADHD FTW, LOL! and got the silent treatment from the audience. Grant: in the Netherlands that means about the same as cheers in the US; awestruck <img src='http://www.aloft.nl/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> . His presentation was partly flexing AS3 muscle (in a positive sense) like the Hulk could tear his shirt back in the days but good lessons were to be learned too. Take time to experiment, partly by leaving the opportunity open at all times (buy RAM, leave applications open), but also by giving yourself micro rewards (if I finish this in time I get to experiment. This needs small sprints, not week long marathons). Still it may seem like wanting to escape the daily grind, but experiment serves more purposes than escapism: It let&#8217;s you work on stuff which you probably are more passionate about than an assignment for a client. Showing off the experiments may however get you the next (assignment that is). Experiments shown were among others: <a href="http://gskinner.com/blog/archives/2010/06/air_for_android.html">Slot cars with AIR gas pedal</a>, <a href="http://gskinner.com/blog/archives/2010/06/androideroids.html">Androideroids</a>, <a href="http://gskinner.com/blog/archives/2009/11/playing_records.html">Record player</a> (which fails to load the experiment today?), experiments with light and spheres, far <a href="http://gskinner.com/?s=sphere">more evolved than these</a>. Furthermore there was a nice lineup of tools created by GS, his company and friends. <a href="http://easeljs.com/">EaslJS</a>, <a href="http://gskinner.com/blog/archives/2011/02/zoe-export-swf-animation-as-easeljs-spritesheets.html">Zoë Sprite sheet exporter</a> and some impressive exporter from Flash to JavaScript. Inspiring.</p>
<h3>Chris Black</h3>
<p><a href="http://blackcj.com/">Chris Black</a> I did not know, not that I visit these events often but I stalk a lot on whatever webcast there is. A good listen nonetheless (as if me not knowing him would mean the opposite) in the nice setting of the <a href="http://voodoo.influxis.com/chat.html">Influxis Voodoo lounge</a> with live broadcast and possibility to ask questions through their chat. You can see <a href="http://www.slideshare.net/blackcj/monetizing-mobile-apps">Chris&#8217; slides</a> on slideshare. He gave his insights on making money with mobile apps using wit and tools like ad words etc. Funny thing was that target demographics data was collected by experiment, not desk research as often taught where I teach.</p>
<h3>Keynote</h3>
<p>Quickly ran to the Adobe keynote. Some previews of the next Flash Professional, Flash Builder and Flex. More and more in the direction of mobile development. Testing on devices while retaining full debug possibilities, Flash builder has more features like quick assist which I think FDT already has, Flex has a lot of components updated for use on mobile devices, <a href="http://labs.adobe.com/technologies/flashplatformruntimes/incubator/features/molehill.html">Molehill</a> was presented (again) as was <a href="http://www.mandreel.com/">Mandreel</a>&#8216;s <a href="http://blog.theflashblog.com/?p=2593">impressive story of a port of a Wii game to the Flash player</a>.</p>
<h3>Rob Bateman</h3>
<p>He was one before last. The cocreator of <a href="http://www.away3d.com/">Away3D</a> talked about some topics Molehill and Away3D 4.0 make possible: Lighting, textures, millions of polygons and some dynamics. Illustrated by demos and videos. guess you had to be there. OK, here&#8217;s some stuff he showed: <a href="http://www.youtube.com/watch?v=FjHJ7FmV0M4">Richard Feynman about light</a>, <a href="http://www.youtube.com/watch?v=LnjSWPxJxNs">simulation in 3D worlds</a> (funny, real or not), <a href="http://www.youtube.com/watch?v=Ttd0YjXF0no">crappy human perception</a> shameless abused by computer simulations and the <a href="http://www.jiglibflash.com/blog/">JiglibFlash physics engine</a> that can be combined with Away3D and the Molehill API. Some techniques were illustrated using <a href="http://vimeo.com/user904568">videos created by The Guerrilla CG Project</a>.</p>
<h3>Tom Krcha</h3>
<p><a href="http://www.flashrealtime.com/">Tom Krcha</a>, Adobe platform evangelist talked in the packed voodoo lounge about peer to peer applications ranging from <a href="http://www.flashrealtime.com/video-on-demand-over-p2p-in-flash-player-101-with-object-replication/">video on demand</a>, <a href="http://www.flashrealtime.com/file-share-object-replication-flash-p2p/">file sharing</a> to <a href="http://nestor.cz/mill/">several</a> <a href="http://www.haxball.com/">game</a> <a href="http://www.flashrealtime.com/game-remote-device-controller/">applications</a>. P2p was something I completely missed until now. Something to think about for sure.</p>
<p>Oh my, now I need a beer in the hotel bar. Maybe something stronger with the classic napkin under it <img src='http://www.aloft.nl/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.aloft.nl/2011/03/fitc-day-one/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

