<?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>Flashguy's Blog</title>
	<atom:link href="http://flashguy.de/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://flashguy.de/blog</link>
	<description>Wicked Actionscript</description>
	<lastBuildDate>Fri, 02 Dec 2011 10:53:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>I am now Director of Technology at Deisgnit Munich</title>
		<link>http://flashguy.de/blog/?p=236</link>
		<comments>http://flashguy.de/blog/?p=236#comments</comments>
		<pubDate>Fri, 02 Dec 2011 10:52:03 +0000</pubDate>
		<dc:creator>Gabor Wraight</dc:creator>
				<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://flashguy.de/blog/?p=236</guid>
		<description><![CDATA[
11 years of freelancing come to an end. I finally made a big decision and signed my contract with Designit yesterday.
I am now the Director of Technology at the Munich office.
As I&#8217;ve been working for Designit almost a year now, I already know the whole German Team and am now looking forward to get to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://flashguy.de/blog/wp-content/uploads/2011/12/386414_10150429091638025_687073024_8463384_392039039_n1.jpg" rel="lightbox[236]"><img class="alignnone size-full wp-image-238" title="386414_10150429091638025_687073024_8463384_392039039_n" src="http://flashguy.de/blog/wp-content/uploads/2011/12/386414_10150429091638025_687073024_8463384_392039039_n1.jpg" alt="Designit" width="540" height="405" /></a></p>
<p>11 years of freelancing come to an end. I finally made a big decision and signed my contract with <a href="http://www.designit.com" target="_blank">Designit</a> yesterday.</p>
<p>I am now the Director of Technology at the Munich office.</p>
<p>As I&#8217;ve been working for <a href="http://www.designit.com/" target="_blank">Designit</a> almost a year now, I already know the whole German Team and am now looking forward to get to know all other zoo members.</p>
<p>This means no more time for freelance jobs. I already changed my linkedin and xing profile so I hope the ammount of job applications will decrease drastically.</p>
<p>I will keep this Blog and continue to keep you updated on intersting facts and code snippets.</p>
]]></content:encoded>
			<wfw:commentRss>http://flashguy.de/blog/?feed=rss2&amp;p=236</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Detect device orientation through Accelerometer Data</title>
		<link>http://flashguy.de/blog/?p=229</link>
		<comments>http://flashguy.de/blog/?p=229#comments</comments>
		<pubDate>Sun, 27 Mar 2011 17:28:23 +0000</pubDate>
		<dc:creator>Gabor Wraight</dc:creator>
				<category><![CDATA[AIR Mobile]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[iOs]]></category>

		<guid isPermaLink="false">http://flashguy.de/blog/?p=229</guid>
		<description><![CDATA[Update: Thanks to a comment from Boris calling preventDefault() on a StageOrientationEvent will give you the orientation without the stage reorientating.
In a current project, I had to set autoOrients to false to lock the screen orientation on a mobile app. Unfortunatly by doing this, StageOrientationEvent.ORIENTATION_CHANGE doesn&#8217;t work anymore. This is how you can still detect [...]]]></description>
			<content:encoded><![CDATA[<p>Update: Thanks to a comment from Boris calling preventDefault() on a StageOrientationEvent will give you the orientation without the stage reorientating.</p>
<p>In a current project, I had to set autoOrients to false to lock the screen orientation on a mobile app. Unfortunatly by doing this, StageOrientationEvent.ORIENTATION_CHANGE doesn&#8217;t work anymore. This is how you can still detect the current rotation using the accelerometer data:</p>
<div class="codecolorer-container actionscript geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">var</span> accel:Accelerometer = <span style="color: #000000; font-weight: bold;">new</span> Accelerometer<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
accel.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>AccelerometerEvent.<span style="color: #006600;">UPDATE</span>, onAccelUpdate<span style="color: #66cc66;">&#41;</span>;<br />
<br />
<span style="color: #000000; font-weight: bold;">function</span> onAccelUpdate<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:AccelerometerEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><br />
<span style="color: #66cc66;">&#123;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> myConst:<span style="color: #0066CC;">Number</span> = <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">sin</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">PI</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">4</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #006600;">accelerationX</span> <span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;">0</span> <span style="color: #66cc66;">&amp;&amp;</span> <span style="color: #0066CC;">e</span>.<span style="color: #006600;">accelerationY</span> <span style="color: #66cc66;">&gt;</span> -myConst <span style="color: #66cc66;">&amp;&amp;</span> <span style="color: #0066CC;">e</span>.<span style="color: #006600;">accelerationY</span> <span style="color: #66cc66;">&lt;</span> myConst<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;left&quot;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">e</span>.<span style="color: #006600;">accelerationY</span> <span style="color: #66cc66;">&gt;</span>= myConst<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;default&quot;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #006600;">accelerationX</span> <span style="color: #66cc66;">&lt;</span> <span style="color: #cc66cc;">0</span> <span style="color: #66cc66;">&amp;&amp;</span> <span style="color: #0066CC;">e</span>.<span style="color: #006600;">accelerationY</span> <span style="color: #66cc66;">&gt;</span> -myConst <span style="color: #66cc66;">&amp;&amp;</span> <span style="color: #0066CC;">e</span>.<span style="color: #006600;">accelerationY</span> <span style="color: #66cc66;">&lt;</span> myConst<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;right&quot;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #006600;">accelerationY</span> <span style="color: #66cc66;">&lt;</span>= myConst<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;upside down&quot;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> &nbsp; &nbsp; &nbsp; <br />
<span style="color: #66cc66;">&#125;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://flashguy.de/blog/?feed=rss2&amp;p=229</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>localisation token generator</title>
		<link>http://flashguy.de/blog/?p=175</link>
		<comments>http://flashguy.de/blog/?p=175#comments</comments>
		<pubDate>Thu, 09 Sep 2010 17:25:24 +0000</pubDate>
		<dc:creator>Gabor Wraight</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flash Catalyst]]></category>
		<category><![CDATA[Flashbuilder]]></category>

		<guid isPermaLink="false">http://flashguy.de/blog/?p=175</guid>
		<description><![CDATA[Almost every day, I come across a procedure which I find really anoying.
As a Flexdeveloper, you get your artwork delivered from a designer. Today, we have Flash Catalyst, which really imporves the workflow. I&#8217;m so happy to have it.
What I do is save a Flexproject from Catalyst, import it to Flex and start adding the [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://flashguy.de/blog/wp-content/uploads/2010/09/Flashguy-Icon-04.png" alt="" title="Flashguy-Icon-04" width="129" height="129" class="alignnone size-full wp-image-202" style="border: 0pt none;"/>Almost every day, I come across a procedure which I find really anoying.<br />
As a Flexdeveloper, you get your artwork delivered from a designer. Today, we have Flash Catalyst, which really imporves the workflow. I&#8217;m so happy to have it.</p>
<p>What I do is save a Flexproject from Catalyst, import it to Flex and start adding the logic. Great! Now what really bugged me, was localization. I had to copy the Text from each RichTextComponent to a xml file. After that, I had to add the resourceManager.getString() function where the Text previously was. In views with lots of text, this took ages.</p>
<p>So I came up with a neet little AIR App called &#8220;localisation token generator&#8221;.</p>
<p>What it does is exactly what I described above, only a lot faster. Let me explain in detail:</p>
<p>You start off with a Photoshop File like this (maybe a little more pretty):</p>
<p><img class="alignnone size-full wp-image-176" title="psd" src="http://flashguy.de/blog/wp-content/uploads/2010/09/psd.jpg" alt="" width="540" height="300" /></p>
<p>You import this file into Flash Catalyst and get this:</p>
<div class="codecolorer-container mxml geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="mxml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">'1.0'</span> encoding=<span style="color: #ff0000;">'UTF-8'</span>?<span style="color: #7400FF;">&gt;</span></span><br />
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> xmlns:d=<span style="color: #ff0000;">&quot;http://ns.adobe.com/fxg/2008/dt&quot;</span> xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span> xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span> width=<span style="color: #ff0000;">&quot;800&quot;</span> height=<span style="color: #ff0000;">&quot;600&quot;</span> backgroundColor=<span style="color: #ff0000;">&quot;#FFFFFF&quot;</span> preloaderChromeColor=<span style="color: #ff0000;">&quot;#FFFFFF&quot;</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Style</span> source=<span style="color: #ff0000;">&quot;Main.css&quot;</span><span style="color: #7400FF;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:BitmapImage</span> smooth=<span style="color: #ff0000;">&quot;true&quot;</span> source=<span style="color: #ff0000;">&quot;@Embed('/assets/images/artwork/Background.png')&quot;</span> d:userLabel=<span style="color: #ff0000;">&quot;Background&quot;</span> x=<span style="color: #ff0000;">&quot;0&quot;</span> y=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:RichText</span> color=<span style="color: #ff0000;">&quot;#fefefe&quot;</span> fontFamily=<span style="color: #ff0000;">&quot;News Gothic Std&quot;</span> fontSize=<span style="color: #ff0000;">&quot;14&quot;</span> kerning=<span style="color: #ff0000;">&quot;off&quot;</span> lineHeight=<span style="color: #ff0000;">&quot;214.3%&quot;</span> d:userLabel=<span style="color: #ff0000;">&quot;My Text Number 1&quot;</span> whiteSpaceCollapse=<span style="color: #ff0000;">&quot;preserve&quot;</span> x=<span style="color: #ff0000;">&quot;69&quot;</span> y=<span style="color: #ff0000;">&quot;67&quot;</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:content</span><span style="color: #7400FF;">&gt;</span><span style="color: #7400FF;">&lt;s:p</span><span style="color: #7400FF;">&gt;</span><span style="color: #7400FF;">&lt;s:span</span><span style="color: #7400FF;">&gt;</span></span>My Text Number 1<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:span</span><span style="color: #7400FF;">&gt;</span><span style="color: #7400FF;">&lt;/s:p</span><span style="color: #7400FF;">&gt;</span><span style="color: #7400FF;">&lt;/s:content</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:RichText</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:RichText</span> color=<span style="color: #ff0000;">&quot;#fefefe&quot;</span> fontFamily=<span style="color: #ff0000;">&quot;News Gothic Std&quot;</span> fontSize=<span style="color: #ff0000;">&quot;14&quot;</span> kerning=<span style="color: #ff0000;">&quot;off&quot;</span> lineHeight=<span style="color: #ff0000;">&quot;214.3%&quot;</span> d:userLabel=<span style="color: #ff0000;">&quot;More Text&quot;</span> whiteSpaceCollapse=<span style="color: #ff0000;">&quot;preserve&quot;</span> x=<span style="color: #ff0000;">&quot;68&quot;</span> y=<span style="color: #ff0000;">&quot;111&quot;</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:content</span><span style="color: #7400FF;">&gt;</span><span style="color: #7400FF;">&lt;s:p</span><span style="color: #7400FF;">&gt;</span><span style="color: #7400FF;">&lt;s:span</span><span style="color: #7400FF;">&gt;</span></span>More Text<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:span</span><span style="color: #7400FF;">&gt;</span><span style="color: #7400FF;">&lt;/s:p</span><span style="color: #7400FF;">&gt;</span><span style="color: #7400FF;">&lt;/s:content</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:RichText</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:RichText</span> color=<span style="color: #ff0000;">&quot;#FEFEFE&quot;</span> fontFamily=<span style="color: #ff0000;">&quot;News Gothic Std&quot;</span> fontSize=<span style="color: #ff0000;">&quot;14&quot;</span> height=<span style="color: #ff0000;">&quot;208&quot;</span> kerning=<span style="color: #ff0000;">&quot;off&quot;</span> lineHeight=<span style="color: #ff0000;">&quot;214.3%&quot;</span> d:userLabel=<span style="color: #ff0000;">&quot;Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed di&quot;</span> whiteSpaceCollapse=<span style="color: #ff0000;">&quot;preserve&quot;</span> width=<span style="color: #ff0000;">&quot;576&quot;</span> x=<span style="color: #ff0000;">&quot;70&quot;</span> y=<span style="color: #ff0000;">&quot;165&quot;</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:text</span><span style="color: #7400FF;">&gt;</span></span>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:text</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:RichText</span><span style="color: #7400FF;">&gt;</span></span><br />
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></div></div>
<p>Now you start up &#8220;localisation token generator&#8221; and first of all click on &#8220;Save required Files&#8221; to get a proper xml file for the tokens and the tokensVo.as. Save these files in the src folder of your Flex Project.<br />
<img src="http://flashguy.de/blog/wp-content/uploads/2010/09/Bildschirmfoto-2010-09-09-um-19.27.10.png" alt="" title="Bildschirmfoto 2010-09-09 um 19.27.10" style="border: 0pt none;" width="530" height="530" class="alignnone size-full wp-image-214" /></p>
<p>Now you first drag the MXML File containing your Code onto the Target MXML Drop Target<br />
Next, drag the tokens.xml file from your src Folder onto the Target XML Drop Target. After doing this, you will have the opportunity to choose your target language. Also a Token Prefix is generated from the mxml&#8217;s filename. If you don&#8217;t like it, just change it.</p>
<p>Now click on &#8220;Generate Tokens&#8221; and enjoy! Be sure to have a backup of your files, just in case.</p>
<p>What you will end up will look like this:</p>
<div class="codecolorer-container mxml geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="mxml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> width=<span style="color: #ff0000;">&quot;800&quot;</span> height=<span style="color: #ff0000;">&quot;600&quot;</span> </span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; backgroundColor=<span style="color: #ff0000;">&quot;#FFFFFF&quot;</span> preloaderChromeColor=<span style="color: #ff0000;">&quot;#FFFFFF&quot;</span> </span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xmlns:d=<span style="color: #ff0000;">&quot;http://ns.adobe.com/fxg/2008/dt&quot;</span> </span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span> </span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span><span style="color: #7400FF;">&gt;</span></span> &nbsp; &nbsp;<br />
&nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Style</span> source=<span style="color: #ff0000;">&quot;Main.css&quot;</span><span style="color: #7400FF;">/&gt;</span></span> &nbsp;<br />
&nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:BitmapImage</span> smooth=<span style="color: #ff0000;">&quot;true&quot;</span> source=<span style="color: #ff0000;">&quot;@Embed('/assets/images/artwork/Background.png')&quot;</span> d:userLabel=<span style="color: #ff0000;">&quot;Background&quot;</span> x=<span style="color: #ff0000;">&quot;0&quot;</span> y=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">/&gt;</span></span><br />
&nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:RichText</span> color=<span style="color: #ff0000;">&quot;#fefefe&quot;</span> fontFamily=<span style="color: #ff0000;">&quot;News Gothic Std&quot;</span> fontSize=<span style="color: #ff0000;">&quot;14&quot;</span> kerning=<span style="color: #ff0000;">&quot;off&quot;</span> lineHeight=<span style="color: #ff0000;">&quot;214.3%&quot;</span> d:userLabel=<span style="color: #ff0000;">&quot;My Text Number 1&quot;</span> whiteSpaceCollapse=<span style="color: #ff0000;">&quot;preserve&quot;</span> x=<span style="color: #ff0000;">&quot;69&quot;</span> y=<span style="color: #ff0000;">&quot;67&quot;</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:content</span><span style="color: #7400FF;">&gt;</span></span>{TextFlowUtil.importFromString(resourceManager.getString('tokens','Main_MyTextNumber1_1'))}<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:content</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:RichText</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:RichText</span> color=<span style="color: #ff0000;">&quot;#fefefe&quot;</span> fontFamily=<span style="color: #ff0000;">&quot;News Gothic Std&quot;</span> fontSize=<span style="color: #ff0000;">&quot;14&quot;</span> kerning=<span style="color: #ff0000;">&quot;off&quot;</span> lineHeight=<span style="color: #ff0000;">&quot;214.3%&quot;</span> d:userLabel=<span style="color: #ff0000;">&quot;More Text&quot;</span> whiteSpaceCollapse=<span style="color: #ff0000;">&quot;preserve&quot;</span> x=<span style="color: #ff0000;">&quot;68&quot;</span> y=<span style="color: #ff0000;">&quot;111&quot;</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:content</span><span style="color: #7400FF;">&gt;</span></span>{TextFlowUtil.importFromString(resourceManager.getString('tokens','Main_MoreText_2'))}<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:content</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:RichText</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:RichText</span> color=<span style="color: #ff0000;">&quot;#fefefe&quot;</span> fontFamily=<span style="color: #ff0000;">&quot;News Gothic Std&quot;</span> fontSize=<span style="color: #ff0000;">&quot;14&quot;</span> height=<span style="color: #ff0000;">&quot;208&quot;</span> kerning=<span style="color: #ff0000;">&quot;off&quot;</span> lineHeight=<span style="color: #ff0000;">&quot;214.3%&quot;</span> d:userLabel=<span style="color: #ff0000;">&quot;Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed di&quot;</span> whiteSpaceCollapse=<span style="color: #ff0000;">&quot;preserve&quot;</span> width=<span style="color: #ff0000;">&quot;576&quot;</span> x=<span style="color: #ff0000;">&quot;70&quot;</span> y=<span style="color: #ff0000;">&quot;165&quot;</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:content</span><span style="color: #7400FF;">&gt;</span></span>{TextFlowUtil.importFromString(resourceManager.getString('tokens','Main_Loremipsumdolor_3'))}<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:content</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:RichText</span><span style="color: #7400FF;">&gt;</span></span><br />
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></div></div>
<p>To get the localisation work, just add some script so your file looks like this:</p>
<div class="codecolorer-container mxml geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="mxml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> width=<span style="color: #ff0000;">&quot;800&quot;</span> height=<span style="color: #ff0000;">&quot;600&quot;</span> creationComplete=<span style="color: #ff0000;">&quot;application1_creationCompleteHandler(event)&quot;</span> </span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; backgroundColor=<span style="color: #ff0000;">&quot;#FFFFFF&quot;</span> preloaderChromeColor=<span style="color: #ff0000;">&quot;#FFFFFF&quot;</span> </span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xmlns:d=<span style="color: #ff0000;">&quot;http://ns.adobe.com/fxg/2008/dt&quot;</span> </span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span> </span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp; &nbsp; <br />
&nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Style</span> source=<span style="color: #ff0000;">&quot;Main.css&quot;</span><span style="color: #7400FF;">/&gt;</span></span><br />
&nbsp; &nbsp; <br />
&nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Script</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;import mx.events.FlexEvent;</span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;import mx.resources.ResourceBundle;</span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;import mx.resources.ResourceManager;</span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;import spark.utils.TextFlowUtil;</span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;private var locales:Array;</span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;public var TokenData:XML;</span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;protected function application1_creationCompleteHandler<span style="color: #66cc66;">&#40;</span>event:FlexEvent<span style="color: #66cc66;">&#41;</span>:void</span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#123;</span></span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var urlLoader:URLLoader = new URLLoader<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;urlLoader.addEventListener<span style="color: #66cc66;">&#40;</span>Event.COMPLETE, parseTokens<span style="color: #66cc66;">&#41;</span>;</span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;urlLoader.load<span style="color: #66cc66;">&#40;</span>new URLRequest<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'tokens.xml'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span></span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;private function parseTokens<span style="color: #66cc66;">&#40;</span>e:Event<span style="color: #66cc66;">&#41;</span>:void</span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#123;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var key:XML;</span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var tokenList:XMLList = new XML<span style="color: #66cc66;">&#40;</span> e.target.data <span style="color: #66cc66;">&#41;</span>..token;</span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var languages:XMLList = new XML<span style="color: #66cc66;">&#40;</span> e.target.data <span style="color: #66cc66;">&#41;</span>..language;</span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;locales = new Array<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; &nbsp; &nbsp;</span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// Tokens</span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for<span style="color: #66cc66;">&#40;</span>var i:int = <span style="color: #cc66cc;">0</span>; i &lt; languages.length<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; i++<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var tokenResource:ResourceBundle = new ResourceBundle<span style="color: #66cc66;">&#40;</span>languages<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>, <span style="color: #ff0000;">'tokens'</span><span style="color: #66cc66;">&#41;</span>;</span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for each<span style="color: #66cc66;">&#40;</span>key in tokenList<span style="color: #66cc66;">&#41;</span></span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#123;</span></span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;tokenResource.content<span style="color: #66cc66;">&#91;</span>key.@name<span style="color: #66cc66;">&#93;</span> = new TokenVo<span style="color: #66cc66;">&#40;</span>key.@name, key<span style="color: #66cc66;">&#91;</span>languages<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.@id<span style="color: #66cc66;">&#93;</span>, languages<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;</span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ResourceManager.getInstance<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.addResourceBundle<span style="color: #66cc66;">&#40;</span>tokenResource<span style="color: #66cc66;">&#41;</span>; &nbsp; &nbsp;</span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;locales.push<span style="color: #66cc66;">&#40;</span>languages<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span></span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ResourceManager.getInstance<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.localeChain = locales; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ResourceManager.getInstance<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.localeChain = <span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;en_UK&quot;</span><span style="color: #66cc66;">&#93;</span>; &nbsp; &nbsp;</span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span></span><br />
<br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Script</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:BitmapImage</span> smooth=<span style="color: #ff0000;">&quot;true&quot;</span> source=<span style="color: #ff0000;">&quot;@Embed('/assets/images/artwork/Background.png')&quot;</span> d:userLabel=<span style="color: #ff0000;">&quot;Background&quot;</span> x=<span style="color: #ff0000;">&quot;0&quot;</span> y=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">/&gt;</span></span><br />
&nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:RichText</span> color=<span style="color: #ff0000;">&quot;#fefefe&quot;</span> fontFamily=<span style="color: #ff0000;">&quot;News Gothic Std&quot;</span> fontSize=<span style="color: #ff0000;">&quot;14&quot;</span> kerning=<span style="color: #ff0000;">&quot;off&quot;</span> lineHeight=<span style="color: #ff0000;">&quot;214.3%&quot;</span> d:userLabel=<span style="color: #ff0000;">&quot;My Text Number 1&quot;</span> whiteSpaceCollapse=<span style="color: #ff0000;">&quot;preserve&quot;</span> x=<span style="color: #ff0000;">&quot;69&quot;</span> y=<span style="color: #ff0000;">&quot;67&quot;</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:content</span><span style="color: #7400FF;">&gt;</span></span>{TextFlowUtil.importFromString(resourceManager.getString('tokens','Main_MyTextNumber1_1'))}<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:content</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:RichText</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:RichText</span> color=<span style="color: #ff0000;">&quot;#fefefe&quot;</span> fontFamily=<span style="color: #ff0000;">&quot;News Gothic Std&quot;</span> fontSize=<span style="color: #ff0000;">&quot;14&quot;</span> kerning=<span style="color: #ff0000;">&quot;off&quot;</span> lineHeight=<span style="color: #ff0000;">&quot;214.3%&quot;</span> d:userLabel=<span style="color: #ff0000;">&quot;More Text&quot;</span> whiteSpaceCollapse=<span style="color: #ff0000;">&quot;preserve&quot;</span> x=<span style="color: #ff0000;">&quot;68&quot;</span> y=<span style="color: #ff0000;">&quot;111&quot;</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:content</span><span style="color: #7400FF;">&gt;</span></span>{TextFlowUtil.importFromString(resourceManager.getString('tokens','Main_MoreText_2'))}<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:content</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:RichText</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:RichText</span> color=<span style="color: #ff0000;">&quot;#fefefe&quot;</span> fontFamily=<span style="color: #ff0000;">&quot;News Gothic Std&quot;</span> fontSize=<span style="color: #ff0000;">&quot;14&quot;</span> height=<span style="color: #ff0000;">&quot;208&quot;</span> kerning=<span style="color: #ff0000;">&quot;off&quot;</span> lineHeight=<span style="color: #ff0000;">&quot;214.3%&quot;</span> d:userLabel=<span style="color: #ff0000;">&quot;Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed di&quot;</span> whiteSpaceCollapse=<span style="color: #ff0000;">&quot;preserve&quot;</span> width=<span style="color: #ff0000;">&quot;576&quot;</span> x=<span style="color: #ff0000;">&quot;70&quot;</span> y=<span style="color: #ff0000;">&quot;165&quot;</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:content</span><span style="color: #7400FF;">&gt;</span></span>{TextFlowUtil.importFromString(resourceManager.getString('tokens','Main_Loremipsumdolor_3'))}<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:content</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:RichText</span><span style="color: #7400FF;">&gt;</span></span><br />
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></div></div>
<p>What you have now is a fully functional localized Flex Application.</p>
<p>Hope this saves some time for you. Click on the Badge to install the Application.<br />
<div id="flashcontent2105" style="width:215px; height:180px;"><strong>Please upgrade your Flash Player</strong> This is the content that would be shown if the user does not have Flash Player 9.0.115 or higher installed.</div><script type="text/javascript">
<!-- // <![CDATA[
var so = new SWFObject("http://flashguy.de/blog/wp-content/plugins/air-badge/AIRInstallBadge.swf", "Badge", "215", "180", "9.0.115", "#FFFFFF");
so.useExpressInstall("http://flashguy.de/blog/wp-content/plugins/air-badge/expressinstall.swf");
so.addVariable("airversion", "1.0");
so.addVariable("appname", "Localization+Token+Generator");
so.addVariable("appurl", "http://www.flashguy.de/TokenGenerator/Localization-Token-Generator.air");
so.addVariable("appid", "Localization+Token+Generator");
so.addVariable("pubid", "");
so.addVariable("appversion", "0.3");
so.addVariable("imageurl", "http://flashguy.de/TokenGenerator/badge.png");
so.addVariable("appinstallarg", "installed from web");
so.addVariable("applauncharg", "launched from web");
so.addVariable("helpurl", "help.html");
so.addVariable("hidehelp", "true");
so.addVariable("skiptransition", "false");
so.addVariable("titlecolor", "#00AAFF");
so.addVariable("buttonlabelcolor", "#00AAFF");
so.addVariable("appnamecolor", "#00AAFF");
so.addVariable("str_err_airswf", "<u>Running locally?</u><br/><br/>The AIR proxy swf won't load properly when this is run from the local file system.");
so.write("flashcontent2105");
// ]]&gt; -->
</script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://flashguy.de/blog/?feed=rss2&amp;p=175</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Custom Timer Class with pause functionality</title>
		<link>http://flashguy.de/blog/?p=168</link>
		<comments>http://flashguy.de/blog/?p=168#comments</comments>
		<pubDate>Wed, 18 Aug 2010 14:41:43 +0000</pubDate>
		<dc:creator>Gabor Wraight</dc:creator>
				<category><![CDATA[Actionscript 3.0]]></category>

		<guid isPermaLink="false">http://flashguy.de/blog/?p=168</guid>
		<description><![CDATA[In my current Project I came across an issue that bugged me for a while.
The thing is, I&#8217;m building a game where a timer is used to jump to the next level(e.g. every 30 seconds the level goes one up). Unfortunatly, the game has a pause mode if you press &#8220;p&#8221; on the keyboard. I [...]]]></description>
			<content:encoded><![CDATA[<p>In my current Project I came across an issue that bugged me for a while.</p>
<p>The thing is, I&#8217;m building a game where a timer is used to jump to the next level(e.g. every 30 seconds the level goes one up). Unfortunatly, the game has a pause mode if you press &#8220;p&#8221; on the keyboard. I needed to pause and not stop the leveltimer, to be able to continue with the time left in the current cycle. Otherwise you could easily cheat by pausing the game just before you get to the next level. If you would start the normal timer again, you would again have 30 seconds untill the next level.</p>
<p>So here&#8217;s what I came up with:</p>
<div class="codecolorer-container actionscript geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">package de.<span style="color: #006600;">rockbox</span>.<span style="color: #006600;">utils</span><br />
<span style="color: #66cc66;">&#123;</span><br />
<br />
<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">TimerEvent</span>;<br />
<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">utils</span>.<span style="color: #006600;">Timer</span>;<br />
<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">utils</span>.<span style="color: #0066CC;">getTimer</span>;<br />
<br />
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> RBTimer <span style="color: #0066CC;">extends</span> Timer<br />
<span style="color: #66cc66;">&#123;</span><br />
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> initDelay:<span style="color: #0066CC;">Number</span>;<br />
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> startTime:<span style="color: #0066CC;">int</span>;<br />
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> timeLeftCurrentCicle:<span style="color: #0066CC;">int</span>;<br />
<br />
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> RBTimer<span style="color: #66cc66;">&#40;</span>delay:<span style="color: #0066CC;">Number</span>, repeatCount:<span style="color: #0066CC;">int</span>=<span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><br />
<span style="color: #66cc66;">&#123;</span><br />
<span style="color: #0066CC;">super</span><span style="color: #66cc66;">&#40;</span>delay, repeatCount<span style="color: #66cc66;">&#41;</span>;<br />
<br />
<span style="color: #808080; font-style: italic;">// save the initial delay for later use</span><br />
initDelay = delay;<br />
<br />
<span style="color: #808080; font-style: italic;">// save start time to calculate leftover time when paused</span><br />
startTime = <span style="color: #0066CC;">getTimer</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
<br />
<span style="color: #808080; font-style: italic;">// listener to reset the delay to its initial value</span><br />
addEventListener<span style="color: #66cc66;">&#40;</span>TimerEvent.<span style="color: #006600;">TIMER</span>,onTimer<span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #66cc66;">&#125;</span><br />
<br />
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> onTimer<span style="color: #66cc66;">&#40;</span>event:TimerEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><br />
<span style="color: #66cc66;">&#123;</span><br />
<span style="color: #808080; font-style: italic;">// reset the delay to ist initial value</span><br />
delay = initDelay;<br />
<br />
<span style="color: #808080; font-style: italic;">// reset &amp;amp; save start time to calculate leftover time when paused</span><br />
startTime = <span style="color: #0066CC;">getTimer</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #66cc66;">&#125;</span><br />
<br />
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> togglePause<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><br />
<span style="color: #66cc66;">&#123;</span><br />
<span style="color: #808080; font-style: italic;">// toggle pause</span><br />
<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>running<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><br />
<span style="color: #808080; font-style: italic;">// get the current time</span><br />
<span style="color: #000000; font-weight: bold;">var</span> timeNow:<span style="color: #0066CC;">int</span> = <span style="color: #0066CC;">getTimer</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
<br />
<span style="color: #808080; font-style: italic;">// calculate the elapsed time since the timer was started</span><br />
<span style="color: #000000; font-weight: bold;">var</span> elapsed:<span style="color: #0066CC;">int</span> = timeNow - startTime;<br />
<br />
<span style="color: #808080; font-style: italic;">// calculate the time left in the current ccle</span><br />
timeLeftCurrentCicle = delay - elapsed;<br />
<br />
<span style="color: #808080; font-style: italic;">// stop the timer</span><br />
<span style="color: #0066CC;">stop</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
<br />
<span style="color: #808080; font-style: italic;">// set delay to the time left in the current cycle</span><br />
delay = timeLeftCurrentCicle;<br />
<span style="color: #66cc66;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #66cc66;">&#123;</span><br />
<span style="color: #808080; font-style: italic;">// reset &amp;amp; save start time to calculate leftover time when paused</span><br />
startTime = <span style="color: #0066CC;">getTimer</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
<br />
<span style="color: #808080; font-style: italic;">// start the timer with the new delay</span><br />
<span style="color: #808080; font-style: italic;">// as soon as TimerEvent.Timer is dispatched,</span><br />
<span style="color: #808080; font-style: italic;">// the delay is reset to its initial value.</span><br />
<span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #66cc66;">&#125;</span><br />
<span style="color: #66cc66;">&#125;</span><br />
<span style="color: #66cc66;">&#125;</span><br />
<span style="color: #66cc66;">&#125;</span></div></div>
<p>Use this class just like the standard timer class:</p>
<div class="codecolorer-container mxml geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="mxml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">var timer:RBTimer = new RBTimer(1000);<br />
timer.start();<br />
<br />
// to toggle pause<br />
timer.togglePause();</div></div>
]]></content:encoded>
			<wfw:commentRss>http://flashguy.de/blog/?feed=rss2&amp;p=168</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Web2Print Job</title>
		<link>http://flashguy.de/blog/?p=147</link>
		<comments>http://flashguy.de/blog/?p=147#comments</comments>
		<pubDate>Thu, 12 Aug 2010 18:18:39 +0000</pubDate>
		<dc:creator>Gabor Wraight</dc:creator>
				<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Flashbuilder]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://flashguy.de/blog/?p=147</guid>
		<description><![CDATA[Designskins.com

Designskins.com is a website which lets you choose from a large list of devices such as your mobile phone. You can then customize a skin for your device using images from the gallery or even upload custom images. Add text and some icons and send your skin to the cart. The server then generates a [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Designskins.com</strong></p>
<p><a href="http://flashguy.de/blog/wp-content/uploads/2010/08/skindesigner.png" rel="lightbox[147]"><img class="alignnone size-full wp-image-155" style="border: 0pt none;" title="skindesigner" src="http://flashguy.de/blog/wp-content/uploads/2010/08/skindesigner.png" alt="" width="540" height="487" /></a></p>
<p><a href="http://www.designskins.com" target="_blank">Designskins.com</a> is a website which lets you choose from a large list of devices such as your mobile phone. You can then customize a skin for your device using images from the gallery or even upload custom images. Add text and some icons and send your skin to the cart. The server then generates a pre-press concidering all the elements on your skin. The guys from designskins then print your skin on their very own foil. As soon as you get your skin via post, you just stick it onto your device and show off in front of your friends.</p>
<p>The Project is built entirely in Flashbuider(Flex) using only state of the art techniques. Feel free to check it out and play with them.</p>
]]></content:encoded>
			<wfw:commentRss>http://flashguy.de/blog/?feed=rss2&amp;p=147</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>New Office</title>
		<link>http://flashguy.de/blog/?p=134</link>
		<comments>http://flashguy.de/blog/?p=134#comments</comments>
		<pubDate>Wed, 07 Jul 2010 09:49:30 +0000</pubDate>
		<dc:creator>Gabor Wraight</dc:creator>
				<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://flashguy.de/blog/?p=134</guid>
		<description><![CDATA[
Last Thursday we moved into our fabulous new office.
You can now find me at:
Deisenhofener Stra&#223;e 1
D-81539 M&#252;nchen
co Hello AG
+49 178 2441939
+49 89 244163391
Looking forward to seeing you&#8230;
]]></description>
			<content:encoded><![CDATA[<p><a href="http://flashguy.de/blog/wp-content/uploads/2010/07/01.jpg" rel="lightbox[134]"><img class="size-medium wp-image-135 alignnone" title="01" src="http://flashguy.de/blog/wp-content/uploads/2010/07/01-300x212.jpg" alt="" width="300" height="212" /></a></p>
<p>Last Thursday we moved into our fabulous new office.</p>
<p>You can now find me at:</p>
<p>Deisenhofener Stra&#223;e 1<br />
D-81539 M&#252;nchen<br />
co Hello AG</p>
<p>+49 178 2441939<br />
+49 89 244163391</p>
<p>Looking forward to seeing you&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://flashguy.de/blog/?feed=rss2&amp;p=134</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Flashbuilder &#8211; setting Text in the Richtext Component</title>
		<link>http://flashguy.de/blog/?p=123</link>
		<comments>http://flashguy.de/blog/?p=123#comments</comments>
		<pubDate>Tue, 16 Mar 2010 14:02:37 +0000</pubDate>
		<dc:creator>Gabor Wraight</dc:creator>
				<category><![CDATA[Flashbuilder]]></category>

		<guid isPermaLink="false">http://flashguy.de/blog/?p=123</guid>
		<description><![CDATA[Just to file this for myself. Peter deHaan wrote this great Post on the many different ways of setting text in a spark RichText Component.
Check it out here.
My favourite is getting HTML Markup from a String into the RichText Component. Perfect for localisation.
&#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62;
&#60;!-- http://blog.flexexamples.com/2009/08/11/setting-text-in-a-spark-richtext-control-in-flex-4/ --&#62;
&#60;s:Application name=&#34;Spark_RichText_text_test&#34;
 &#160; &#160; &#160; &#160;xmlns:fx=&#34;http://ns.adobe.com/mxml/2009&#34;
 &#160; &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>Just to file this for myself. <a href="http://blogs.adobe.com/pdehaan/" target="_blank">Peter deHaan</a> wrote this great Post on the many different ways of setting text in a spark RichText Component.<br />
Check it out <a href="http://blog.flexexamples.com/2009/08/11/setting-text-in-a-spark-richtext-control-in-flex-4/#more-1551" target="_blank">here</a>.</p>
<p>My favourite is getting HTML Markup from a String into the RichText Component. Perfect for localisation.</p>
<div class="codecolorer-container mxml geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="mxml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span><br />
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/08/11/setting-text-in-a-spark-richtext-control-in-flex-4/ --&gt;</span></span><br />
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Spark_RichText_text_test&quot;</span></span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp;xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp;xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp;xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/halo&quot;</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp;<br />
&nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Script</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;import spark.utils.TextFlowUtil;</span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Script</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp;<br />
&nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Declarations</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:String</span> id=<span style="color: #ff0000;">&quot;htmlTextAsMarkup&quot;</span><span style="color: #7400FF;">&gt;</span>&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span>&lt;p<span style="color: #7400FF;">&gt;</span></span>The quick brown <span style="color: #000000;">&lt;span fontWeight=<span style="color: #ff0000;">&quot;bold&quot;</span><span style="color: #7400FF;">&gt;</span></span>fox jumps over<span style="color: #000000;">&lt;/span<span style="color: #7400FF;">&gt;</span></span> the lazy dogg.<span style="color: #000000;">&lt;/p<span style="color: #7400FF;">&gt;</span></span>]]&gt;<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:String</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Declarations</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp;<br />
&nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:RichText</span> id=<span style="color: #ff0000;">&quot;richTxt&quot;</span></span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;textFlow=<span style="color: #ff0000;">&quot;{TextFlowUtil.importFromString(htmlTextAsMarkup)}&quot;</span></span><br />
<span style="color: #000000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #7400FF;">/&gt;</span></span><br />
&nbsp;<br />
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></div></div>
<p>By the way, you should definitely bookmark his <a href="http://blog.flexexamples.com/" target="_blank">Blog</a>. It&#8217;s my best resource on Flashbuilder and Flex Examples.</p>
]]></content:encoded>
			<wfw:commentRss>http://flashguy.de/blog/?feed=rss2&amp;p=123</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting a &#8220;Shake&#8221; Event on the iPhone with Flash CS5</title>
		<link>http://flashguy.de/blog/?p=116</link>
		<comments>http://flashguy.de/blog/?p=116#comments</comments>
		<pubDate>Mon, 08 Feb 2010 09:48:08 +0000</pubDate>
		<dc:creator>Gabor Wraight</dc:creator>
				<category><![CDATA[Flash CS5]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[Accelerometer]]></category>
		<category><![CDATA[shake]]></category>

		<guid isPermaLink="false">http://flashguy.de/blog/?p=116</guid>
		<description><![CDATA[If you need to find out if a User shakes his iPhone the following might help:
var accel:Accelerometer = new Accelerometer&#40;&#41;;
accel.addEventListener&#40;AccelerometerEvent.UPDATE, onAccelUpdate&#41;;

var lastAccelX:Number;
var lastAccelY:Number;
var lastAccelZ:Number;

var shaked:Boolean;
var shakeTreshhold: Number = 1.5

function onAccelUpdate&#40;e:AccelerometerEvent&#41;:void
&#123;
&#160; &#160; if &#40;&#40;e.accelerationX - lastAccelX &#62; shakeTreshhold&#41;&#124;&#124;&#40;e.accelerationY - lastAccelY &#62; shakeTreshhold&#41;&#124;&#124;&#40;e.accelerationZ - lastAccelZ &#62; shakeTreshhold&#41;&#41;
&#160; &#160; &#123;
&#160; &#160; &#160; &#160; if&#40;shaked&#41;
&#160; &#160; &#160; &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>If you need to find out if a User shakes his iPhone the following might help:</p>
<div class="codecolorer-container actionscript geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">var</span> accel:Accelerometer = <span style="color: #000000; font-weight: bold;">new</span> Accelerometer<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
accel.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>AccelerometerEvent.<span style="color: #006600;">UPDATE</span>, onAccelUpdate<span style="color: #66cc66;">&#41;</span>;<br />
<br />
<span style="color: #000000; font-weight: bold;">var</span> lastAccelX:<span style="color: #0066CC;">Number</span>;<br />
<span style="color: #000000; font-weight: bold;">var</span> lastAccelY:<span style="color: #0066CC;">Number</span>;<br />
<span style="color: #000000; font-weight: bold;">var</span> lastAccelZ:<span style="color: #0066CC;">Number</span>;<br />
<br />
<span style="color: #000000; font-weight: bold;">var</span> shaked:<span style="color: #0066CC;">Boolean</span>;<br />
<span style="color: #000000; font-weight: bold;">var</span> shakeTreshhold: <span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">1.5</span><br />
<br />
<span style="color: #000000; font-weight: bold;">function</span> onAccelUpdate<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:AccelerometerEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><br />
<span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #006600;">accelerationX</span> - lastAccelX <span style="color: #66cc66;">&gt;</span> shakeTreshhold<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">||</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #006600;">accelerationY</span> - lastAccelY <span style="color: #66cc66;">&gt;</span> shakeTreshhold<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">||</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #006600;">accelerationZ</span> - lastAccelZ <span style="color: #66cc66;">&gt;</span> shakeTreshhold<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>shaked<span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; shaked = <span style="color: #000000; font-weight: bold;">true</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// do your shake action here!!!</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> t:Timer = <span style="color: #000000; font-weight: bold;">new</span> Timer<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">800</span>, <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; t.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>TimerEvent.<span style="color: #006600;">TIMER</span>, <span style="color: #000000; font-weight: bold;">function</span> onTimer<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shaked = <span style="color: #000000; font-weight: bold;">false</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; t.<span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; lastAccelX = <span style="color: #0066CC;">e</span>.<span style="color: #006600;">accelerationX</span>;<br />
&nbsp; &nbsp; lastAccelY = <span style="color: #0066CC;">e</span>.<span style="color: #006600;">accelerationY</span>;<br />
&nbsp; &nbsp; lastAccelZ = <span style="color: #0066CC;">e</span>.<span style="color: #006600;">accelerationZ</span>;<br />
<span style="color: #66cc66;">&#125;</span></div></div>
<p>What I do here is listen for accelerometer update Events and compare the values from the last with the current Event. If the delta is higher than the defined treshold value, the phone is shaken. To avoid to many shakes after another I set a timer. I&#8217;m not sure, if this is the best practice for doing this, but it works out well in my App.</p>
]]></content:encoded>
			<wfw:commentRss>http://flashguy.de/blog/?feed=rss2&amp;p=116</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Determining the direction of a Gesture in Flash CS5 on the iPhone</title>
		<link>http://flashguy.de/blog/?p=110</link>
		<comments>http://flashguy.de/blog/?p=110#comments</comments>
		<pubDate>Fri, 05 Feb 2010 10:13:57 +0000</pubDate>
		<dc:creator>Gabor Wraight</dc:creator>
				<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Flash CS5]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[Gesture]]></category>
		<category><![CDATA[TouchEvent]]></category>

		<guid isPermaLink="false">http://flashguy.de/blog/?p=110</guid>
		<description><![CDATA[If you need to find out in what direction a gesture goes, e.g. Up, Down, Left or Right the following Script might help.
this.addEventListener&#40;TouchEvent.TOUCH_BEGIN, onTouchBegin&#41;
this.addEventListener&#40;TouchEvent.TOUCH_END, onTouchEnd&#41;

var startPoint:Point;
var endPoint:Point;

function onTouchBegin&#40;e:TouchEvent&#41;:void
&#123;
&#160; &#160; startPoint = new Point&#40;e.localX, e.localY&#41;;
&#125;
function onTouchEnd&#40;e:TouchEvent&#41;:void
&#123;
&#160; &#160; endPoint = new Point&#40;e.localX, e.localY&#41;;
&#160; &#160; var a:Number = endPoint.y - startPoint.y;
&#160; &#160; var b:Number = endPoint.x - startPoint.x;
&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>If you need to find out in what direction a gesture goes, e.g. Up, Down, Left or Right the following Script might help.</p>
<div class="codecolorer-container actionscript geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0066CC;">this</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>TouchEvent.<span style="color: #006600;">TOUCH_BEGIN</span>, onTouchBegin<span style="color: #66cc66;">&#41;</span><br />
<span style="color: #0066CC;">this</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>TouchEvent.<span style="color: #006600;">TOUCH_END</span>, onTouchEnd<span style="color: #66cc66;">&#41;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">var</span> startPoint:Point;<br />
<span style="color: #000000; font-weight: bold;">var</span> endPoint:Point;<br />
<br />
<span style="color: #000000; font-weight: bold;">function</span> onTouchBegin<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:TouchEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><br />
<span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; startPoint = <span style="color: #000000; font-weight: bold;">new</span> Point<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #006600;">localX</span>, <span style="color: #0066CC;">e</span>.<span style="color: #006600;">localY</span><span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #66cc66;">&#125;</span><br />
<span style="color: #000000; font-weight: bold;">function</span> onTouchEnd<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:TouchEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><br />
<span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; endPoint = <span style="color: #000000; font-weight: bold;">new</span> Point<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #006600;">localX</span>, <span style="color: #0066CC;">e</span>.<span style="color: #006600;">localY</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> a:<span style="color: #0066CC;">Number</span> = endPoint.<span style="color: #006600;">y</span> - startPoint.<span style="color: #006600;">y</span>;<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> b:<span style="color: #0066CC;">Number</span> = endPoint.<span style="color: #006600;">x</span> - startPoint.<span style="color: #006600;">x</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>a<span style="color: #66cc66;">*</span>a <span style="color: #66cc66;">&gt;</span> b<span style="color: #66cc66;">*</span>b<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>a <span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//down</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//up</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>b <span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//right</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//left</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
<span style="color: #66cc66;">&#125;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://flashguy.de/blog/?feed=rss2&amp;p=110</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding a hyperlink to a Flashbuilder RichText Component</title>
		<link>http://flashguy.de/blog/?p=107</link>
		<comments>http://flashguy.de/blog/?p=107#comments</comments>
		<pubDate>Sat, 23 Jan 2010 15:56:52 +0000</pubDate>
		<dc:creator>Gabor Wraight</dc:creator>
				<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Flashbuilder]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Link]]></category>
		<category><![CDATA[RicheditableText]]></category>
		<category><![CDATA[RichText]]></category>

		<guid isPermaLink="false">http://flashguy.de/blog/?p=107</guid>
		<description><![CDATA[First of all be aware to use RichEditableText instead of the RichText. Unfortunatly I couldn&#8217;t get links to work in the RichText Component. Also set editable=&#8221;false&#8221; focusEnabled=&#8221;false&#8221; in the RichEditableText Component to make it clickable
&#60;s:RichEditableText editable=&#34;false&#34; focusEnabled=&#34;false&#34; &#62;
&#160; &#160; &#60;s:content&#62;&#60;s:p&#62;&#60;s:span&#62;some Text&#60;/s:span&#62;&#60;s:a href=&#34;http://www.flashguy.de&#34;&#62;the link&#60;/s:a&#62;&#60;s:span&#62;more Text&#60;/s:span&#62;&#60;/s:p&#62;&#60;/s:content&#62;
&#60;/s:RichEditableText&#62;
]]></description>
			<content:encoded><![CDATA[<p>First of all be aware to use RichEditableText instead of the RichText. Unfortunatly I couldn&#8217;t get links to work in the RichText Component. Also set editable=&#8221;false&#8221; focusEnabled=&#8221;false&#8221; in the RichEditableText Component to make it clickable</p>
<div class="codecolorer-container actionscript geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">&lt;</span>s:RichEditableText editable=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #0066CC;">focusEnabled</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>s:content<span style="color: #66cc66;">&gt;&lt;</span>s:p<span style="color: #66cc66;">&gt;&lt;</span>s:span<span style="color: #66cc66;">&gt;</span>some Text<span style="color: #66cc66;">&lt;/</span>s:span<span style="color: #66cc66;">&gt;&lt;</span>s:a href=<span style="color: #ff0000;">&quot;http://www.flashguy.de&quot;</span><span style="color: #66cc66;">&gt;</span>the link<span style="color: #66cc66;">&lt;/</span>s:a<span style="color: #66cc66;">&gt;&lt;</span>s:span<span style="color: #66cc66;">&gt;</span>more Text<span style="color: #66cc66;">&lt;/</span>s:span<span style="color: #66cc66;">&gt;&lt;/</span>s:p<span style="color: #66cc66;">&gt;&lt;/</span>s:content<span style="color: #66cc66;">&gt;</span><br />
<span style="color: #66cc66;">&lt;/</span>s:RichEditableText<span style="color: #66cc66;">&gt;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://flashguy.de/blog/?feed=rss2&amp;p=107</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

