<?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/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
>

<channel>
	<title>Tiago&#039;s Weblog &#187; Tutorials</title>
	<atom:link href="http://blog.six4rty.ch/category/tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.six4rty.ch</link>
	<description>Code &#38; Technology Aficionado - Come for the Flash, stay for more!</description>
	<lastBuildDate>Tue, 01 Nov 2011 14:06:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<creativeCommons:license>http://creativecommons.org/licenses/by/2.5/ch/</creativeCommons:license>
		<item>
		<title>Android-AS3: Accelerometer</title>
		<link>http://blog.six4rty.ch/2010/11/21/android-as3-accelerometer/</link>
		<comments>http://blog.six4rty.ch/2010/11/21/android-as3-accelerometer/#comments</comments>
		<pubDate>Sun, 21 Nov 2010 18:04:22 +0000</pubDate>
		<dc:creator>Tiago</dc:creator>
				<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Flash Builder]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA["burrito"]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://blog.six4rty.ch/?p=889</guid>
		<description><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:550px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=Tiago%26%23039%3Bs+Weblog&link=http%253A%252F%252Fblog.six4rty.ch%252F2010%252F11%252F21%252Fandroid-as3-accelerometer%252F&title=Android-AS3%3A+Accelerometer&desc=You+bought+an+Android+phone+because+you+want+to+start+developing+a+cool+flash+or+AIR+App+for+that+device%3F%0D%0AOr+you+just+wondering+how+easy+it+is+to+develop+an+application+for+those+target+devices%3F%0D%0A%0D%0AI&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=1&fbsctr=1&fbslang=en&fbsendbutton=1&twbutton=1&twlang=en&twmention=six4rty&twrelated1=&twrelated2=&twctr=1&lnkdshow=show&lnkdctr=1&buzzbutton=1&buzzlang=en&buzzctr=0&diggbutton=1&diggctr=0&stblbutton=1&stblctr=0&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div>You bought an Android phone because you want to start developing a cool flash or AIR App for that device? Or you just wondering how easy it is to develop an application for those target devices? In the following series, I&#8217;m going to show you how to access those special properties that are available when [...]]]></description>
			<content:encoded><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:550px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=Tiago%26%23039%3Bs+Weblog&link=http%253A%252F%252Fblog.six4rty.ch%252F2010%252F11%252F21%252Fandroid-as3-accelerometer%252F&title=Android-AS3%3A+Accelerometer&desc=You+bought+an+Android+phone+because+you+want+to+start+developing+a+cool+flash+or+AIR+App+for+that+device%3F%0D%0AOr+you+just+wondering+how+easy+it+is+to+develop+an+application+for+those+target+devices%3F%0D%0A%0D%0AI&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=1&fbsctr=1&fbslang=en&fbsendbutton=1&twbutton=1&twlang=en&twmention=six4rty&twrelated1=&twrelated2=&twctr=1&lnkdshow=show&lnkdctr=1&buzzbutton=1&buzzlang=en&buzzctr=0&diggbutton=1&diggctr=0&stblbutton=1&stblctr=0&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div><p><a href="http://blog.six4rty.ch/wp-content/uploads/2010/11/as3mobile.jpg"><img class="alignleft size-medium wp-image-890" style="margin: 10px;" title="as3mobile" src="http://blog.six4rty.ch/wp-content/uploads/2010/11/as3mobile-300x270.jpg" alt="" width="168" height="151" /></a>You bought an Android phone because you want to start developing a cool flash or AIR App for that device?<br />
Or you just wondering how easy it is to develop an application for those target devices?</p>
<p>In the following series, I&#8217;m going to show you how to access those special properties that are available when developing for an Android or any other Flash / AIR powered device.</p>
<p>Today, we start with the <strong>Accelerometer API</strong>.</p>
<p>In this article I&#8217;m going to show you how to control a simple ball with the help of the accelerometer API. Clearly you could create a game like the well known <a rel="lightbox" href="http://blog.six4rty.ch/wp-content/uploads/2010/11/labyrinth.jpg">Labyrinth</a> available for the iOS or <a rel="lightbox" href="http://blog.six4rty.ch/wp-content/uploads/2010/11/teeter.jpg">Teeter</a> available on the HTC android devices very easy as soon as you know how to master the Accelerometer API.<br />
<span id="more-889"></span></p>
<p>Before we start just a heads up that you can follow this article even if you work with Flash CS5 although working with Flash Builder &#8220;Burrito&#8221; makes your life much easier.</p>
<p>To start let&#8217;s create a new Flash Builder &#8220;actionscript mobile project&#8221; called: &#8220;<strong>AccelerometerBall</strong>&#8220;.  Setup the project how you like it, just be sure that you enable full screen.</p>
<p>Now that you are ready to go we first check if an accelerometer is available, if none is available then it&#8217;s not worth of continuing the game, but if it&#8217;s available we add the sphere to the stage which we want to control. You can add whatever you want, i&#8217;m just using a simple sphere I created in Photoshop to be my indicator.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> Accelerometer.<span style="color: #006600;">isSupported</span> <span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
    _accelerometer = <span style="color: #000000; font-weight: bold;">new</span> Accelerometer<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    _accelerometer.<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>;
&nbsp;
    _sphere = <span style="color: #000000; font-weight: bold;">new</span> sphereClass<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    _sphere.<span style="color: #006600;">scaleX</span> = _sphere.<span style="color: #006600;">scaleY</span> = .2;
    addChild<span style="color: #66cc66;">&#40;</span> _sphere <span style="color: #66cc66;">&#41;</span>;
&nbsp;
    addEventListener<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>, moveSphere <span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #b1b100;">else</span>
<span style="color: #66cc66;">&#123;</span>
    <span style="color: #808080; font-style: italic;">//display message to user that accelerometer is not available</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>When you test the application at this point, you will not see your sphere unless your developer machine has an accelerometer in place, which I doubt <img src='http://blog.six4rty.ch/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>So to properly test it, you should debug your application on your mobile phone, now if you are on Flash CS5 you can use Device Central to simulate the normal behavior of  a mobile phone, Flash Builder &#8220;Burrito&#8221; users can deploy and debug directly from the Flash Builder Interface, to do that, just simply create a new Run configuration and setup as following.<br />
<a rel="lightbox" href="http://blog.six4rty.ch/wp-content/uploads/2010/11/runMobile.jpg"><img title="runMobile" src="http://blog.six4rty.ch/wp-content/uploads/2010/11/runMobile-150x150.jpg" alt="" width="150" height="150" /></a></p>
<p>When debugging the application on your phone you should now be able to see the sphere you placed in stage.</p>
<p>Next on let&#8217;s move on to the usage of the Accelerometer API.</p>
<p>To move our sphere, we simply need to take the accelerometers x &amp; y event, have a look at the code below:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">protected <span style="color: #000000; font-weight: bold;">function</span> onAccelUpdate<span style="color: #66cc66;">&#40;</span> event:AccelerometerEvent <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
     _targetX = event.<span style="color: #006600;">accelerationX</span> <span style="color: #66cc66;">*</span> _factor;
     _targetY = event.<span style="color: #006600;">accelerationY</span> <span style="color: #66cc66;">*</span> _factor;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
protected <span style="color: #000000; font-weight: bold;">function</span> moveSphere<span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
      _sphere.<span style="color: #006600;">x</span> -= _targetX;
      _sphere.<span style="color: #006600;">y</span> += _targetY;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>If you now test your applcation on your device or in Device Central you should see your sphere moving around on your screen.<br />
As you see every time an update of accelerometer is being dispatched the new position is being saved in the _targetX &amp; _targetY variable, thanks to the EnterFrame we move our sphere around the stage.</p>
<p>Here the complete code for you to review:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">package
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Bitmap</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">StageAlign</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">StageScaleMode</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">AccelerometerEvent</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">Event</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">sensors</span>.<span style="color: #006600;">Accelerometer</span>;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> AcceleroBall <span style="color: #0066CC;">extends</span> Sprite
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #66cc66;">&#91;</span>Embed<span style="color: #66cc66;">&#40;</span>source=<span style="color: #ff0000;">&quot;sphere.png&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> sphereClass:<span style="color: #000000; font-weight: bold;">Class</span>;
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _sphere			:Bitmap;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _factor			:uint			= <span style="color: #cc66cc;">50</span>;
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _accelerometer		:Accelerometer;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _targetX			:<span style="color: #0066CC;">Number</span>;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _targetY			:<span style="color: #0066CC;">Number</span>;
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> AcceleroBall<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#123;</span>
			setup<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		protected <span style="color: #000000; font-weight: bold;">function</span> setup<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> Accelerometer.<span style="color: #006600;">isSupported</span> <span style="color: #66cc66;">&#41;</span>
			<span style="color: #66cc66;">&#123;</span>
				_accelerometer = <span style="color: #000000; font-weight: bold;">new</span> Accelerometer<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
				_accelerometer.<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>;
&nbsp;
				_sphere = <span style="color: #000000; font-weight: bold;">new</span> sphereClass<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
				_sphere.<span style="color: #006600;">scaleX</span> = _sphere.<span style="color: #006600;">scaleY</span> = .2;
				addChild<span style="color: #66cc66;">&#40;</span> _sphere <span style="color: #66cc66;">&#41;</span>;
&nbsp;
				addEventListener<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>, moveSphere <span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
			<span style="color: #b1b100;">else</span>
			<span style="color: #66cc66;">&#123;</span>
				<span style="color: #808080; font-style: italic;">//display message to user that accelerometer is not available</span>
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		protected <span style="color: #000000; font-weight: bold;">function</span> onAccelUpdate<span style="color: #66cc66;">&#40;</span> event:AccelerometerEvent <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			_targetX = event.<span style="color: #006600;">accelerationX</span> <span style="color: #66cc66;">*</span> _factor;
			_targetY = event.<span style="color: #006600;">accelerationY</span> <span style="color: #66cc66;">*</span> _factor;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		protected <span style="color: #000000; font-weight: bold;">function</span> moveSphere<span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			_sphere.<span style="color: #006600;">x</span> -= _targetX;
			_sphere.<span style="color: #006600;">y</span> += _targetY;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Now it&#8217;s up on you to create the boundaries, some holes on the floor, and there you go you have your first Flash Game.</p>
<p>If you have questions, don&#8217;t hesitate to comment on this post.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.six4rty.ch/2010/11/21/android-as3-accelerometer/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/2.5/ch/</creativeCommons:license>
	</item>
		<item>
		<title>AIR: Quick Hint: Suppress Keyboard Events</title>
		<link>http://blog.six4rty.ch/2010/11/09/air-quick-hint-suppress-keyboard-events/</link>
		<comments>http://blog.six4rty.ch/2010/11/09/air-quick-hint-suppress-keyboard-events/#comments</comments>
		<pubDate>Tue, 09 Nov 2010 00:18:38 +0000</pubDate>
		<dc:creator>Tiago</dc:creator>
				<category><![CDATA[Adobe]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[Quick Hints]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[AS3.0]]></category>
		<category><![CDATA[Kiosk]]></category>

		<guid isPermaLink="false">http://blog.six4rty.ch/?p=878</guid>
		<description><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:550px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=Tiago%26%23039%3Bs+Weblog&link=http%253A%252F%252Fblog.six4rty.ch%252F2010%252F11%252F09%252Fair-quick-hint-suppress-keyboard-events%252F&title=AIR%3A+Quick+Hint%3A+Suppress+Keyboard+Events&desc=I%27ve++been+lately+working+on+a+Multitouch+Kiosk+Project%2C+in+the+upcoming++days%2C+I%27ll+be+posting+some+of+the+quick+hints+I+think+they+are+worth++sharing%2C+some+of+them+are+simply+good+to+know%2C+others+ar&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=1&fbsctr=1&fbslang=en&fbsendbutton=1&twbutton=1&twlang=en&twmention=six4rty&twrelated1=&twrelated2=&twctr=1&lnkdshow=show&lnkdctr=1&buzzbutton=1&buzzlang=en&buzzctr=0&diggbutton=1&diggctr=0&stblbutton=1&stblctr=0&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div>I&#8217;ve been lately working on a Multitouch Kiosk Project, in the upcoming days, I&#8217;ll be posting some of the quick hints I think they are worth sharing, some of them are simply good to know, others are braintwisting challenges I faced during the development. Today, I would like to show you how to suppress certain [...]]]></description>
			<content:encoded><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:550px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=Tiago%26%23039%3Bs+Weblog&link=http%253A%252F%252Fblog.six4rty.ch%252F2010%252F11%252F09%252Fair-quick-hint-suppress-keyboard-events%252F&title=AIR%3A+Quick+Hint%3A+Suppress+Keyboard+Events&desc=I%27ve++been+lately+working+on+a+Multitouch+Kiosk+Project%2C+in+the+upcoming++days%2C+I%27ll+be+posting+some+of+the+quick+hints+I+think+they+are+worth++sharing%2C+some+of+them+are+simply+good+to+know%2C+others+ar&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=1&fbsctr=1&fbslang=en&fbsendbutton=1&twbutton=1&twlang=en&twmention=six4rty&twrelated1=&twrelated2=&twctr=1&lnkdshow=show&lnkdctr=1&buzzbutton=1&buzzlang=en&buzzctr=0&diggbutton=1&diggctr=0&stblbutton=1&stblctr=0&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div><p><img class="alignleft" style="margin: 10px;" title="airCode" src="../wp-content/uploads/2010/10/airCode-300x270.jpg" alt="" width="137" height="124" />I&#8217;ve  been lately working on a Multitouch Kiosk Project, in the upcoming  days, I&#8217;ll be posting some of the quick hints I think they are worth  sharing, some of them are simply good to know, others are braintwisting  challenges I faced during the development.</p>
<p>Today, I would like to show you how to suppress certain Keyboard Events, let&#8217;s say you setup a kiosk application where the keyboard has to stay attached to the computer and available to the users, there are two ways you can prevent the application to be closed by a kiosk visitor:</p>
<p>A) You take hammer and hit the ESC key out of the keyboard<br />
B) You write a simple small function that will take care of it.</p>
<p>I know I know option A is more fun, but we prefer going with option B.</p>
<p>So let&#8217;s have a look what we need to do:<span id="more-878"></span><br />
1. As soon as our application starts we need to tell our application to go full screen interactive and add an eventlistener for Event.CLOSE and KeyboardEvent.KEYDOWN.<br />
2. When the user tries to exit the application by either trying a key combination or CMD+Q (Win: ALT+F4) these events will popup and do whatever you wrote in the callback, this is how it should look like:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">addEventListener<span style="color: #66cc66;">&#40;</span> KeyboardEvent.<span style="color: #006600;">KEYDOWN</span>, <span style="color: #0066CC;">onKeyDown</span> <span style="color: #66cc66;">&#41;</span>;
addEventListener<span style="color: #66cc66;">&#40;</span> Event.<span style="color: #006600;">CLOSING</span>, <span style="color: #0066CC;">onClose</span> <span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">onKeyDown</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">e</span>:KeyboardEvent <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
      <span style="color: #0066CC;">e</span>.<span style="color: #006600;">preventDefault</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">onClose</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">e</span>:Event <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
      <span style="color: #0066CC;">e</span>.<span style="color: #006600;">preventDefault</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Yep the magic happens with the preventDefault() method, as it says it prevents the default action to happen. Additionally you could assign an if statement to the onKeyDown event where you listen for a specific combination of keys so you can really close the application.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.six4rty.ch/2010/11/09/air-quick-hint-suppress-keyboard-events/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/2.5/ch/</creativeCommons:license>
	</item>
		<item>
		<title>AIR: Quick hint: Going Fullscreen</title>
		<link>http://blog.six4rty.ch/2010/10/16/air-quick-hint-going-fullscreen/</link>
		<comments>http://blog.six4rty.ch/2010/10/16/air-quick-hint-going-fullscreen/#comments</comments>
		<pubDate>Sat, 16 Oct 2010 15:51:12 +0000</pubDate>
		<dc:creator>Tiago</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Quick Hints]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[AS3.0]]></category>
		<category><![CDATA[fullscren]]></category>

		<guid isPermaLink="false">http://blog.six4rty.ch/?p=872</guid>
		<description><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:550px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=Tiago%26%23039%3Bs+Weblog&link=http%253A%252F%252Fblog.six4rty.ch%252F2010%252F10%252F16%252Fair-quick-hint-going-fullscreen%252F&title=AIR%3A+Quick+hint%3A+Going+Fullscreen&desc=I%27ve+been+lately+working+on+a+Multitouch+Kiosk+Project%2C+in+the+upcoming+days%2C+I%27ll+be+posting+some+of+the+quick+hints+I+think+they+are+worth+sharing%2C+some+of+them+are+simply+good+to+know%2C+others+are+b&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=1&fbsctr=1&fbslang=en&fbsendbutton=1&twbutton=1&twlang=en&twmention=six4rty&twrelated1=&twrelated2=&twctr=1&lnkdshow=show&lnkdctr=1&buzzbutton=1&buzzlang=en&buzzctr=0&diggbutton=1&diggctr=0&stblbutton=1&stblctr=0&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div>I&#8217;ve been lately working on a Multitouch Kiosk Project, in the upcoming days, I&#8217;ll be posting some of the quick hints I think they are worth sharing, some of them are simply good to know, others are braintwisting challenges I faced during the development. To start off I would like to show you people how [...]]]></description>
			<content:encoded><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:550px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=Tiago%26%23039%3Bs+Weblog&link=http%253A%252F%252Fblog.six4rty.ch%252F2010%252F10%252F16%252Fair-quick-hint-going-fullscreen%252F&title=AIR%3A+Quick+hint%3A+Going+Fullscreen&desc=I%27ve+been+lately+working+on+a+Multitouch+Kiosk+Project%2C+in+the+upcoming+days%2C+I%27ll+be+posting+some+of+the+quick+hints+I+think+they+are+worth+sharing%2C+some+of+them+are+simply+good+to+know%2C+others+are+b&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=1&fbsctr=1&fbslang=en&fbsendbutton=1&twbutton=1&twlang=en&twmention=six4rty&twrelated1=&twrelated2=&twctr=1&lnkdshow=show&lnkdctr=1&buzzbutton=1&buzzlang=en&buzzctr=0&diggbutton=1&diggctr=0&stblbutton=1&stblctr=0&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div><p><img class="alignleft size-medium wp-image-875" style="margin: 10px;" title="airCode" src="http://blog.six4rty.ch/wp-content/uploads/2010/10/airCode-300x270.jpg" alt="" width="137" height="124" />I&#8217;ve been lately working on a Multitouch Kiosk Project, in the upcoming days, I&#8217;ll be posting some of the quick hints I think they are worth sharing, some of them are simply good to know, others are braintwisting challenges I faced during the development.</p>
<p>To start off I would like to show you people how to go FullScreen on Startup of your application, before I show you how that works, let me tell you one very important thing:<br />
Going fullscreen rightaway without any user interaction is ONLY available within Adobe AIR, don&#8217;t try this with a pure AS3 or a Flex Project as this will not work!</p>
<p>Why? Security! People visiting a website shouldn&#8217;t be capped by a website taking over the whole screen without them wanting to do so, in AIR you create an application that a user will need to install to be able to run it, therefore other security aspects.</p>
<p>Enough of gray theory, let&#8217;s have a look how to do this very complicated task <img src='http://blog.six4rty.ch/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">//default fullscreenmode</span>
<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">displayState</span> = StageDisplayState.<span style="color: #006600;">FULL_SCREEN</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">//fullscreen mode with interactivity</span>
<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">displayState</span> = StageDisplayState.<span style="color: #006600;">FULLSCREEN_INTERACTIVE</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">//going back to normal screen</span>
<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">displayState</span> = StageDisplayState.<span style="color: #006600;">NORMAL</span>;</pre></div></div>

<p><span id="more-872"></span><br />
Yep that is all you need, in a typical AIR Application you would add an EventListener to your application where when creation has been completed it should call up the method above.</p>
<p>Example of AS3 application:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> myApp<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
        <span style="color: #0066CC;">stage</span>.<span style="color: #006600;">displayState</span> = StageDisplayState.<span style="color: #006600;">FULL_SCREEN</span>;
	subs = gridSize-<span style="color: #cc66cc;">1</span>;
&nbsp;
	particles = <span style="color: #000000; font-weight: bold;">new</span> Vector.<span style="color: #66cc66;">&amp;</span>gt;<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	_attractions = <span style="color: #000000; font-weight: bold;">new</span> Vector.;
	s = <span style="color: #000000; font-weight: bold;">new</span> ParticleSystem<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> Vector3D<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0.2</span>, <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>, .01<span style="color: #66cc66;">&#41;</span>;
&nbsp;
	_attractor = s.<span style="color: #006600;">makeParticle</span><span style="color: #66cc66;">&#40;</span> .8, <span style="color: #000000; font-weight: bold;">new</span> Vector3D<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">4</span>,-<span style="color: #cc66cc;">0.2</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #000000; font-weight: bold;">var</span> tmp_bm:Bitmap = <span style="color: #000000; font-weight: bold;">new</span> Img<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> as Bitmap;
	texture = tmp_bm.<span style="color: #006600;">bitmapData</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.six4rty.ch/2010/10/16/air-quick-hint-going-fullscreen/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/2.5/ch/</creativeCommons:license>
	</item>
		<item>
		<title>AS3: OSMF LightweightElement</title>
		<link>http://blog.six4rty.ch/2010/10/02/as3-osmf-lightweightelement/</link>
		<comments>http://blog.six4rty.ch/2010/10/02/as3-osmf-lightweightelement/#comments</comments>
		<pubDate>Sat, 02 Oct 2010 12:32:41 +0000</pubDate>
		<dc:creator>Tiago</dc:creator>
				<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[OSMF]]></category>
		<category><![CDATA[Quick Hints]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[AS 3.0]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://blog.six4rty.ch/?p=861</guid>
		<description><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:550px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=Tiago%26%23039%3Bs+Weblog&link=http%253A%252F%252Fblog.six4rty.ch%252F2010%252F10%252F02%252Fas3-osmf-lightweightelement%252F&title=AS3%3A+OSMF+LightweightElement&desc=You+are+in+need+of+a+simple+video+player%2C+iightweight+and+easy+to+use%3F%0D%0AYou+think+OSMF+is+too+complicated%2C+let+me+correct+you+and+present+you+the+LightVideoElement+Class.%0D%0A%0D%0ASimple+to+use%2C+quickly+up+&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=1&fbsctr=1&fbslang=en&fbsendbutton=1&twbutton=1&twlang=en&twmention=six4rty&twrelated1=&twrelated2=&twctr=1&lnkdshow=show&lnkdctr=1&buzzbutton=1&buzzlang=en&buzzctr=0&diggbutton=1&diggctr=0&stblbutton=1&stblctr=0&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div>You are in need of a simple video player, iightweight and easy to use? You think OSMF is too complicated, let me correct you and present you the LightVideoElement Class. Simple to use, quickly up and running and all needed &#8220;basic&#8221; features available. It&#8217;s even a default in OSMF, I actually wonder why no one [...]]]></description>
			<content:encoded><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:550px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=Tiago%26%23039%3Bs+Weblog&link=http%253A%252F%252Fblog.six4rty.ch%252F2010%252F10%252F02%252Fas3-osmf-lightweightelement%252F&title=AS3%3A+OSMF+LightweightElement&desc=You+are+in+need+of+a+simple+video+player%2C+iightweight+and+easy+to+use%3F%0D%0AYou+think+OSMF+is+too+complicated%2C+let+me+correct+you+and+present+you+the+LightVideoElement+Class.%0D%0A%0D%0ASimple+to+use%2C+quickly+up+&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=1&fbsctr=1&fbslang=en&fbsendbutton=1&twbutton=1&twlang=en&twmention=six4rty&twrelated1=&twrelated2=&twctr=1&lnkdshow=show&lnkdctr=1&buzzbutton=1&buzzlang=en&buzzctr=0&diggbutton=1&diggctr=0&stblbutton=1&stblctr=0&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div><p><a href="http://blog.six4rty.ch/wp-content/uploads/2010/08/osmfcode.jpg"><img class="alignleft size-medium wp-image-807" style="margin: 10px;" title="osmfcode" src="http://blog.six4rty.ch/wp-content/uploads/2010/08/osmfcode-300x270.jpg" alt="" width="210" height="189" /></a>You are in need of a simple video player, iightweight and easy to use?<br />
You think OSMF is too complicated, let me correct you and present you the LightVideoElement Class.</p>
<p>Simple to use, quickly up and running and all needed &#8220;basic&#8221; features available.<br />
It&#8217;s even a default in OSMF, I actually wonder why no one has written about it yet, it&#8217;s really easy to use and you can do all the basic things with it that a videoplayer needs to support nowadays and on top of it, it&#8217;s only 10k when compiled.</p>
<p>I&#8217;ve been using it for the last 2 projects I&#8217;ve made, and I couldn&#8217;t be happier, let&#8217;s have a quick look on how to use it:<span id="more-861"></span></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">_mediaPlayerSprite		= <span style="color: #000000; font-weight: bold;">new</span> MediaPlayerSprite<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
_mediaPlayerSprite.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">beginFill</span><span style="color: #66cc66;">&#40;</span>0x000000, <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#41;</span>;
_mediaPlayerSprite.<span style="color: #006600;">graphics</span>.<span style="color: #006600;">drawRect</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">640</span>,<span style="color: #cc66cc;">360</span><span style="color: #66cc66;">&#41;</span>;
_mediaPlayerSprite.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">endFill</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
_videoElement			= <span style="color: #000000; font-weight: bold;">new</span> LightweightVideoElement<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
_videoElement.<span style="color: #006600;">resource</span>		= <span style="color: #000000; font-weight: bold;">new</span> URLResource<span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;pathtoyourvideo.flv&quot;</span> <span style="color: #66cc66;">&#41;</span>;
_videoElement.<span style="color: #0066CC;">smoothing</span>		= <span style="color: #000000; font-weight: bold;">true</span>;
&nbsp;
addChild<span style="color: #66cc66;">&#40;</span> _mediaPlayerSprite <span style="color: #66cc66;">&#41;</span>;
_mediaPlayerSprite.<span style="color: #006600;">media</span>		= _videoElement;</pre></div></div>

<p>That&#8217;s it, no I&#8217;m not joking this is really it, you don&#8217;t need anything else to simply play a video,  now you might be asking yourself, well that&#8217;s cool but how can I control the playback? It&#8217; easy and very intuitive, basically you only need to access the mediaplayer instance which is integrated into the _mediaPlayerSprite, there all public methods like play, pause, stop, events and so on are available for you to use. take a look at some of the functions i implemented  to be able to control videoplayback.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">play</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
	_mediaPlayerSprite.<span style="color: #006600;">mediaPlayer</span>.<span style="color: #0066CC;">play</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">pause</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
	_mediaPlayerSprite.<span style="color: #006600;">mediaPlayer</span>.<span style="color: #0066CC;">pause</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">stop</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
	_mediaPlayerSprite.<span style="color: #006600;">mediaPlayer</span>.<span style="color: #0066CC;">stop</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> currentTime<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">int</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #b1b100;">return</span> _mediaPlayerSprite.<span style="color: #006600;">mediaPlayer</span>.<span style="color: #006600;">currentTime</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> videoDuration<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">int</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #b1b100;">return</span> _mediaPlayerSprite.<span style="color: #006600;">mediaPlayer</span>.<span style="color: #0066CC;">duration</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>See, simple, easy and lighting fast.<br />
But keep in mind that the LightWeightVideoElement has limited support, you can play every kind of flash supported videos, you can do everything a basic player needs to do, but as soon you start using SerialElements, Parallel elements and so on, then you should switch back to the default setup.<br />
As usual you can get all the information and documentation from the official <a href="http://www.opensourcemediaframework.com">OSMF</a> site.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.six4rty.ch/2010/10/02/as3-osmf-lightweightelement/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/2.5/ch/</creativeCommons:license>
	</item>
		<item>
		<title>AS3: Embed specific characters</title>
		<link>http://blog.six4rty.ch/2010/08/21/as3-embed-specific-characters/</link>
		<comments>http://blog.six4rty.ch/2010/08/21/as3-embed-specific-characters/#comments</comments>
		<pubDate>Sat, 21 Aug 2010 17:40:31 +0000</pubDate>
		<dc:creator>Tiago</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Quick Hints]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Utils]]></category>
		<category><![CDATA[AS 3.0]]></category>
		<category><![CDATA[Font]]></category>

		<guid isPermaLink="false">http://blog.six4rty.ch/?p=820</guid>
		<description><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:550px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=Tiago%26%23039%3Bs+Weblog&link=http%253A%252F%252Fblog.six4rty.ch%252F2010%252F08%252F21%252Fas3-embed-specific-characters%252F&title=AS3%3A+Embed+specific+characters&desc=%0D%0A%0D%0AYou+might+have+read+on+one+of+my+previous+tweets%2C+where+I+was+screaming+about+using+%22special%22+characters+in+Flash%2C+with+%22special%22+I+mean+arabic%2C+cyrillic%2C+hebrew%2C+chinese+simplified+and+traditiona&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=1&fbsctr=1&fbslang=en&fbsendbutton=1&twbutton=1&twlang=en&twmention=six4rty&twrelated1=&twrelated2=&twctr=1&lnkdshow=show&lnkdctr=1&buzzbutton=1&buzzlang=en&buzzctr=0&diggbutton=1&diggctr=0&stblbutton=1&stblctr=0&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div>You might have read on one of my previous tweets, where I was screaming about using &#8220;special&#8221; characters in Flash, with &#8220;special&#8221; I mean arabic, cyrillic, hebrew, chinese simplified and traditional, as well japanese. I know,  I know, there is TLF (Text Layout Framework) that handles the whole text, but I&#8217;m talking about embedding the [...]]]></description>
			<content:encoded><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:550px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=Tiago%26%23039%3Bs+Weblog&link=http%253A%252F%252Fblog.six4rty.ch%252F2010%252F08%252F21%252Fas3-embed-specific-characters%252F&title=AS3%3A+Embed+specific+characters&desc=%0D%0A%0D%0AYou+might+have+read+on+one+of+my+previous+tweets%2C+where+I+was+screaming+about+using+%22special%22+characters+in+Flash%2C+with+%22special%22+I+mean+arabic%2C+cyrillic%2C+hebrew%2C+chinese+simplified+and+traditiona&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=1&fbsctr=1&fbslang=en&fbsendbutton=1&twbutton=1&twlang=en&twmention=six4rty&twrelated1=&twrelated2=&twctr=1&lnkdshow=show&lnkdctr=1&buzzbutton=1&buzzlang=en&buzzctr=0&diggbutton=1&diggctr=0&stblbutton=1&stblctr=0&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div><p><img class="alignleft size-medium wp-image-724" style="margin: 10px;" title="as3code" src="http://blog.six4rty.ch/wp-content/uploads/2010/07/as3code-300x270.jpg" alt="" width="210" height="189" /></p>
<p>You might have read on one of my previous tweets, where I was screaming about using &#8220;special&#8221; characters in Flash, with &#8220;special&#8221; I mean arabic, cyrillic, hebrew, chinese simplified and traditional, as well japanese.</p>
<p>I know,  I know, there is TLF (Text Layout Framework) that handles the whole text, but I&#8217;m talking about embedding the font, did you knew that the complete chinese Unicode range helds something around 20&#8217;000 characters? You might think so what? Let me tell you that the complete chinese character range is over 7MB big!!! Do you really want to let your viewers download a 7MB file just for the font? No.</p>
<p>So I&#8217;ve created a quick app that will enable you to read out the UTF code from the text you need to use, with it you can specifically embed only the characters you need and take the file size down to a minimum. Now there is only a downside of this method, if the textual content changes a day, you need to again import the new characters.<br />
Apart from that, I haven&#8217;t seen any bad things about this implementation.</p>
<p>At the end of this post you will find an useful small tool to get all the needed characters.<span id="more-820"></span></p>
<p>As an example below with this line you are embedding a font only containing numerals typing 1234567890 will give you a range from U+0030 to U+0039</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">Embed(source=&quot;font_file_name&quot;, fontName=&quot;font_name&quot;, mimeType=&quot;application/x-font-truetype&quot;, unicodeRange=&quot;U+0030-U+0039,U+002E&quot;)]</pre></div></div>

<p>So let&#8217;s assume you would like to write this: <em>&#8220;Nemusíte oči vidět, musíte vidění&#8221;</em> which means <em>&#8220;You don&#8217;t need eyes to see, you need vision&#8221;</em> and only embed the needed characters, you would embed your font like this</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">Embed(source=&quot;font_file_name&quot;, fontName=&quot;font_name&quot;,  mimeType=&quot;application/x-font-truetype&quot;,  unicodeRange=&quot;U+004e, U+0065, U+006d, U+0075, U+0073, U+00ed, U+0074, U+0065, U+0020,  U+006f, U+010d, U+0069, U+0020, U+0076, U+0069, U+0064, U+011b, U+0074,  U+002c, U+0020, U+006d, U+0075, U+0073, U+00ed, U+0074, U+0065, U+0020,  U+0076, U+0069, U+0064, U+011b, U+006e, U+00ed&quot;)]</pre></div></div>

<p>If you don&#8217;t know how to use this kind of font embedding, have a read here:<a href="http://soledadpenades.com/2008/10/21/embedding-fonts-in-actionscript-3-using-flex-sdk/" target="_blank"></p>
<p>http://soledadpenades.com/2008/10/21/embedding-fonts-in-actionscript-3-using-flex-sdk/</a></p>
<p>Test ride it your self and have fun <img src='http://blog.six4rty.ch/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_0" width="616" height="494">
      <param name="movie" value="http://blog.six4rty.ch/wp-content/uploads/2010/08/UnicodeFinder1.swf" />
      <param name="allowfullscreen" value="true" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://blog.six4rty.ch/wp-content/uploads/2010/08/UnicodeFinder1.swf" width="616" height="494" allowfullscreen="true">
      <!--<![endif]-->
        
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>

]]></content:encoded>
			<wfw:commentRss>http://blog.six4rty.ch/2010/08/21/as3-embed-specific-characters/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/2.5/ch/</creativeCommons:license>
	</item>
		<item>
		<title>AS3: Multiline textfields and Line Metrics</title>
		<link>http://blog.six4rty.ch/2010/07/31/as3-multiline-textfields-and-line-metrics/</link>
		<comments>http://blog.six4rty.ch/2010/07/31/as3-multiline-textfields-and-line-metrics/#comments</comments>
		<pubDate>Sat, 31 Jul 2010 11:25:25 +0000</pubDate>
		<dc:creator>Tiago</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Quick Hints]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[AS3.0]]></category>
		<category><![CDATA[StringUtil]]></category>
		<category><![CDATA[TextField]]></category>

		<guid isPermaLink="false">http://blog.six4rty.ch/?p=791</guid>
		<description><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:550px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=Tiago%26%23039%3Bs+Weblog&link=http%253A%252F%252Fblog.six4rty.ch%252F2010%252F07%252F31%252Fas3-multiline-textfields-and-line-metrics%252F&title=AS3%3A+Multiline+textfields+and+Line+Metrics&desc=Last+week+I+had+to+do+something+that+I+never+thought+of%2C+let+me+present+you+the+case%3A%0D%0A%0D%0AFirst+of+all+we+have+a+multiline%2C+word-wrapped+textfield+in+AS3%2C+the+text+is+picked+up+from+an+external+XML+fil&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=1&fbsctr=1&fbslang=en&fbsendbutton=1&twbutton=1&twlang=en&twmention=six4rty&twrelated1=&twrelated2=&twctr=1&lnkdshow=show&lnkdctr=1&buzzbutton=1&buzzlang=en&buzzctr=0&diggbutton=1&diggctr=0&stblbutton=1&stblctr=0&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div>Last week I had to do something that I never thought of, let me present you the case: First of all we have a multiline, word-wrapped textfield in AS3, the text is picked up from an external XML file and gets styled with a CSS stylesheet, the textfield CAN have one line or multiple lines [...]]]></description>
			<content:encoded><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:550px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=Tiago%26%23039%3Bs+Weblog&link=http%253A%252F%252Fblog.six4rty.ch%252F2010%252F07%252F31%252Fas3-multiline-textfields-and-line-metrics%252F&title=AS3%3A+Multiline+textfields+and+Line+Metrics&desc=Last+week+I+had+to+do+something+that+I+never+thought+of%2C+let+me+present+you+the+case%3A%0D%0A%0D%0AFirst+of+all+we+have+a+multiline%2C+word-wrapped+textfield+in+AS3%2C+the+text+is+picked+up+from+an+external+XML+fil&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=1&fbsctr=1&fbslang=en&fbsendbutton=1&twbutton=1&twlang=en&twmention=six4rty&twrelated1=&twrelated2=&twctr=1&lnkdshow=show&lnkdctr=1&buzzbutton=1&buzzlang=en&buzzctr=0&diggbutton=1&diggctr=0&stblbutton=1&stblctr=0&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div><p><a href="http://blog.six4rty.ch/wp-content/uploads/2010/07/as3code.jpg"><img class="alignleft size-medium wp-image-724" style="margin: 10px;" title="as3code" src="http://blog.six4rty.ch/wp-content/uploads/2010/07/as3code-300x270.jpg" alt="" width="210" height="189" /></a>Last week I had to do something that I never thought of, let me present you the case:</p>
<p>First of all we have a multiline, word-wrapped textfield in AS3, the text is picked up from an external XML file and gets styled with a CSS stylesheet, the textfield CAN have one line or multiple lines (depending on the translation and the language used), if the text is only an one-liner, the graphic (a simple small gray arrow) needs to be placed after the text in the middle of the first line, so you are able to visualize this, think about a standard &lt;li&gt; tag where you get the black dot, in my case just at the other side eg. at the end fo the line. have a look at the <a rel="lightbox" href="http://blog.six4rty.ch/wp-content/uploads/2010/07/lastLine.jpg">Example</a> for a visual clarification what I want to achieve.</p>
<p>Basically a simple task, you grab the textlength add the gutter and margin to it and place the small arrow at that position.. but what do you do when the text goes multine and word wraps automatically?<br />
After doing some experiments, I&#8217;ve came up with a simple yet appropriate solution for this.<br />
<span id="more-791"></span>Let&#8217;s start with a simple text field, containing some text and setup for multiline and wordwrapping.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> tf:<span style="color: #0066CC;">TextField</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">TextField</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
tf.<span style="color: #0066CC;">text</span> = <span style="color: #ff0000;">&quot;Lorem Ipsum is simply dummy text of the printing and typesetting industry.&quot;</span>;
tf.<span style="color: #0066CC;">width</span> = <span style="color: #cc66cc;">100</span>;
tf.<span style="color: #0066CC;">multiline</span> = <span style="color: #000000; font-weight: bold;">true</span>;
tf.<span style="color: #0066CC;">wordWrap</span> = <span style="color: #000000; font-weight: bold;">true</span>;
addChild<span style="color: #66cc66;">&#40;</span> tf <span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>This will display a simple textfield without any formatting with 5 lines of content. Why did I set a width value on my textfield? Well without it, the textfield would just be as wide as the text, resulting in a single line text, and that&#8217;s not what we want.</p>
<p>Now we create a simple square / dot / arrow whatever you like acting as a marker for the end of line, so you can visualize what&#8217;s happening, I&#8217;ve created a small rectangle like this:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> rect:Sprite = <span style="color: #000000; font-weight: bold;">new</span> Sprite<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
rect.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">beginFill</span><span style="color: #66cc66;">&#40;</span>0xff0000<span style="color: #66cc66;">&#41;</span>;
rect.<span style="color: #006600;">graphics</span>.<span style="color: #006600;">drawRect</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">10</span>, <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>;
rect.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">endFill</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
addChild<span style="color: #66cc66;">&#40;</span> rect <span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>Simple rectangle, doesn&#8217;t need much of an explanation, maybe you asking yourself why I&#8217;ve set it at x &amp; y 0? Although I could position the rectangle right at the proper position I always preferred to use the setters of it so I rather create all my shapes/graphs at 0,0 and move them with myShape.x = 100, it makes things more obvious to read and you find it much quicker then doing directly on the drawRect() method.</p>
<p>Next up let&#8217;s have a look at our class that returns the requested values.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> StringUtil
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">private</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">var</span> _lastChar		:TextLineMetrics;
	<span style="color: #0066CC;">private</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">_x</span>			:<span style="color: #0066CC;">int</span>;
	<span style="color: #0066CC;">private</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">_y</span>			:<span style="color: #0066CC;">int</span>;
&nbsp;
	<span style="color: #0066CC;">private</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">var</span> _gutter		:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">2</span>;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">function</span> getEndOfLine<span style="color: #66cc66;">&#40;</span> tf:<span style="color: #0066CC;">TextField</span>, line:<span style="color: #0066CC;">int</span> <span style="color: #66cc66;">&#41;</span>:Point
	<span style="color: #66cc66;">&#123;</span>
		_lastChar 	= tf.<span style="color: #006600;">getLineMetrics</span><span style="color: #66cc66;">&#40;</span>line<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #0066CC;">_x</span>		= tf.<span style="color: #006600;">x</span> + _lastChar.<span style="color: #0066CC;">width</span> + _gutter;
		<span style="color: #0066CC;">_y</span>		= _lastChar.<span style="color: #0066CC;">height</span> <span style="color: #66cc66;">*</span> line  + _lastChar.<span style="color: #006600;">ascent</span>;
&nbsp;
		<span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">new</span> Point<span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">_x</span>, <span style="color: #0066CC;">_y</span> <span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>What we are doing here is rather simple then you think. First we pass the textfield and the desired line to our static function, then using the getLineMetrics() method we return the desired line&#8217;s metrics, this can now be used to set an x and y position of the to be returned Point(). as you see at the _x value, I&#8217;m just telling it to add the textfields x position to the width of the requested line, at the end we add the gutter value for the textfield.<br />
The vertical position is another story, here we need to get the height of the desired line and multiply with it. this has the reason that there is no method available to get the proper y position of the line, so by multiplying the textheight with the desired line you get the proper y position of it. After that calculation we add the _lastCahr.ascent property of the line, asking what ascent? Take a look at the image below for more information about it but basically it&#8217;s just the length of the baseline to the top of the line height in pixels, so exactly the middle of our text.</p>
<p>Have a look at the image below for a nice and clean overview about the gutter of a flash textfield as well about the other properties a textfield has.</p>
<p><a href="http://blog.six4rty.ch/wp-content/uploads/2010/07/text-metrics.jpg" rel="lightbox"><img class="size-medium wp-image-800 alignnone" title="text-metrics" src="http://blog.six4rty.ch/wp-content/uploads/2010/07/text-metrics-300x200.jpg" alt="" width="180" height="120" /></a></p>
<p>Something you should also be aware of is that the width of the text line is relative to the textfield width, but you need to subtract the gutter width of 4 pixels (2 pixels on each side ).</p>
<p>Now that our class is available let&#8217;s take a look at how I used it for this example.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> point:Point = StringUtil.<span style="color: #006600;">getEndOfLine</span><span style="color: #66cc66;">&#40;</span> tf, tf.<span style="color: #006600;">numLines</span> - <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#41;</span>;
rect.<span style="color: #006600;">x</span> = point.<span style="color: #006600;">x</span>;
rect.<span style="color: #006600;">y</span> = point.<span style="color: #006600;">y</span>;</pre></div></div>

<p>What we are doing here is nothing else then creating a new Point based on the position returned by our class, passing the textfield and specially since I want to have the rectangle on the LAST line I just ask for the textfields number of lines &#8211; 1.</p>
<p><a href="http://blog.six4rty.ch/wp-content/uploads/2010/07/lastLine.jpg"><img class="size-full wp-image-794 alignnone" title="lastLine" src="http://blog.six4rty.ch/wp-content/uploads/2010/07/lastLine.jpg" alt="" width="199" height="113" /></a><br />
When running this example above you should see the small red rectangle on the last line of our textfield. yay!!!</p>
<p>You can download the StringUtil class here: <a href="http://blog.six4rty.ch/wp-content/uploads/2010/07/StringUtil.as_.zip">StringUtil.as</a><br />
Hope this serves you as well as it served me last week, and don&#8217;t forget to leave a comment if you have any questions about it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.six4rty.ch/2010/07/31/as3-multiline-textfields-and-line-metrics/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/2.5/ch/</creativeCommons:license>
	</item>
		<item>
		<title>AS3: Quickhint: Shared Objects</title>
		<link>http://blog.six4rty.ch/2010/07/24/as3-quick-hint-shared-objects/</link>
		<comments>http://blog.six4rty.ch/2010/07/24/as3-quick-hint-shared-objects/#comments</comments>
		<pubDate>Sat, 24 Jul 2010 16:51:54 +0000</pubDate>
		<dc:creator>Tiago</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flash Media Server]]></category>
		<category><![CDATA[Quick Hints]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[AS 3.0]]></category>
		<category><![CDATA[Data]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Shared Object]]></category>

		<guid isPermaLink="false">http://blog.six4rty.ch/?p=542</guid>
		<description><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:550px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=Tiago%26%23039%3Bs+Weblog&link=http%253A%252F%252Fblog.six4rty.ch%252F2010%252F07%252F24%252Fas3-quick-hint-shared-objects%252F&title=AS3%3A+Quickhint%3A+Shared+Objects&desc=%0D%0A%0D%0ALast+week+while+working+on+the+interface+for+my+new+upcoming+library+I+needed+a+way+to+save+some+data+on+the+users+computer%2C+altough+I%27m+working+with+AIR+I+could+easily+save+an+xml+or+a+txt+file+t&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=1&fbsctr=1&fbslang=en&fbsendbutton=1&twbutton=1&twlang=en&twmention=six4rty&twrelated1=&twrelated2=&twctr=1&lnkdshow=show&lnkdctr=1&buzzbutton=1&buzzlang=en&buzzctr=0&diggbutton=1&diggctr=0&stblbutton=1&stblctr=0&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div>Last week while working on the interface for my new upcoming library I needed a way to save some data on the users computer, altough I&#8217;m working with AIR I could easily save an xml or a txt file to the users local computer, but as soon as I would start writing a pure as3 [...]]]></description>
			<content:encoded><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:550px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=Tiago%26%23039%3Bs+Weblog&link=http%253A%252F%252Fblog.six4rty.ch%252F2010%252F07%252F24%252Fas3-quick-hint-shared-objects%252F&title=AS3%3A+Quickhint%3A+Shared+Objects&desc=%0D%0A%0D%0ALast+week+while+working+on+the+interface+for+my+new+upcoming+library+I+needed+a+way+to+save+some+data+on+the+users+computer%2C+altough+I%27m+working+with+AIR+I+could+easily+save+an+xml+or+a+txt+file+t&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=1&fbsctr=1&fbslang=en&fbsendbutton=1&twbutton=1&twlang=en&twmention=six4rty&twrelated1=&twrelated2=&twctr=1&lnkdshow=show&lnkdctr=1&buzzbutton=1&buzzlang=en&buzzctr=0&diggbutton=1&diggctr=0&stblbutton=1&stblctr=0&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div><p><a href="http://blog.six4rty.ch/wp-content/uploads/2010/07/as3code.jpg"><img class="alignleft size-medium wp-image-724" style="margin: 10px;" title="as3code" src="http://blog.six4rty.ch/wp-content/uploads/2010/07/as3code-300x270.jpg" alt="" width="210" height="189" /></a></p>
<p>Last week while working on the interface for my new upcoming library I needed a way to save some data on the users computer, altough I&#8217;m working with AIR I could easily save an xml or a txt file to the users local computer, but as soon as I would start writing a pure as3 project I would have to rewrite it again, as I can&#8217;t be sure that the client will have Flash Player 10 or even the rights to save to it&#8217;s local harddisk, some people working at bigger companies are not allowed to save anything to their local harddisk due to security rights.</p>
<p>The solution for this is simple yet effective, you need to use SharedObjects aka. Cookies in Flash.</p>
<p>Shared Objects can do the following:</p>
<ul>
<li><strong>Maintain Local Persistence</strong>: Saves data locally on the users drive, for example you could save the last application state or the score of the last game, create a local highscore list and many many more applications for local use.</li>
<li><strong>Store and Share Data on FMS</strong>: Basically the same as before, but with the difference that you saving the shared object on a flash media server. Good thing about it, it can be shared throughout multiple computers, the same user using the same application on multiple computers can save its data on a server.</li>
<li><strong>Share data in realtime</strong>: using FMS you can aswell for example save the state of a multiuser application saving the current state of the applcation, every new user will get the current state based on the shared object</li>
</ul>
<p>More information about Shared Objects can be found <a href="http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/net/SharedObject.html" target="_blank">HERE </a></p>
<p><span id="more-542"></span></p>
<p>Let me show you a few lines of code and explain what you can do with it.</p>
<p>The most basic example is how to write data into a shared object.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> _so:<span style="color: #0066CC;">SharedObject</span>;
_so = <span style="color: #0066CC;">SharedObject</span>.<span style="color: #0066CC;">getLocal</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;myLocalData&quot;</span><span style="color: #66cc66;">&#41;</span>;
_so.<span style="color: #0066CC;">data</span>.<span style="color: #006600;">firstname</span> = <span style="color: #ff0000;">&quot;myfirstname&quot;</span>;
_so.<span style="color: #0066CC;">data</span>.<span style="color: #006600;">lastname</span> = <span style="color: #ff0000;">&quot;mylastname&quot;</span>;
_so.<span style="color: #0066CC;">data</span>.<span style="color: #006600;">age</span> = <span style="color: #ff0000;">&quot;30&quot;</span>;
_so.<span style="color: #0066CC;">flush</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>In the example above we create a new variable called _so of the type SharedObject, after that we use the getLocal() method to create the shared object, if no shared object does not already exist it will be created. if the call fails or the parameters passed along are invalid, flash throws an exception. Calling the flush() method the data will be saved to the users local harddisk.</p>
<p>Next up lets see how you can read from a persistent shared object.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> _so:<span style="color: #0066CC;">SharedObject</span>;
_so = <span style="color: #0066CC;">SharedObject</span>.<span style="color: #0066CC;">getLocal</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;myLocalData&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> _so.<span style="color: #0066CC;">data</span>.<span style="color: #006600;">firstname</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">//traces myfirstname</span>
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>_so.<span style="color: #0066CC;">data</span>.<span style="color: #006600;">lastname</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// traces mylastname</span>
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>_so.<span style="color: #0066CC;">data</span>.<span style="color: #006600;">age</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// traces 30</span></pre></div></div>

<p>This time we do basically the same as before, but instead of saving data we call data, when calling _so.data.age you are going to grab the sharedobjects property named age which results in 30.</p>
<p>If you rather prefer to save SharedObjects to an FMS, you can use it this way:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> _nc:<span style="color: #0066CC;">NetConnection</span>;
<span style="color: #000000; font-weight: bold;">var</span> _so:<span style="color: #0066CC;">SharedObject</span>;
&nbsp;
_nc = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">NetConnection</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
_nc.<span style="color: #0066CC;">connect</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;rtmp://yourFMSserver/yourAppName&quot;</span><span style="color: #66cc66;">&#41;</span>;
_so = <span style="color: #0066CC;">SharedObject</span>.<span style="color: #006600;">getRemote</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;myRemoteData&quot;</span>, nc.<span style="color: #006600;">uri</span>, <span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span>;
_so.<span style="color: #0066CC;">connect</span><span style="color: #66cc66;">&#40;</span> nc <span style="color: #66cc66;">&#41;</span>;
_so.<span style="color: #0066CC;">setProperty</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;names&quot;</span>, <span style="color: #66cc66;">&#123;</span>firstame:myfirstname, lastname:myLastname<span style="color: #66cc66;">&#125;</span> <span style="color: #66cc66;">&#41;</span>;
_so.<span style="color: #0066CC;">setProperty</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;age&quot;</span>, <span style="color: #66cc66;">&#123;</span><span style="color: #ff0000;">&quot;30&quot;</span><span style="color: #66cc66;">&#125;</span> <span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>This time we create a new NetConnection to the Flash Media Server and it&#8217;s application, calling the getRemote() method acts the same as using the getLocal() method, but you also need to pass the netconnections URI to be able to save the the sharedobject remotely.<br />
Differently from the local version we use the setProperty() method to save data on the remote Shared Object.</p>
<p>These are the basics for handling Shared Objects, if you have any further questions just drop me a line and I might be able to help you out.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.six4rty.ch/2010/07/24/as3-quick-hint-shared-objects/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/2.5/ch/</creativeCommons:license>
	</item>
		<item>
		<title>AS3 &amp; Facebook: Uploading Webcam Photos</title>
		<link>http://blog.six4rty.ch/2010/07/17/as3-facebook-uploading-webcam-photos/</link>
		<comments>http://blog.six4rty.ch/2010/07/17/as3-facebook-uploading-webcam-photos/#comments</comments>
		<pubDate>Sat, 17 Jul 2010 12:34:27 +0000</pubDate>
		<dc:creator>Tiago</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[AS3.0]]></category>
		<category><![CDATA[Facebook]]></category>

		<guid isPermaLink="false">http://blog.six4rty.ch/?p=740</guid>
		<description><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:550px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=Tiago%26%23039%3Bs+Weblog&link=http%253A%252F%252Fblog.six4rty.ch%252F2010%252F07%252F17%252Fas3-facebook-uploading-webcam-photos%252F&title=AS3+%26+Facebook%3A+Uploading+Webcam+Photos&desc=Facebook..+Could+you+live+without+facebook+nowadays%3F+Sometimes+I%27m+happy+when+I+don%27t+get+anything+on+facebook%2C+just+to+have+a+bit+of+peace+and+quiet+of+it.%0D%0A%0D%0AWell%2C+nevertheless%2C+I%27m+writing+this+art&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=1&fbsctr=1&fbslang=en&fbsendbutton=1&twbutton=1&twlang=en&twmention=six4rty&twrelated1=&twrelated2=&twctr=1&lnkdshow=show&lnkdctr=1&buzzbutton=1&buzzlang=en&buzzctr=0&diggbutton=1&diggctr=0&stblbutton=1&stblctr=0&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div>Facebook.. Could you live without facebook nowadays? Sometimes I&#8217;m happy when I don&#8217;t get anything on facebook, just to have a bit of peace and quiet of it. Well, nevertheless, I&#8217;m writing this article because I&#8217;ve seen this post on the Adobe Forums by dmennenoh where he asked for the possibilities of using the Facebook [...]]]></description>
			<content:encoded><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:550px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=Tiago%26%23039%3Bs+Weblog&link=http%253A%252F%252Fblog.six4rty.ch%252F2010%252F07%252F17%252Fas3-facebook-uploading-webcam-photos%252F&title=AS3+%26+Facebook%3A+Uploading+Webcam+Photos&desc=Facebook..+Could+you+live+without+facebook+nowadays%3F+Sometimes+I%27m+happy+when+I+don%27t+get+anything+on+facebook%2C+just+to+have+a+bit+of+peace+and+quiet+of+it.%0D%0A%0D%0AWell%2C+nevertheless%2C+I%27m+writing+this+art&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=1&fbsctr=1&fbslang=en&fbsendbutton=1&twbutton=1&twlang=en&twmention=six4rty&twrelated1=&twrelated2=&twctr=1&lnkdshow=show&lnkdctr=1&buzzbutton=1&buzzlang=en&buzzctr=0&diggbutton=1&diggctr=0&stblbutton=1&stblctr=0&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div><p><a href="http://blog.six4rty.ch/wp-content/uploads/2010/07/as3FB.jpg"><img class="size-medium wp-image-741 alignleft" style="margin: 10px;" title="as3FB" src="http://blog.six4rty.ch/wp-content/uploads/2010/07/as3FB-300x270.jpg" alt="" width="210" height="189" /></a>Facebook.. Could you live without facebook nowadays? Sometimes I&#8217;m happy when I don&#8217;t get anything on facebook, just to have a bit of peace and quiet of it.</p>
<p>Well, nevertheless, I&#8217;m writing this article because I&#8217;ve seen this post on the Adobe Forums by dmennenoh where he asked for the possibilities of using the Facebook AS3 API without Flex or AIR and the possibility of uploading pictures to Facebook.</p>
<p>Short answer: yes, it&#8217;s possible but&#8230;. it&#8217;s not a very well documented process of achieving it.</p>
<p>Before we start, I would like to recommend you a few tutorials on the Adobe Developer Connection, Jeanette Stallons wrote a whole series about the usage of the Facebook AS3 API, and it&#8217;s an absolute must read if you want to start developing flash applications or websites using facebook data and connectivity. First I recommend you starting with the <a href="http://www.adobe.com/devnet/facebook/articles/first_flex_facebook_desktop_app.html" target="_blank">Quick Start</a> to get a feeling for it, after that move on to <a href="http://www.adobe.com/devnet/facebook/articles/first_flex_facebook_web_app_pt1.html" target="_blank">Part 1: Build and Test Locally</a>, <a href="http://www.adobe.com/devnet/facebook/articles/first_flex_facebook_web_app_pt2.html" target="_blank">Part 2: Deploy on Facebook</a> and Part 3: <a href="http://www.adobe.com/devnet/facebook/articles/first_flex_facebook_web_app_pt3.html" target="_blank">Deploy using Facebook Connect</a><span id="more-740"></span></p>
<p>First of all before we start be sure to get the newest FacebookAS3 library, be sure to download the Flash version of it. At this point the current version is <a href="http://code.google.com/p/facebook-actionscript-api/downloads/detail?name=Facebook_library_v3.4_flash.swc" target="_blank">Facebook_library_v3.4_flash.swc</a> you can get newest version on the <a href="http://code.google.com/p/facebook-actionscript-api/" target="_blank">Project page</a>.</p>
<p>As I prefer using <a href="http://www.minimalcomps.com/" target="_blank">MinimalComps</a> by Keith Peters (aka. BIT-101) we are going to download his classes here. If you don&#8217;t know MinimalComps, it&#8217;s a set of components like you know from Flex or the Flash IDE, it contains the default set of components like button, textfield, textarea, but also has various interesting components like dials, calendars, knobs and much much more. I strongly recommend you read through the documentation and work through a few tutorials so you get your hands dirty with it.<br />
Again this is not a MUST-USE, I just feel more comfortable using these then any other components.</p>
<p>I strongly recommend to use the <a href="http://demonsterdebugger.com/" target="_blank">deMonsterDebugger</a> to trace events and data returned from facebook, it has a simple to use interface and is far better then the normal trace() functionality.</p>
<p><strong>1. Setup</strong><br />
1.1 Let&#8217;s start by opening Flash Builder and creating a new Actionscript Project with the name <em><strong>FacebookAS3</strong></em>. We are not going to use any Flex Components neither any AIR methods, you could also build this in the Flash IDE, but I prefer to use Flash Builder for it&#8217;s Code Completion features and it&#8217;s the tool I prefer when coding AS3.</p>
<p>1.2 Import the .SWC file by right clicking on the Project name and selecting <strong>Properties</strong>, then go to <strong>Actionscript Build Path </strong>and<strong> </strong>select the<strong> Library path</strong> tab, press the <strong>Add SWC</strong> button and locate the downloaded facebook_library_flash.swc you downloaded previously. Press OK and we are ready to go.</p>
<p>1.3 If you using MinimalComps for the UserInterface, don&#8217;t forget to import the source to your project so you can use them properly.</p>
<p>1.4 If you using deMonsterDebugger to trace and debug your application, don&#8217;t forget to import the needed classes to your project src folder.</p>
<p><strong>2. Login </strong><br />
Below you will find my main class that handles the whole login procedure of our small application.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Main <span style="color: #0066CC;">extends</span> Sprite
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">private</span> <span style="color: #0066CC;">static</span> const API_KEY	:<span style="color: #0066CC;">String</span>				= <span style="color: #ff0000;">&quot;xxxxx&quot;</span>;
		<span style="color: #0066CC;">private</span> <span style="color: #0066CC;">static</span> const SECRET	:<span style="color: #0066CC;">String</span>				= <span style="color: #ff0000;">&quot;xxxxx&quot;</span>;
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _overlaySprite		:Sprite;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _userInterface		:UserInterface;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _photoBA			:ByteArray;
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _fb					:Facebook;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _fbSession			:FacebookSessionUtil;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _userData			:FacebookUser;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _uid				:<span style="color: #0066CC;">String</span>;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _batchCollection	:BatchCollection;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _batchRun			:BatchRun;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _albumArray			:<span style="color: #0066CC;">Array</span>;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _uploadPhoto		:UploadPhoto;
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> Main<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#123;</span>
			MonsterDebugger.<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>, <span style="color: #ff0000;">&quot;init - Facebook integration&quot;</span> <span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #0066CC;">stage</span>.<span style="color: #0066CC;">scaleMode</span> = StageScaleMode.<span style="color: #006600;">NO_SCALE</span>;
			<span style="color: #0066CC;">stage</span>.<span style="color: #0066CC;">align</span>		= StageAlign.<span style="color: #006600;">TOP_LEFT</span>;
&nbsp;
			_overlaySprite = <span style="color: #000000; font-weight: bold;">new</span> Sprite<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			_overlaySprite.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">beginFill</span><span style="color: #66cc66;">&#40;</span>0xcccccc, <span style="color: #cc66cc;">0.5</span> <span style="color: #66cc66;">&#41;</span>;
			_overlaySprite.<span style="color: #006600;">graphics</span>.<span style="color: #006600;">drawRect</span><span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #0066CC;">stage</span>.<span style="color: #006600;">stageWidth</span>, <span style="color: #0066CC;">stage</span>.<span style="color: #006600;">stageHeight</span> <span style="color: #66cc66;">&#41;</span>;
			_overlaySprite.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">endFill</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			addChild<span style="color: #66cc66;">&#40;</span> _overlaySprite <span style="color: #66cc66;">&#41;</span>;
			_overlaySprite.<span style="color: #0066CC;">visible</span> = <span style="color: #000000; font-weight: bold;">false</span>;
&nbsp;
			_userInterface				= <span style="color: #000000; font-weight: bold;">new</span> UserInterface<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			_userInterface.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span> Event.<span style="color: #006600;">SELECT</span>, uploadImage <span style="color: #66cc66;">&#41;</span>;
			addChild<span style="color: #66cc66;">&#40;</span> _userInterface <span style="color: #66cc66;">&#41;</span>;
			_userInterface.<span style="color: #0066CC;">visible</span> = <span style="color: #000000; font-weight: bold;">false</span>;
			login<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> login<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			_fbSession					= <span style="color: #000000; font-weight: bold;">new</span> FacebookSessionUtil<span style="color: #66cc66;">&#40;</span> API_KEY, SECRET, loaderInfo <span style="color: #66cc66;">&#41;</span>;
			_fb							= _fbSession.<span style="color: #006600;">facebook</span>;
&nbsp;
			_fbSession.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span> FacebookEvent.<span style="color: #0066CC;">CONNECT</span>, connectHandle <span style="color: #66cc66;">&#41;</span>;
			_fbSession.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span> FacebookEvent.<span style="color: #006600;">WAITING_FOR_LOGIN</span>, loginWaitHandler <span style="color: #66cc66;">&#41;</span>;
&nbsp;
			_fbSession.<span style="color: #006600;">login</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> connectHandle<span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">e</span>:FacebookEvent <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
&nbsp;
			<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">e</span>.<span style="color: #006600;">success</span> <span style="color: #66cc66;">&#41;</span>
			<span style="color: #66cc66;">&#123;</span>
				_uid 					= <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">data</span> as GetSessionData <span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">uid</span>;
&nbsp;
				_batchCollection		= <span style="color: #000000; font-weight: bold;">new</span> BatchCollection<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
				_batchCollection.<span style="color: #006600;">addItem</span><span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">new</span> HasAppPermission<span style="color: #66cc66;">&#40;</span> HasAppPermissionValues.<span style="color: #006600;">PHOTO_UPLOAD</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;
				_batchCollection.<span style="color: #006600;">addItem</span><span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">new</span> GetInfo<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span>_uid<span style="color: #66cc66;">&#93;</span>, <span style="color: #66cc66;">&#91;</span>GetInfoFieldValues.<span style="color: #006600;">FIRST_NAME</span>, GetInfoFieldValues.<span style="color: #006600;">CURRENT_LOCATION</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
				_batchCollection.<span style="color: #006600;">addItem</span><span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">new</span> GetAlbums<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;
&nbsp;
				_batchRun				= _fb.<span style="color: #006600;">post</span><span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">new</span> BatchRun<span style="color: #66cc66;">&#40;</span> _batchCollection <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span> as BatchRun;
				_batchRun.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span> FacebookEvent.<span style="color: #006600;">COMPLETE</span>, batchCompleteHandler <span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> batchCompleteHandler<span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">e</span>:FacebookEvent <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">e</span>.<span style="color: #006600;">success</span> <span style="color: #66cc66;">&#41;</span>
			<span style="color: #66cc66;">&#123;</span>
				<span style="color: #000000; font-weight: bold;">var</span> results:<span style="color: #0066CC;">Array</span> = <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">data</span> as BatchResult <span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">results</span>;
&nbsp;
				<span style="color: #000000; font-weight: bold;">var</span> hasPermission:BooleanResultData = results<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span>;
				<span style="color: #000000; font-weight: bold;">var</span> getInfoResult:GetInfoData = results<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#93;</span>;
				<span style="color: #000000; font-weight: bold;">var</span> getAlbumsResult:GetAlbumsData = results<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#93;</span>;
&nbsp;
				<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">!</span>hasPermission.<span style="color: #006600;">value</span> <span style="color: #66cc66;">&#41;</span>
				<span style="color: #66cc66;">&#123;</span>
					MonsterDebugger.<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>, <span style="color: #ff0000;">&quot;no permission&quot;</span> <span style="color: #66cc66;">&#41;</span>;
					getPermissions<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
				<span style="color: #66cc66;">&#125;</span>
&nbsp;
					<span style="color: #808080; font-style: italic;">/*_userData = getInfoResult.userCollection.getItemAt(0) as FacebookUser;
					_userInterface.username = _userData.first_name + _userData.last_name;
					_userInterface.albumList = getAlbumsResult.albumCollection.toArray();*/</span>
&nbsp;
			<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> getPermissions<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			_fb.<span style="color: #006600;">grantExtendedPermission</span><span style="color: #66cc66;">&#40;</span> ExtendedPermissionValues.<span style="color: #006600;">PHOTO_UPLOAD</span> <span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> uploadImage<span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">e</span>:Event <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			_uploadPhoto = <span style="color: #000000; font-weight: bold;">new</span> UploadPhoto<span style="color: #66cc66;">&#40;</span>_userInterface.<span style="color: #006600;">snapshot</span><span style="color: #66cc66;">&#41;</span>;
			_fb.<span style="color: #006600;">post</span><span style="color: #66cc66;">&#40;</span>_uploadPhoto<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> loginWaitHandler<span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">e</span>:FacebookEvent <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			_overlaySprite.<span style="color: #0066CC;">visible</span> = <span style="color: #000000; font-weight: bold;">true</span>;
			_overlaySprite.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span> MouseEvent.<span style="color: #006600;">CLICK</span>, confirmConnect <span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> confirmConnect<span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">e</span>:MouseEvent <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			_overlaySprite.<span style="color: #0066CC;">visible</span> = <span style="color: #000000; font-weight: bold;">false</span>;
			_userInterface.<span style="color: #0066CC;">visible</span> = <span style="color: #000000; font-weight: bold;">true</span>;
			_overlaySprite.<span style="color: #006600;">removeEventListener</span><span style="color: #66cc66;">&#40;</span> MouseEvent.<span style="color: #006600;">CLICK</span>, confirmConnect <span style="color: #66cc66;">&#41;</span>;
			_fbSession.<span style="color: #006600;">validateLogin</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Let&#8217;s take a look at what&#8217;s happening here, first of all we create instances of the facebook and the facebooksessionutil classes, those are going to help using Facebook throughout the whole application.<br />
We setup an overlaysprite (this could also be a simple button or an alert panel) that will let us know when the user came back from the facebook login page. When the overlaysprite is clicked we validate the login and enable our userinterface. When the user is connected successfully to the application we start our BatchCollection to make multiple calls to FB, We check if the user has allowed permission to upload pictures, get his basic information like id, name and so on, and also get the album list from his profile<em> (currently not working due to API bug)</em><br />
When the batch is completed we assign the result to various variables and check the status of the extended permission if this is false, then we ask the user to confirm the permission so we are able to upload pictures, the getPermission() method.<br />
After that we are ready to move on to our interface.</p>
<p>In this example I&#8217;m not going to create a seamless experience with Facebook that you know from other applications mostly on Mobile Phones, that involves a bunch of HTML and Javascript scripting and is covered on Jeanette Stallons Part 3: <a href="http://www.adobe.com/devnet/facebook/articles/first_flex_facebook_web_app_pt3.html" target="_blank">Deploy using Facebook Connect</a></p>
<p><strong>3. Interface</strong> (UserInterface.as)<br />
Next up we are going to create a simple interface so you can preview the webcam image and take a snapshot, we also going to create a small logger window so we get informed about what&#8217;s going on without having to switch to the deMonsterDebugger to view the status. Therefore I&#8217;m going to create a custom class named <strong>UserInterface</strong> which will have the visual assets and placeholders for the data received.</p>
<p>Below the Userinterface.as class:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> UserInterface <span style="color: #0066CC;">extends</span> Sprite
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _video			:<span style="color: #0066CC;">Video</span>;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _camera			:<span style="color: #0066CC;">Camera</span>;
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _bitmap			:Bitmap;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _bitmapData			:BitmapData;
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _snapshotBA			:ByteArray;
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _pushButton			:PushButton;
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _albumArray			:<span style="color: #0066CC;">Array</span>;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _albumList			:<span style="color: #0066CC;">List</span>;
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> UserInterface<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#123;</span>
			_camera				= <span style="color: #0066CC;">Camera</span>.<span style="color: #006600;">getCamera</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			_camera.<span style="color: #0066CC;">setMode</span><span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">640</span>, <span style="color: #cc66cc;">480</span>, <span style="color: #cc66cc;">25</span>, <span style="color: #000000; font-weight: bold;">true</span> <span style="color: #66cc66;">&#41;</span>;
			_video				= <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Video</span><span style="color: #66cc66;">&#40;</span> _camera.<span style="color: #0066CC;">width</span> <span style="color: #66cc66;">/</span> <span style="color: #cc66cc;">2</span>, _camera.<span style="color: #0066CC;">height</span> <span style="color: #66cc66;">/</span> <span style="color: #cc66cc;">2</span> <span style="color: #66cc66;">&#41;</span>;
			_video.<span style="color: #006600;">attachCamera</span><span style="color: #66cc66;">&#40;</span> _camera <span style="color: #66cc66;">&#41;</span>;
			addChild<span style="color: #66cc66;">&#40;</span> _video <span style="color: #66cc66;">&#41;</span>;
&nbsp;
			_pushButton				= <span style="color: #000000; font-weight: bold;">new</span> PushButton<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			_pushButton.<span style="color: #0066CC;">width</span>			= <span style="color: #cc66cc;">80</span>;
			_pushButton.<span style="color: #006600;">x</span>				= _video.<span style="color: #0066CC;">width</span> - _pushButton.<span style="color: #0066CC;">width</span>;
			_pushButton.<span style="color: #006600;">y</span>				= _video.<span style="color: #0066CC;">height</span> + <span style="color: #cc66cc;">5</span>;
			_pushButton.<span style="color: #006600;">label</span>			= <span style="color: #ff0000;">&quot;CAPTURE&quot;</span>;
			_pushButton.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span> MouseEvent.<span style="color: #006600;">CLICK</span>, createSnapshot <span style="color: #66cc66;">&#41;</span>;
			addChild<span style="color: #66cc66;">&#40;</span> _pushButton <span style="color: #66cc66;">&#41;</span>;
&nbsp;
			_bitmapData				= <span style="color: #000000; font-weight: bold;">new</span> BitmapData<span style="color: #66cc66;">&#40;</span> _camera.<span style="color: #0066CC;">width</span> <span style="color: #66cc66;">/</span> <span style="color: #cc66cc;">2</span>, _camera.<span style="color: #0066CC;">height</span> <span style="color: #66cc66;">/</span> <span style="color: #cc66cc;">2</span> <span style="color: #66cc66;">&#41;</span>;
			_bitmap					= <span style="color: #000000; font-weight: bold;">new</span> Bitmap<span style="color: #66cc66;">&#40;</span> _bitmapData <span style="color: #66cc66;">&#41;</span>;
&nbsp;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> createSnapshot<span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">e</span>:MouseEvent <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			_bitmapData.<span style="color: #006600;">draw</span><span style="color: #66cc66;">&#40;</span> _video <span style="color: #66cc66;">&#41;</span>;
			_video.<span style="color: #0066CC;">visible</span> = <span style="color: #000000; font-weight: bold;">false</span>;
			addChild<span style="color: #66cc66;">&#40;</span> _bitmap <span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #000000; font-weight: bold;">var</span> enc:JPGEncoder = <span style="color: #000000; font-weight: bold;">new</span> JPGEncoder<span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">80</span> <span style="color: #66cc66;">&#41;</span>;
			_snapshotBA = enc.<span style="color: #006600;">encode</span><span style="color: #66cc66;">&#40;</span> _bitmapData <span style="color: #66cc66;">&#41;</span>;
&nbsp;
			_pushButton.<span style="color: #006600;">removeEventListener</span><span style="color: #66cc66;">&#40;</span> MouseEvent.<span style="color: #006600;">CLICK</span>, createSnapshot <span style="color: #66cc66;">&#41;</span>;
			_pushButton.<span style="color: #006600;">label</span> = <span style="color: #ff0000;">&quot;UPLOAD IMAGE&quot;</span>;
			_pushButton.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span> MouseEvent.<span style="color: #006600;">CLICK</span>, sendSnapshot <span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> sendSnapshot<span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">e</span>:MouseEvent <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			dispatchEvent<span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">new</span> Event<span style="color: #66cc66;">&#40;</span> Event.<span style="color: #006600;">SELECT</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> createList<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			_albumList			= <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">List</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span>, _video.<span style="color: #006600;">x</span> + _video.<span style="color: #0066CC;">width</span> + <span style="color: #cc66cc;">20</span>, _video.<span style="color: #006600;">y</span>, _albumArray <span style="color: #66cc66;">&#41;</span>;
			addChild<span style="color: #66cc66;">&#40;</span> _albumList <span style="color: #66cc66;">&#41;</span>;
&nbsp;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">set</span> albumList<span style="color: #66cc66;">&#40;</span> arr:<span style="color: #0066CC;">Array</span> <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			_albumArray = arr;
			<span style="color: #808080; font-style: italic;">//MonsterDebugger.trace(this, _albumArray );</span>
			<span style="color: #808080; font-style: italic;">//createList();</span>
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> snapshot<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:ByteArray
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">return</span> _snapshotBA;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>As you see I&#8217;m creaing a Camera instance with the size of 640x480px and attaching it to a video class to be displayed on the stage at halfsize, you could also keep it the full size but I prefer working with the 320&#215;240 format.<br />
The Bitmap and BitmapData instances are created and create a getter to return the bytearray to our mainapplication.</p>
<p><strong>4. Using the Webcam</strong><br />
Let&#8217;s take a quicklook what we are doing to take a snapshot of the webcam and how to prepare the image to be uploaded to Facebook. As mentioned on my previous post we take a snapshot of the webcam by creating a bitmapdata of it, then we use the JPGEncoder classes from the AS3Corelib <em>(these are as well already inside the AS3Facebook Library)</em> and encode them into a ByteArray.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> createSnapshot<span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">e</span>:MouseEvent <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			_bitmapData.<span style="color: #006600;">draw</span><span style="color: #66cc66;">&#40;</span> _video <span style="color: #66cc66;">&#41;</span>;
			_video.<span style="color: #0066CC;">visible</span> = <span style="color: #000000; font-weight: bold;">false</span>;
			addChild<span style="color: #66cc66;">&#40;</span> _bitmap <span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #000000; font-weight: bold;">var</span> enc:JPGEncoder = <span style="color: #000000; font-weight: bold;">new</span> JPGEncoder<span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">80</span> <span style="color: #66cc66;">&#41;</span>;
			_snapshotBA = enc.<span style="color: #006600;">encode</span><span style="color: #66cc66;">&#40;</span> _bitmapData <span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p><strong>5. Choosing Album and uploading Picture</strong><br />
As mentioned before there is currently a bug with the AS3Facebook API 3.4, you cannot get the Albumlist from the logged in user, even if you give the application the proper extended permissions. So in our case we are just going to upload our photos to the default album, now you&#8217;re asking what&#8217;s the default album?</p>
<p>It&#8217;s not very clear to me as well, but basically Facebook creates a Photoalbum for every application that uploads an image to it, let&#8217;s say your application is called &#8220;APU&#8221; the user using the application will get a APU PhotoGallery folder in his profile. So choose wisely what name your application will have.</p>
<p>Below the upload code:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> uploadImage<span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">e</span>:Event <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			_uploadPhoto = <span style="color: #000000; font-weight: bold;">new</span> UploadPhoto<span style="color: #66cc66;">&#40;</span>_userInterface.<span style="color: #006600;">snapshot</span><span style="color: #66cc66;">&#41;</span>;
			_fb.<span style="color: #006600;">post</span><span style="color: #66cc66;">&#40;</span>_uploadPhoto<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>That&#8217;s it, the most difficult part developing applications using Facebook is barely the way the whole data communication works, the API is very stable and things work well ( let&#8217;s forget the GetAlbum bug ).<br />
Most tutorials out there have been written for Flex or AIR, simply because it gives you the best userinterface to handle FB needs nevertheless I prefer using pure AS3.</p>
<p>This time I didn&#8217;t want to create a nice interface to use it, as this is solely a programming article, feel free to modify it, download it, share it, whatever you would like to do with it.</p>
<p>You can download the project here: <a href="http://blog.six4rty.ch/wp-content/uploads/2010/07/Facebook-AS3.zip">Source  (Flash Builder Project)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.six4rty.ch/2010/07/17/as3-facebook-uploading-webcam-photos/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/2.5/ch/</creativeCommons:license>
	</item>
		<item>
		<title>OSMF &#8211; SpriteElement</title>
		<link>http://blog.six4rty.ch/2010/06/15/osmf-interactivespriteelement/</link>
		<comments>http://blog.six4rty.ch/2010/06/15/osmf-interactivespriteelement/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 20:54:02 +0000</pubDate>
		<dc:creator>Tiago</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[OSMF]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[AS3.0]]></category>

		<guid isPermaLink="false">http://blog.six4rty.ch/?p=668</guid>
		<description><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:550px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=Tiago%26%23039%3Bs+Weblog&link=http%253A%252F%252Fblog.six4rty.ch%252F2010%252F06%252F15%252Fosmf-interactivespriteelement%252F&title=OSMF+-+SpriteElement&desc=%0D%0A%0D%0AThe+Open+Source+Media+Framework+went+live+a+few+weeks+ago+with+it%27s+first+release+1.0%2C+I+already+worked+with+various+sprint+versions+of+it%2C+and+lately+created+a+final+project+using+OSMF.%0D%0A%0D%0ASometh&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=1&fbsctr=1&fbslang=en&fbsendbutton=1&twbutton=1&twlang=en&twmention=six4rty&twrelated1=&twrelated2=&twctr=1&lnkdshow=show&lnkdctr=1&buzzbutton=1&buzzlang=en&buzzctr=0&diggbutton=1&diggctr=0&stblbutton=1&stblctr=0&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div>The Open Source Media Framework went live a few weeks ago with it&#8217;s first release 1.0, I already worked with various sprint versions of it, and lately created a final project using OSMF. Something that I was missing was the capability of displaying a Sprite or Text Element inside a Serial- or Parallel-Element. So I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:550px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=Tiago%26%23039%3Bs+Weblog&link=http%253A%252F%252Fblog.six4rty.ch%252F2010%252F06%252F15%252Fosmf-interactivespriteelement%252F&title=OSMF+-+SpriteElement&desc=%0D%0A%0D%0AThe+Open+Source+Media+Framework+went+live+a+few+weeks+ago+with+it%27s+first+release+1.0%2C+I+already+worked+with+various+sprint+versions+of+it%2C+and+lately+created+a+final+project+using+OSMF.%0D%0A%0D%0ASometh&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=1&fbsctr=1&fbslang=en&fbsendbutton=1&twbutton=1&twlang=en&twmention=six4rty&twrelated1=&twrelated2=&twctr=1&lnkdshow=show&lnkdctr=1&buzzbutton=1&buzzlang=en&buzzctr=0&diggbutton=1&diggctr=0&stblbutton=1&stblctr=0&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div><p><a href="http://blog.six4rty.ch/wp-content/uploads/2010/05/osmfLogo.jpg"><img class="alignnone size-full wp-image-660" title="osmfLogo" src="http://blog.six4rty.ch/wp-content/uploads/2010/05/osmfLogo.jpg" alt="" width="253" height="64" /></a></p>
<p>The Open Source Media Framework went live a few weeks ago with it&#8217;s first release 1.0, I already worked with various sprint versions of it, and lately created a final project using OSMF.</p>
<p>Something that I was missing was the capability of displaying a Sprite or Text Element inside a Serial- or Parallel-Element.<br />
So I&#8217;ve wrote a simple class named &#8220;<strong>InteractiveDisplayObjectElementt</strong>&#8221; that will handle this need:<span id="more-668"></span></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> InteractiveDisplayElement <span style="color: #0066CC;">extends</span> MediaElement
<span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> displayObjectTrait:InteractiveDisplayObjectTrait;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _sprite:Sprite;
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> InteractiveDisplayElement<span style="color: #66cc66;">&#40;</span> displayObject:Sprite=<span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
   <span style="color: #0066CC;">super</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
   <span style="color: #0066CC;">this</span>.<span style="color: #006600;">sprite</span> = displayObject;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">set</span> sprite<span style="color: #66cc66;">&#40;</span> value:Sprite <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
   _sprite = value;
    updateSprite<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> sprite<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Sprite
<span style="color: #66cc66;">&#123;</span>
    <span style="color: #b1b100;">return</span> _sprite;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> updateSprite<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">var</span> sprite:Sprite = <span style="color: #000000; font-weight: bold;">new</span> Sprite<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
   sprite.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span> _sprite <span style="color: #66cc66;">&#41;</span>;
&nbsp;
   <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> displayObjectTrait == <span style="color: #000000; font-weight: bold;">null</span> <span style="color: #66cc66;">&#41;</span>
   <span style="color: #66cc66;">&#123;</span>
      displayObjectTrait = <span style="color: #000000; font-weight: bold;">new</span> InteractiveDisplayObjectTrait<span style="color: #66cc66;">&#40;</span> sprite <span style="color: #66cc66;">&#41;</span>;
      addTrait<span style="color: #66cc66;">&#40;</span> MediaTraitType.<span style="color: #006600;">DISPLAY_OBJECT</span>, displayObjectTrait <span style="color: #66cc66;">&#41;</span>;
   <span style="color: #66cc66;">&#125;</span>
   displayObjectTrait.<span style="color: #006600;">setSize</span><span style="color: #66cc66;">&#40;</span> sprite.<span style="color: #0066CC;">width</span>, sprite.<span style="color: #0066CC;">height</span> <span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p><!--more--><br />
Extending the MediaElement class enables you to create a visible displayelement that can be attached to any kind of OSMF container including the serial &amp; parallel elements, this is aswell the class being used for all kind of non-loadable elements.<br />
So basically we are passing a Sprite to our new element to be placed in it, as soon as it&#8217;s set we call up the updateSprite() method that will add the passed sprite to the displaylist and assign it to the InteractiveDisplayObjectTrait <em>(class following below)</em></p>
<p>The second class built was the <strong>InteractiveDisplayObjectTrait</strong>, this was only to keep the structure and logic of OSMF kind of in &#8220;place&#8221;, with it you can set the size of the element separately.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">internal <span style="color: #000000; font-weight: bold;">class</span> InteractiveDisplayObjectTrait <span style="color: #0066CC;">extends</span> DisplayObjectTrait
<span style="color: #66cc66;">&#123;</span>
  <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> InteractiveDisplayObjectTrait<span style="color: #66cc66;">&#40;</span>displayObject:DisplayObject, mediaWidth:<span style="color: #0066CC;">Number</span>=<span style="color: #cc66cc;">0</span>, mediaHeight:<span style="color: #0066CC;">Number</span>=<span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#123;</span>
    <span style="color: #0066CC;">super</span><span style="color: #66cc66;">&#40;</span>displayObject, mediaWidth, mediaHeight<span style="color: #66cc66;">&#41;</span>;
  <span style="color: #66cc66;">&#125;</span>
&nbsp;
  <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> setSize<span style="color: #66cc66;">&#40;</span>mediaWidth:<span style="color: #0066CC;">Number</span>, mediaHeight:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
  <span style="color: #66cc66;">&#123;</span>
     setMediaSize<span style="color: #66cc66;">&#40;</span>mediaWidth, mediaHeight<span style="color: #66cc66;">&#41;</span>;
  <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>With it you are now able to use simple as well complex sprites in your Composition elements, below an example of how I tested the newly built class.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">...
<span style="color: #000000; font-weight: bold;">var</span> aniHolder:Sprite = <span style="color: #000000; font-weight: bold;">new</span> Sprite<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
sp.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span> aniHolder <span style="color: #66cc66;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">var</span> ball:Sprite = <span style="color: #000000; font-weight: bold;">new</span> Sprite<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
ball.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">beginFill</span><span style="color: #66cc66;">&#40;</span>0xff0000,<span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#41;</span>;
ball.<span style="color: #006600;">graphics</span>.<span style="color: #006600;">drawCircle</span><span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">8</span> <span style="color: #66cc66;">&#41;</span>;
ball.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">endFill</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
aniHolder.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span> ball <span style="color: #66cc66;">&#41;</span>;
&nbsp;
TweenMax.<span style="color: #006600;">to</span><span style="color: #66cc66;">&#40;</span> ball, <span style="color: #cc66cc;">2</span>, <span style="color: #66cc66;">&#123;</span> x: <span style="color: #cc66cc;">400</span>, repeat:-<span style="color: #cc66cc;">1</span>, yoyo:<span style="color: #000000; font-weight: bold;">true</span>, ease:com.<span style="color: #006600;">greensock</span>.<span style="color: #006600;">easing</span>.<span style="color: #006600;">Bounce</span>.<span style="color: #006600;">easeInOut</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> _spriteElement2:InteractiveDisplayElement = <span style="color: #000000; font-weight: bold;">new</span> InteractiveDisplayElement<span style="color: #66cc66;">&#40;</span> aniHolder <span style="color: #66cc66;">&#41;</span>;
layout							= <span style="color: #000000; font-weight: bold;">new</span> LayoutMetadata<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
layout.<span style="color: #0066CC;">left</span> = <span style="color: #cc66cc;">400</span>;
_spriteElement2.<span style="color: #006600;">addMetadata</span><span style="color: #66cc66;">&#40;</span> LayoutMetadata.<span style="color: #006600;">LAYOUT_NAMESPACE</span>, layout <span style="color: #66cc66;">&#41;</span>;
_pararellElement.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span> _spriteElement2 <span style="color: #66cc66;">&#41;</span>;
...</pre></div></div>

<p>What do you need to know about the code above? Well as you see I&#8217;m only creating a red circle that is being added to the aniHolder sprite, with the help of tweenmax I&#8217;m animating the circle to bounce left to right and viceversa, then I create a new InteractiveDisplayElement (the class we created before) assign a layout to it and add to the ParallelElement (this could also be a serialelement or a simple mediacontainerSprite).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.six4rty.ch/2010/06/15/osmf-interactivespriteelement/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/2.5/ch/</creativeCommons:license>
	</item>
		<item>
		<title>Adobe Developer Week</title>
		<link>http://blog.six4rty.ch/2010/04/12/adobe-developer-week/</link>
		<comments>http://blog.six4rty.ch/2010/04/12/adobe-developer-week/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 08:56:02 +0000</pubDate>
		<dc:creator>Tiago</dc:creator>
				<category><![CDATA[Adobe]]></category>
		<category><![CDATA[CS5]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.six4rty.ch/?p=645</guid>
		<description><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:550px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=Tiago%26%23039%3Bs+Weblog&link=http%253A%252F%252Fblog.six4rty.ch%252F2010%252F04%252F12%252Fadobe-developer-week%252F&title=Adobe+Developer+Week&desc=%0D%0A%0D%0ADuring+Developer+Week%2C+learn+about+the+Adobe%C2%AE+Flash%C2%AE+Platform%2C+including+Adobe%C2%AE+Flex%C2%AE%2C+Adobe%C2%AE+Flash%C2%AE+Builder%E2%84%A2%2C+Adobe%C2%AE+AIR%C2%AE%2C+Adobe%C2%AE+Flash%C2%AE+Player%2C+and+how+it+integrates+with+Adobe%C2%AE+Cre&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=1&fbsctr=1&fbslang=en&fbsendbutton=1&twbutton=1&twlang=en&twmention=six4rty&twrelated1=&twrelated2=&twctr=1&lnkdshow=show&lnkdctr=1&buzzbutton=1&buzzlang=en&buzzctr=0&diggbutton=1&diggctr=0&stblbutton=1&stblctr=0&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div>During Developer Week, learn about the Adobe® Flash® Platform, including Adobe® Flex®, Adobe® Flash® Builder™, Adobe® AIR®, Adobe® Flash® Player, and how it integrates with Adobe® Creative Suite® 5 technologies. This weeklong event features free, live webinars presented by Adobe technology experts. See live demos and have your questions answered by the experts during interactive [...]]]></description>
			<content:encoded><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:550px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=Tiago%26%23039%3Bs+Weblog&link=http%253A%252F%252Fblog.six4rty.ch%252F2010%252F04%252F12%252Fadobe-developer-week%252F&title=Adobe+Developer+Week&desc=%0D%0A%0D%0ADuring+Developer+Week%2C+learn+about+the+Adobe%C2%AE+Flash%C2%AE+Platform%2C+including+Adobe%C2%AE+Flex%C2%AE%2C+Adobe%C2%AE+Flash%C2%AE+Builder%E2%84%A2%2C+Adobe%C2%AE+AIR%C2%AE%2C+Adobe%C2%AE+Flash%C2%AE+Player%2C+and+how+it+integrates+with+Adobe%C2%AE+Cre&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=1&fbsctr=1&fbslang=en&fbsendbutton=1&twbutton=1&twlang=en&twmention=six4rty&twrelated1=&twrelated2=&twctr=1&lnkdshow=show&lnkdctr=1&buzzbutton=1&buzzlang=en&buzzctr=0&diggbutton=1&diggctr=0&stblbutton=1&stblctr=0&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div><p><a href="http://blog.six4rty.ch/wp-content/uploads/2010/04/DeveloperWeek_Photobanner.jpg"><img class="alignnone size-medium wp-image-646" title="DeveloperWeek_Photobanner" src="http://blog.six4rty.ch/wp-content/uploads/2010/04/DeveloperWeek_Photobanner-300x123.jpg" alt="" width="300" height="123" /></a></p>
<p>During Developer Week, learn about the Adobe® Flash® Platform, including Adobe® Flex®, Adobe® Flash® Builder™, Adobe® AIR®, Adobe® Flash® Player, and how it integrates with Adobe® Creative Suite® 5 technologies. This weeklong event features free, live webinars presented by Adobe technology experts. See live demos and have your questions answered by the experts during interactive Q&amp;A sessions.</p>
<p>Want to attend? Nothing easier then that! Just jump over directly here:<br />
<a href="http://www.adobe.com/cfusion/event/index.cfm?event=detail&amp;id=1489921&amp;loc=en_us" target="_blank">http://www.adobe.com/cfusion/event/index.cfm?event=detail&amp;id=1489921&amp;loc=en_us</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.six4rty.ch/2010/04/12/adobe-developer-week/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/2.5/ch/</creativeCommons:license>
	</item>
		<item>
		<title>AS3: quick hint &#8211; Converting int to date</title>
		<link>http://blog.six4rty.ch/2009/04/27/as3-quick-hint-converting-int-to-date/</link>
		<comments>http://blog.six4rty.ch/2009/04/27/as3-quick-hint-converting-int-to-date/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 14:21:41 +0000</pubDate>
		<dc:creator>Tiago</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[AS 3.0]]></category>

		<guid isPermaLink="false">http://blog.six4rty.ch/?p=557</guid>
		<description><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:550px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=Tiago%26%23039%3Bs+Weblog&link=http%253A%252F%252Fblog.six4rty.ch%252F2009%252F04%252F27%252Fas3-quick-hint-converting-int-to-date%252F&title=AS3%3A+quick+hint+-+Converting+int+to+date&desc=Ok%2C+this+just+drove+me+nuts+for+a+few+minutes..%0D%0A%0D%0AI%27m+getting+the+server+time+UNIX+formatted%2C+I+was+constantly+trying+to+convert+the+integer+to+a+readable+date%2C+constantly+getting+the+wrong+year+%28the&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=1&fbsctr=1&fbslang=en&fbsendbutton=1&twbutton=1&twlang=en&twmention=six4rty&twrelated1=&twrelated2=&twctr=1&lnkdshow=show&lnkdctr=1&buzzbutton=1&buzzlang=en&buzzctr=0&diggbutton=1&diggctr=0&stblbutton=1&stblctr=0&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div>Ok, this just drove me nuts for a few minutes.. I&#8217;m getting the server time UNIX formatted, I was constantly trying to convert the integer to a readable date, constantly getting the wrong year (the default or zero unix year is 1970) but aren&#8217;t we living in 2009? So for future reference and for anyone [...]]]></description>
			<content:encoded><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:550px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=Tiago%26%23039%3Bs+Weblog&link=http%253A%252F%252Fblog.six4rty.ch%252F2009%252F04%252F27%252Fas3-quick-hint-converting-int-to-date%252F&title=AS3%3A+quick+hint+-+Converting+int+to+date&desc=Ok%2C+this+just+drove+me+nuts+for+a+few+minutes..%0D%0A%0D%0AI%27m+getting+the+server+time+UNIX+formatted%2C+I+was+constantly+trying+to+convert+the+integer+to+a+readable+date%2C+constantly+getting+the+wrong+year+%28the&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=1&fbsctr=1&fbslang=en&fbsendbutton=1&twbutton=1&twlang=en&twmention=six4rty&twrelated1=&twrelated2=&twctr=1&lnkdshow=show&lnkdctr=1&buzzbutton=1&buzzlang=en&buzzctr=0&diggbutton=1&diggctr=0&stblbutton=1&stblctr=0&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div><p>Ok, this just drove me nuts for a few minutes..</p>
<p>I&#8217;m getting the server time UNIX formatted, I was constantly trying to convert the integer to a readable date, constantly getting the wrong year (the default or zero unix year is 1970) but aren&#8217;t we living in 2009?</p>
<p>So for future reference and for anyone that might be searching for this.</p>
<p>Unix time is seconds based, Flash time is milliseconds based. got it?<br />
So anytime you get a unix time integer you just need to multiply by 1000 to get the correct time for your Flash project.</p>
<p>Example:</p>
<p><strong>GOOD CODE</strong></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">curDate                = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Date</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#40;</span>dateXML.<span style="color: #0066CC;">int</span> <span style="color: #66cc66;">*</span> <span style="color: #cc66cc;">1000</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p><strong>BAD CODE</strong></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">curDate                = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Date</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#40;</span>dateXML.<span style="color: #0066CC;">int</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.six4rty.ch/2009/04/27/as3-quick-hint-converting-int-to-date/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/2.5/ch/</creativeCommons:license>
	</item>
		<item>
		<title>Flex in a week</title>
		<link>http://blog.six4rty.ch/2008/11/10/flex-in-a-week/</link>
		<comments>http://blog.six4rty.ch/2008/11/10/flex-in-a-week/#comments</comments>
		<pubDate>Mon, 10 Nov 2008 18:47:33 +0000</pubDate>
		<dc:creator>Tiago</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[AS3.0]]></category>

		<guid isPermaLink="false">http://blog.six4rty.ch/?p=480</guid>
		<description><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:550px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=Tiago%26%23039%3Bs+Weblog&link=http%253A%252F%252Fblog.six4rty.ch%252F2008%252F11%252F10%252Fflex-in-a-week%252F&title=Flex+in+a+week&desc=I+just+stumbled+across+this+page%2C+and+I+think+it%27s+a+very+good+starting+position+for+people+who+would+like+to+learn+Flex+or+strengthen+their+knowledge%2C+all+you+need+is+a+working+version+of+AMP+and+thi&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=1&fbsctr=1&fbslang=en&fbsendbutton=1&twbutton=1&twlang=en&twmention=six4rty&twrelated1=&twrelated2=&twctr=1&lnkdshow=show&lnkdctr=1&buzzbutton=1&buzzlang=en&buzzctr=0&diggbutton=1&diggctr=0&stblbutton=1&stblctr=0&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div>I just stumbled across this page, and I think it&#8217;s a very good starting position for people who would like to learn Flex or strengthen their knowledge, all you need is a working version of AMP and this link to include into the RSS feed of AMP. http://sessions.adobe.com/FlexInAWeek/feed.xml For a more detailed list of available [...]]]></description>
			<content:encoded><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:550px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=Tiago%26%23039%3Bs+Weblog&link=http%253A%252F%252Fblog.six4rty.ch%252F2008%252F11%252F10%252Fflex-in-a-week%252F&title=Flex+in+a+week&desc=I+just+stumbled+across+this+page%2C+and+I+think+it%27s+a+very+good+starting+position+for+people+who+would+like+to+learn+Flex+or+strengthen+their+knowledge%2C+all+you+need+is+a+working+version+of+AMP+and+thi&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=1&fbsctr=1&fbslang=en&fbsendbutton=1&twbutton=1&twlang=en&twmention=six4rty&twrelated1=&twrelated2=&twctr=1&lnkdshow=show&lnkdctr=1&buzzbutton=1&buzzlang=en&buzzctr=0&diggbutton=1&diggctr=0&stblbutton=1&stblctr=0&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div><p>I just stumbled across this page, and I think it&#8217;s a very good starting position for people who would like to learn Flex or strengthen their knowledge, all you need is a working version of AMP and this link to include into the RSS feed of AMP.<br />
<a href="http://sessions.adobe.com/FlexInAWeek/feed.xml" target="_blank">http://sessions.adobe.com/FlexInAWeek/feed.xml</a></p>
<p>For a more detailed list of available videos and more check out this site:<br />
<a href="http://www.adobe.com/devnet/flex/videotraining/?sdid=DXGFC" target="_blank">http://www.adobe.com/devnet/flex/videotraining/?sdid=DXGFC</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.six4rty.ch/2008/11/10/flex-in-a-week/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/2.5/ch/</creativeCommons:license>
	</item>
	</channel>
</rss>

