<?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>Wed, 18 Aug 2010 14:42:05 +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>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'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 "p" 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'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 "p" 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's what I came up with:</p>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-3">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">package de.<span style="color: #006600;">rockbox</span>.<span style="color: #006600;">utils</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">TimerEvent</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">utils</span>.<span style="color: #006600;">Timer</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">utils</span>.<span style="color: #0066CC;">getTimer</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> RBTimer <span style="color: #0066CC;">extends</span> Timer</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> initDelay:<span style="color: #0066CC;">Number</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> startTime:<span style="color: #0066CC;">int</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> timeLeftCurrentCicle:<span style="color: #0066CC;">int</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><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;color:#800000;">0</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">super</span><span style="color: #66cc66;">&#40;</span>delay, repeatCount<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// save the initial delay for later use</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">initDelay = delay;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// save start time to calculate leftover time when paused</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">startTime = <span style="color: #0066CC;">getTimer</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// listener to reset the delay to its initial value</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">addEventListener<span style="color: #66cc66;">&#40;</span>TimerEvent.<span style="color: #006600;">TIMER</span>,onTimer<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><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></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// reset the delay to ist initial value</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">delay = initDelay;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// reset &amp;amp; save start time to calculate leftover time when paused</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">startTime = <span style="color: #0066CC;">getTimer</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><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></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// toggle pause</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><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></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// get the current time</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><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>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// calculate the elapsed time since the timer was started</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> elapsed:<span style="color: #0066CC;">int</span> = timeNow - startTime;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// calculate the time left in the current ccle</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">timeLeftCurrentCicle = delay - elapsed;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// stop the timer</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">stop</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// set delay to the time left in the current cycle</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">delay = timeLeftCurrentCicle;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// reset &amp;amp; save start time to calculate leftover time when paused</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">startTime = <span style="color: #0066CC;">getTimer</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// start the timer with the new delay</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// as soon as TimerEvent.Timer is dispatched,</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// the delay is reset to its initial value.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Use this class just like the standard timer class:</p>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-4">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> timer:RBTimer = <span style="color: #000000; font-weight: bold;">new</span> RBTimer<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">1000</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">timer.<span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// to toggle pause</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">timer.<span style="color: #006600;">togglePause</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></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>0</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...
]]></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...</p>
]]></content:encoded>
			<wfw:commentRss>http://flashguy.de/blog/?feed=rss2&amp;p=134</wfw:commentRss>
		<slash:comments>0</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.
Actionscript:




&#60;?xml version="1.0" encoding="utf-8"?&#62;


&#60;!-- http://blog.flexexamples.com/2009/08/11/setting-text-in-a-spark-richtext-control-in-flex-4/ --&#62;


&#60;s:Application name="Spark_RichText_text_test"


&#160; &#160; &#160; &#160; xmlns:fx="http://ns.adobe.com/mxml/2009"


&#160; &#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="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-6">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">"1.0"</span> encoding=<span style="color: #ff0000;">"utf-8"</span>?&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;!-- http:<span style="color: #808080; font-style: italic;">//blog.flexexamples.com/2009/08/11/setting-text-in-a-spark-richtext-control-in-flex-4/ --&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;s:Application <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">"Spark_RichText_text_test"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; xmlns:fx=<span style="color: #ff0000;">"http://ns.adobe.com/mxml/2009"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; xmlns:s=<span style="color: #ff0000;">"library://ns.adobe.com/flex/spark"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; xmlns:mx=<span style="color: #ff0000;">"library://ns.adobe.com/flex/halo"</span>&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;fx:Script&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">import</span> spark.<span style="color: #006600;">utils</span>.<span style="color: #006600;">TextFlowUtil</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span>&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;/fx:Script&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;fx:Declarations&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;fx:<span style="color: #0066CC;">String</span> id=<span style="color: #ff0000;">"htmlTextAsMarkup"</span>&gt;&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span>&lt;p&gt;The quick brown &lt;span fontWeight=<span style="color: #ff0000;">"bold"</span>&gt;fox jumps over&lt;/span&gt; the lazy dogg.&lt;/p&gt;<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span>&gt;&lt;/fx:String&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;/fx:Declarations&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;s:RichText id=<span style="color: #ff0000;">"richTxt"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; textFlow=<span style="color: #ff0000;">"{TextFlowUtil.importFromString(htmlTextAsMarkup)}"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; horizontalCenter=<span style="color: #ff0000;">"0"</span> verticalCenter=<span style="color: #ff0000;">"0"</span> /&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/s:Application&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>By the way, you should definitely bookmark his <a href="http://blog.flexexamples.com/" target="_blank">Blog</a>. It'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:
Actionscript:




var accel:Accelerometer = new Accelerometer&#40;&#41;;


accel.addEventListener&#40;AccelerometerEvent.UPDATE, onAccelUpdate&#41;;


&#160;


var lastAccelX:Number;


var lastAccelY:Number;


var lastAccelZ:Number;


&#160;


var shaked:Boolean;


var shakeTreshhold: Number = 1.5


&#160;


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; &#160; return;


&#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="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-8">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><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>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">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>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> lastAccelX:<span style="color: #0066CC;">Number</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> lastAccelY:<span style="color: #0066CC;">Number</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> lastAccelZ:<span style="color: #0066CC;">Number</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> shaked:<span style="color: #0066CC;">Boolean</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> shakeTreshhold: <span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;color:#800000;">1</span>.<span style="color: #cc66cc;color:#800000;">5</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><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></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&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&gt; shakeTreshhold<span style="color: #66cc66;">&#41;</span>||<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #006600;">accelerationY</span> - lastAccelY&gt; shakeTreshhold<span style="color: #66cc66;">&#41;</span>||<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #006600;">accelerationZ</span> - lastAccelZ&gt; shakeTreshhold<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>shaked<span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; shaked = <span style="color: #000000; font-weight: bold;">true</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// do your shake action here!!!</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&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;color:#800000;">800</span>, <span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&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></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shaked = <span style="color: #000000; font-weight: bold;">false</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; t.<span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; lastAccelX = <span style="color: #0066CC;">e</span>.<span style="color: #006600;">accelerationX</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; lastAccelY = <span style="color: #0066CC;">e</span>.<span style="color: #006600;">accelerationY</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; lastAccelZ = <span style="color: #0066CC;">e</span>.<span style="color: #006600;">accelerationZ</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<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'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>0</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.
Actionscript:




this.addEventListener&#40;TouchEvent.TOUCH_BEGIN, onTouchBegin&#41;


this.addEventListener&#40;TouchEvent.TOUCH_END, onTouchEnd&#41;


&#160;


var startPoint:Point;


var endPoint:Point;


&#160;


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="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-10">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><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></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><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></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> startPoint:Point;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> endPoint:Point;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><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></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&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>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><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></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&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>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&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>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&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>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>a*a&gt; b*b<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>a&gt; <span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//down</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//up</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>b&gt; <span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//right</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//left</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></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't get links to work in the RichText Component. Also set editable="false" focusEnabled="false" in the RichEditableText Component to make it clickable
Actionscript:




&#60;s:RichEditableText editable="false" focusEnabled="false"&#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="http://www.flashguy.de"&#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't get links to work in the RichText Component. Also set editable="false" focusEnabled="false" in the RichEditableText Component to make it clickable</p>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-12">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;s:RichEditableText editable=<span style="color: #ff0000;">"false"</span> <span style="color: #0066CC;">focusEnabled</span>=<span style="color: #ff0000;">"false"</span>&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;s:content&gt;&lt;s:p&gt;&lt;s:span&gt;some Text&lt;/s:span&gt;&lt;s:a href=<span style="color: #ff0000;">"http://www.flashguy.de"</span>&gt;the link&lt;/s:a&gt;&lt;s:span&gt;more Text&lt;/s:span&gt;&lt;/s:p&gt;&lt;/s:content&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/s:RichEditableText&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://flashguy.de/blog/?feed=rss2&amp;p=107</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Job online &#8211; www.muellermilch.de</title>
		<link>http://flashguy.de/blog/?p=102</link>
		<comments>http://flashguy.de/blog/?p=102#comments</comments>
		<pubDate>Wed, 16 Dec 2009 16:03:38 +0000</pubDate>
		<dc:creator>Gabor Wraight</dc:creator>
				<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://flashguy.de/blog/?p=102</guid>
		<description><![CDATA[
Together with BergerBaaderHermes I've created the Flash Components for the new M&#252;llermilch Website.
The Site uses a lot of video and cool ajax animations. All in all I mus say it's a great example of the combination of Flash and dynamic HTML.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.muellermilch.de" target="_blank"><img class="size-full wp-image-103" title="muellermilch" src="http://flashguy.de/blog/wp-content/uploads/2009/06/muellermilch.jpg" border="0" alt="Muellermilch.de" width="540" height="336" /></a></p>
<p>Together with BergerBaaderHermes I've created the Flash Components for the new M&#252;llermilch Website.<br />
The Site uses a lot of video and cool ajax animations. All in all I mus say it's a great example of the combination of Flash and dynamic HTML.</p>
]]></content:encoded>
			<wfw:commentRss>http://flashguy.de/blog/?feed=rss2&amp;p=102</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Transparent Air application with Flashbuilder</title>
		<link>http://flashguy.de/blog/?p=99</link>
		<comments>http://flashguy.de/blog/?p=99#comments</comments>
		<pubDate>Sun, 28 Jun 2009 13:47:48 +0000</pubDate>
		<dc:creator>Gabor Wraight</dc:creator>
				<category><![CDATA[Flashbuilder]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[transparent]]></category>

		<guid isPermaLink="false">http://flashguy.de/blog/?p=99</guid>
		<description><![CDATA[Just a quick one that annoyed me a bit. After my Vacation I came back and was so happy that the Flashbuilder beta was released. It was really necessary coz I wasn't happy working with Flexbuilder 3 after seeing the Gumbo preview at Max.
So, I started a new AIR Project in Flashbuilder and got stuck [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick one that annoyed me a bit. After my Vacation I came back and was so happy that the Flashbuilder beta was released. It was really necessary coz I wasn't happy working with Flexbuilder 3 after seeing the Gumbo preview at Max.</p>
<p>So, I started a new AIR Project in Flashbuilder and got stuck imediatly. I wanted a transparent application and this was really easy in Flexbuilder 3.As we now have the Spark framework things have changed a bit. To get an application with no crome and transparency you have to do the following:</p>
<ul>
<li>Set system Chrome to none in the application descriptor file</li>
<li>Set transparent to true in the application descriptor file</li>
<li>Copy the file ApplicationSkin.mxml from the flex4 library to your project in a folder skins and name it ApplicationAlphaSkin.mxml</li>
<li>add the state: &lt;s:State name="normalInactive" /&gt; as first state in ApplicationAlphaSkin.mxml</li>
<li>set alpa="0" on the solidcolor of the backgroundRect</li>
<li>set the new skin in you application tag: skinClass="skins.ApplicationAlphaSkin"</li>
</ul>
<p>Hope this helps someone.</p>
]]></content:encoded>
			<wfw:commentRss>http://flashguy.de/blog/?feed=rss2&amp;p=99</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Long Time no Blogging</title>
		<link>http://flashguy.de/blog/?p=97</link>
		<comments>http://flashguy.de/blog/?p=97#comments</comments>
		<pubDate>Sun, 28 Jun 2009 13:35:39 +0000</pubDate>
		<dc:creator>Gabor Wraight</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Jobs]]></category>
		<category><![CDATA[Vacation]]></category>

		<guid isPermaLink="false">http://flashguy.de/blog/index.php/2009/06/28/long-time-no-blogging-2/</guid>
		<description><![CDATA[Hey you guys out there.
I'm sorry for not blogging for ages, but i was really busy with some awesome projects and and a long vacation in the US. I'll try to get all the stuff posted here in the next few days!
]]></description>
			<content:encoded><![CDATA[<p>Hey you guys out there.<br />
I'm sorry for not blogging for ages, but i was really busy with some awesome projects and and a long vacation in the US. I'll try to get all the stuff posted here in the next few days!</p>
]]></content:encoded>
			<wfw:commentRss>http://flashguy.de/blog/?feed=rss2&amp;p=97</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
