<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Xavi Colomer&#039;s Blog &#187; Flex 4</title>
	<atom:link href="http://blog.ncatstudios.com/category/flex-4/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ncatstudios.com</link>
	<description>Web technologies and Interactivity ramblings</description>
	<lastBuildDate>Mon, 30 May 2011 14:01:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>New Tool: Flex PMD</title>
		<link>http://blog.ncatstudios.com/2009/09/18/new-tool-flex-pmd/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rss</link>
		<comments>http://blog.ncatstudios.com/2009/09/18/new-tool-flex-pmd/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 20:46:00 +0000</pubDate>
		<dc:creator>Xavi Colomer</dc:creator>
				<category><![CDATA[Flex 3]]></category>
		<category><![CDATA[Flex 4]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Optimization]]></category>

		<guid isPermaLink="false">http://blog.ncatstudios.com/?p=110&#038;language=en</guid>
		<description><![CDATA[
			
				
			
		
If you are aware of the news on the Adobe labs you may know about a new tool called Flex PMD. This tool will help you improving the quality of our code and at the same time you&#8217;ll learn about &#8220;best practices&#8221; developing with Flex. This tool studies the code of an application and generates [...]


Related posts:<ol><li><a href='http://blog.ncatstudios.com/2009/05/18/flex-swf-optimization-i/' rel='bookmark' title='Permanent Link: Flex swf optimization ( I )'>Flex swf optimization ( I )</a></li>
<li><a href='http://blog.ncatstudios.com/2009/10/11/tools-every-flex-developer-should-know-my-top-10/' rel='bookmark' title='Permanent Link: Tools every flex developer should know ( My TOP 10 )'>Tools every flex developer should know ( My TOP 10 )</a></li>
<li><a href='http://blog.ncatstudios.com/2009/05/21/compile-css-to-swf-memory-bottleneck/' rel='bookmark' title='Permanent Link: Compile CSS to SWF memory bottleneck'>Compile CSS to SWF memory bottleneck</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.ncatstudios.com%2F2009%2F09%2F18%2Fnew-tool-flex-pmd%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>If you are aware of the news on the Adobe labs you may know about a new tool called <a href="http://opensource.adobe.com/wiki/display/flexpmd/FlexPMD">Flex PMD</a>. This tool will help you improving the quality of our code and at the same time you&#8217;ll learn about &#8220;best practices&#8221; developing with Flex. This tool studies the code of an application and generates a XML report which, for better understanding, you&#8217;ll see it on any Flex PMD report viewer. You&#8217;ll find a list of possible viewers on the FlexPMD webpage.</p>
<p>Inside the downloads site you can access to a violations <a href="http://opensource.adobe.com/svn/opensource/flexpmd/bin/flex-pmd-violations-viewer.html">viewer</a> made for the same labs. I just downloaded the swf for local use.</p>
<p>OSX setup ( once downloaded ):</p>
<p>To install FlexPMD on mac you can do it like this:</p>
<p>1- Working with the terminal, adding the downloaded library to the system path ( or executing it locally ), editing ./profile and following the instructions on the web ( this is How I do it and works pretty fine )</p>
<p>2- Using Automator ( I didn&#8217;t try it )</p>
<p>3- Using Ant ( I didn&#8217;t try it either )</p>
<div class="shr-publisher-110"></div>

<p>Related posts:<ol><li><a href='http://blog.ncatstudios.com/2009/05/18/flex-swf-optimization-i/' rel='bookmark' title='Permanent Link: Flex swf optimization ( I )'>Flex swf optimization ( I )</a></li>
<li><a href='http://blog.ncatstudios.com/2009/10/11/tools-every-flex-developer-should-know-my-top-10/' rel='bookmark' title='Permanent Link: Tools every flex developer should know ( My TOP 10 )'>Tools every flex developer should know ( My TOP 10 )</a></li>
<li><a href='http://blog.ncatstudios.com/2009/05/21/compile-css-to-swf-memory-bottleneck/' rel='bookmark' title='Permanent Link: Compile CSS to SWF memory bottleneck'>Compile CSS to SWF memory bottleneck</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.ncatstudios.com/2009/09/18/new-tool-flex-pmd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hiding the Secret API Key with Flex using Alchemy</title>
		<link>http://blog.ncatstudios.com/2009/08/21/hiding-the-secret-api-key-with-flex-but-where/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rss</link>
		<comments>http://blog.ncatstudios.com/2009/08/21/hiding-the-secret-api-key-with-flex-but-where/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 21:17:13 +0000</pubDate>
		<dc:creator>Xavi Colomer</dc:creator>
				<category><![CDATA[Alchemy]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Flex 3]]></category>
		<category><![CDATA[Flex 4]]></category>
		<category><![CDATA[Optimization]]></category>

		<guid isPermaLink="false">http://blog.ncatstudios.com/?p=97&#038;language=en</guid>
		<description><![CDATA[
			
				
			
		
*little decompilation challenge
Today I was trying to develop my first Flex-Facebook Application, just for fun. To achieve a connection between facebook and Flex you need a couple of keys, the application key and the Secret API key. The second one it&#8217;s very important and anyone shouldn&#8217;t know about it. The thing is that this keys [...]


Related posts:<ol><li><a href='http://blog.ncatstudios.com/2009/09/18/new-tool-flex-pmd/' rel='bookmark' title='Permanent Link: New Tool: Flex PMD'>New Tool: Flex PMD</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.ncatstudios.com%2F2009%2F08%2F21%2Fhiding-the-secret-api-key-with-flex-but-where%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>*little decompilation challenge</p>
<div>Today I was trying to develop my first Flex-Facebook Application, just for fun. To achieve a connection between facebook and Flex you need a couple of keys, the application key and the Secret API key. The second one it&#8217;s very important and anyone shouldn&#8217;t know about it. The thing is that this keys must be embeded on the code ( If you don&#8217;t want to use PHP tokens, or similar stuff )</div>
<div>I didn&#8217;t like that so I tried another solution, using Alchemy to hide the secret Key a little more, and maybe make the decompilation harder. The problem is that now I tried to decompile the SWF and I can&#8217;t find it anywhere, althought I know it hasn&#8217;t disappeared, I&#8217;d like to know where it is!</div>
<div>Anyone can help me?</div>
<p><object id="Flex_Alchemy" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="386" height="113" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="quality" value="high" /><param name="bgcolor" value="#FFFFFF" /><param name="src" value="http://blog.ncatstudios.com/public/Flex_Alchemy.swf" /><param name="name" value="Flex_Alchemy" /><embed id="Flex_Alchemy" type="application/x-shockwave-flash" width="386" height="113" src="http://blog.ncatstudios.com/public/Flex_Alchemy.swf" name="Flex_Alchemy" bgcolor="#FFFFFF" quality="high"></embed></object></p>
<p><strong><a href="http://blog.ncatstudios.com/public/Flex_Alchemy.swf">SWF file</a></strong></p>
<div class="shr-publisher-97"></div>

<p>Related posts:<ol><li><a href='http://blog.ncatstudios.com/2009/09/18/new-tool-flex-pmd/' rel='bookmark' title='Permanent Link: New Tool: Flex PMD'>New Tool: Flex PMD</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.ncatstudios.com/2009/08/21/hiding-the-secret-api-key-with-flex-but-where/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Centering objects in Spark ( Flex 4 )</title>
		<link>http://blog.ncatstudios.com/2009/08/18/centering-objects-in-spark-flex-4/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rss</link>
		<comments>http://blog.ncatstudios.com/2009/08/18/centering-objects-in-spark-flex-4/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 21:14:23 +0000</pubDate>
		<dc:creator>Xavi Colomer</dc:creator>
				<category><![CDATA[Flex 3]]></category>
		<category><![CDATA[Flex 4]]></category>
		<category><![CDATA[Spark]]></category>

		<guid isPermaLink="false">http://blog.ncatstudios.com/?p=93&#038;language=en</guid>
		<description><![CDATA[
			
				
			
		
So you are desperate looking for that all snippet for centering things? I&#8217;ve been looking during hours until I found the solution
In Flex 3 you may use this to center elements on a container:

  width=&#8221;100%&#8221; height=&#8221;100%&#8220; horizontalAlign=&#8221;center&#8221; verticalAlign=&#8221;middle&#8220; &#62;
 
 
But with Spark things has changed and now you need to write a little more code
 [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.ncatstudios.com%2F2009%2F08%2F18%2Fcentering-objects-in-spark-flex-4%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>So you are desperate looking for that all snippet for centering things? I&#8217;ve been looking during hours until I found the solution</p>
<p>In Flex 3 you may use this to center elements on a container:</p>
<p><!--element here--></p>
<p><span style="font-family: Monaco, Verdana, sans-serif; font-size: 11px; "><span style="color: #0000ff"> </span> width=&#8221;<span style="color: #990000">100%</span>&#8221; height=&#8221;<span style="color: #990000">100%</span>&#8220; horizontalAlign=&#8221;<span style="color: #990000; ">center</span>&#8221; verticalAlign=&#8221;<span style="color: #990000; ">middle</span>&#8220; <span style="color: #0000ff; ">&gt;</span></span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; color: #0000ff"><span style="color: #000000"><span style="white-space:pre"> </span></span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; color: #0000ff"><span style="color: #000000"><span style="white-space:pre"> </span></span></p>
<p>But with Spark things has changed and now you need to write a little more code</p>
<p><span style="font-family: Monaco, Verdana, sans-serif; font-size: 11px; "><span style="color: #0000ff"> </span> width=&#8221;<span style="color: #990000">100%</span>&#8221; height=&#8221;<span style="color: #990000">100%</span>&#8220;<span style="color: #0000ff">&gt;</span></span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; color: #0000ff"><span style="color: #000000"><span style="white-space:pre"> </span></span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco"><span style="white-space:pre"> </span><span style="color: #0000ff"> </span> columnAlign=&#8221;<span style="color: #990000">justifyUsingWidth</span>&#8221; rowAlign=&#8221;<span style="color: #990000">justifyUsingHeight</span>&#8221; horizontalAlign=&#8221;<span style="color: #990000">center</span>&#8221; verticalAlign=&#8221;<span style="color: #990000">middle</span>&#8221; requestedColumnCount=&#8221;<span style="color: #990000">1</span>&#8221; requestedRowCount=&#8221;<span style="color: #990000">1</span>&#8221; <span style="color: #0000ff">/&gt;</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; color: #0000ff"><span style="color: #000000"><span style="white-space:pre"> </span></span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; color: #0000ff"><span style="color: #000000"><span style="white-space:pre"> </span></span><span style="color: #000000"> </span>/&gt;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; color: #0000ff"><span style="color: #000000"><span style="white-space:pre"> </span></span></p>
<p><!--element here--></p>
<p>I don&#8217;t know if this is the best way to do that, but is the only one I found so far&#8230;</p>
<p>I hope this snippet help you!!!!</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco">
<div class="shr-publisher-93"></div>

<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.ncatstudios.com/2009/08/18/centering-objects-in-spark-flex-4/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Compile CSS to SWF memory bottleneck</title>
		<link>http://blog.ncatstudios.com/2009/05/21/compile-css-to-swf-memory-bottleneck/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rss</link>
		<comments>http://blog.ncatstudios.com/2009/05/21/compile-css-to-swf-memory-bottleneck/#comments</comments>
		<pubDate>Thu, 21 May 2009 21:51:23 +0000</pubDate>
		<dc:creator>Xavi Colomer</dc:creator>
				<category><![CDATA[Flex 3]]></category>
		<category><![CDATA[Flex 4]]></category>
		<category><![CDATA[Optimization]]></category>

		<guid isPermaLink="false">http://blog.ncatstudios.com/?p=81&#038;language=en</guid>
		<description><![CDATA[
			
				
			
		
If you work with Flex and Skins you may use the option “Compile CSS to SWF”, this is a good solution but I recently found that as you add more resources to the CSS file, Eclipse may suffer a memory bottleneck while compiling it.
To solve that problem I just decided to compile the CSS directly [...]


Related posts:<ol><li><a href='http://blog.ncatstudios.com/2009/05/18/flex-swf-optimization-i/' rel='bookmark' title='Permanent Link: Flex swf optimization ( I )'>Flex swf optimization ( I )</a></li>
<li><a href='http://blog.ncatstudios.com/2009/09/18/new-tool-flex-pmd/' rel='bookmark' title='Permanent Link: New Tool: Flex PMD'>New Tool: Flex PMD</a></li>
<li><a href='http://blog.ncatstudios.com/2009/08/21/hiding-the-secret-api-key-with-flex-but-where/' rel='bookmark' title='Permanent Link: Hiding the Secret API Key with Flex using Alchemy'>Hiding the Secret API Key with Flex using Alchemy</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.ncatstudios.com%2F2009%2F05%2F21%2Fcompile-css-to-swf-memory-bottleneck%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>If you work with Flex and Skins you may use the option “Compile CSS to SWF”, this is a good solution but I recently found that as you add more resources to the CSS file, Eclipse may suffer a memory bottleneck while compiling it.<!--StartFragment--></p>
<p class="MsoNormal" style="text-align:justify">To solve that problem I just decided to compile the CSS directly with mxmlc, and disable “Compile CSS to SWF” option. This will recover the compiling time for the application and it shouldn’t crash again.</p>
<p class="MsoNormal" style="text-align:justify">The only thing you need to do that is to have mxmlc on the path and write this instruction on the shell / terminal:</p>
<p class="MsoNormal" style="text-align:justify"><strong>mxmlc [path/to/file]/file_name.css</strong></p>
<p class="MsoNormal" style="text-align:justify">This should generate a file_name.swf on the same folder.</p>
<p class="MsoNormal" style="text-align:justify">The only problem of this solution is to not forgot to compile the file every time you make some change!</p>
<p><!--EndFragment--></p>
<div class="shr-publisher-81"></div>

<p>Related posts:<ol><li><a href='http://blog.ncatstudios.com/2009/05/18/flex-swf-optimization-i/' rel='bookmark' title='Permanent Link: Flex swf optimization ( I )'>Flex swf optimization ( I )</a></li>
<li><a href='http://blog.ncatstudios.com/2009/09/18/new-tool-flex-pmd/' rel='bookmark' title='Permanent Link: New Tool: Flex PMD'>New Tool: Flex PMD</a></li>
<li><a href='http://blog.ncatstudios.com/2009/08/21/hiding-the-secret-api-key-with-flex-but-where/' rel='bookmark' title='Permanent Link: Hiding the Secret API Key with Flex using Alchemy'>Hiding the Secret API Key with Flex using Alchemy</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.ncatstudios.com/2009/05/21/compile-css-to-swf-memory-bottleneck/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex swf optimization ( I )</title>
		<link>http://blog.ncatstudios.com/2009/05/18/flex-swf-optimization-i/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rss</link>
		<comments>http://blog.ncatstudios.com/2009/05/18/flex-swf-optimization-i/#comments</comments>
		<pubDate>Mon, 18 May 2009 21:32:03 +0000</pubDate>
		<dc:creator>Xavi Colomer</dc:creator>
				<category><![CDATA[Flex 3]]></category>
		<category><![CDATA[Flex 4]]></category>
		<category><![CDATA[Optimization]]></category>

		<guid isPermaLink="false">http://blog.ncatstudios.com/?p=78&#038;language=en</guid>
		<description><![CDATA[
			
				
			
		

Update: I just found this 
 
air application for link report visualization 
If you are an experienced Flex user you’ll know many ways to reduce the size of your compiled code. Using Modules, RSL, etc… But there’s nothing else you can do?
The trick I will show you do not necessarily reduce the size of your [...]


Related posts:<ol><li><a href='http://blog.ncatstudios.com/2009/05/21/compile-css-to-swf-memory-bottleneck/' rel='bookmark' title='Permanent Link: Compile CSS to SWF memory bottleneck'>Compile CSS to SWF memory bottleneck</a></li>
<li><a href='http://blog.ncatstudios.com/2009/09/18/new-tool-flex-pmd/' rel='bookmark' title='Permanent Link: New Tool: Flex PMD'>New Tool: Flex PMD</a></li>
<li><a href='http://blog.ncatstudios.com/2008/12/22/flex-3-e4x-xml-and-filtering-using-regular-expressions-regexp/' rel='bookmark' title='Permanent Link: Flex 3, e4x, xml and filtering using Regular expressions (regExp)'>Flex 3, e4x, xml and filtering using Regular expressions (regExp)</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.ncatstudios.com%2F2009%2F05%2F18%2Fflex-swf-optimization-i%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><!--StartFragment--></p>
<p class="MsoNormal" style="text-align: justify; "><strong>Update: I just found<a href="http://www.kahunaburger.com/2008/03/08/air-link-report-visualizer/"> this </a></strong></p>
<p><strong> </strong></p>
<p><strong>air application for link report visualization </strong></p>
<p class="MsoNormal" style="text-align: justify; ">If you are an experienced Flex user you’ll know many ways to reduce the size of your compiled code. Using Modules, RSL, etc… But there’s nothing else you can do?</p>
<p class="MsoNormal" style="text-align: justify; ">The trick I will show you do not necessarily reduce the size of your application, but you’ll get a complete list of all the classes on your project with the size it takes.</p>
<p class="MsoNormal" style="text-align: justify; ">To do so you only must use this instruction:</p>
<p class="MsoNormal" style="text-align: justify; "><span style="mso-spacerun: yes"> </span><strong>–link-report=report.xml</strong></p>
<p class="MsoNormal" style="text-align: justify; ">for the compiler. This will generate an xml file with all the information of your project, with dependencies, sizes, etc… You’ll find this file inside your bin-debug folder</p>
<p class="MsoNormal" style="text-align: justify; ">I hope you find this trick useful!</p>
<p><!--EndFragment--></p>
<div class="shr-publisher-78"></div>

<p>Related posts:<ol><li><a href='http://blog.ncatstudios.com/2009/05/21/compile-css-to-swf-memory-bottleneck/' rel='bookmark' title='Permanent Link: Compile CSS to SWF memory bottleneck'>Compile CSS to SWF memory bottleneck</a></li>
<li><a href='http://blog.ncatstudios.com/2009/09/18/new-tool-flex-pmd/' rel='bookmark' title='Permanent Link: New Tool: Flex PMD'>New Tool: Flex PMD</a></li>
<li><a href='http://blog.ncatstudios.com/2008/12/22/flex-3-e4x-xml-and-filtering-using-regular-expressions-regexp/' rel='bookmark' title='Permanent Link: Flex 3, e4x, xml and filtering using Regular expressions (regExp)'>Flex 3, e4x, xml and filtering using Regular expressions (regExp)</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.ncatstudios.com/2009/05/18/flex-swf-optimization-i/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex, Amazon S3 and custom headers</title>
		<link>http://blog.ncatstudios.com/2009/04/19/flex-amazon-s3-and-custom-headers/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rss</link>
		<comments>http://blog.ncatstudios.com/2009/04/19/flex-amazon-s3-and-custom-headers/#comments</comments>
		<pubDate>Sun, 19 Apr 2009 10:19:31 +0000</pubDate>
		<dc:creator>Xavi Colomer</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Amazon S3]]></category>
		<category><![CDATA[Flex 3]]></category>
		<category><![CDATA[Flex 4]]></category>

		<guid isPermaLink="false">http://blog.ncatstudios.com/?p=68&#038;language=en</guid>
		<description><![CDATA[
			
				
			
		
Update: Seems not be working on the web, sure it&#8217;s some crossdomain issue so I&#8217;ll try to access to a budget ( since you cannot put a crossdomain.xml policy file on your Amazon&#8217;s root folder ) and I&#8217;ll update this post then 
Static and dynamic website objects ( SWF, mp3, images, etc&#8230;) are high bandwith [...]


Related posts:<ol><li><a href='http://blog.ncatstudios.com/2009/09/18/new-tool-flex-pmd/' rel='bookmark' title='Permanent Link: New Tool: Flex PMD'>New Tool: Flex PMD</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.ncatstudios.com%2F2009%2F04%2F19%2Fflex-amazon-s3-and-custom-headers%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p style="text-align: justify; "><strong>Update: </strong><em><strong>Seems not be working on the web, sure it&#8217;s some crossdomain issue so I&#8217;ll try to access to a budget ( since you cannot put a crossdomain.xml policy file on your Amazon&#8217;s root folder ) and I&#8217;ll update this post then </strong></em></p>
<p style="text-align: justify; ">Static and dynamic website objects ( SWF, mp3, images, etc&#8230;) are high bandwith consumers, especially dynamic ones liek SWFs due to development issues. If our bandwidth gets collapsed people will take a long time to see our website or even do not come to see it.</p>
<p style="text-align: justify; ">One solution to this problem is to move all these items to Amazon S3 which provides a very good service at low cost.</p>
<p style="text-align: justify; ">There is a library in google code (<a href="http://code.google.com/p/as3awss3lib/">as3awss3lib</a>) I could not get to run, probably because they need the AIR libraries and my  intention was to use the core Flex libraries only. So I decided to investigate how the Amazon S3 API works, and then tried to access this API using HttpService. If you have tried the same thing you&#8217;ve found that not HttpService do not allow custom headers (even if AIR lets you), so I tried to find other ways to put my own headers in httpService, My attempt was to create a connection with the Socket object but soon I found this library (<a href="http://code.google.com/p/as3httpclientlib/">as3httpclientlib</a>) on google code work done and I only had to worry about the connection.</p>
<p style="text-align: justify; ">Here is an example of a simple application ( Having some Security Sandbox Issues, I&#8217;ll check the policies but totally works on local ):</p>
<p style="text-align: justify; ">[SWF]wp-blogfiles/Flex_Amazon.swf, 512, 335[/SWF]</p>
<p style="text-align: justify; ">And the code (to compile this code you will need these libraries: <a href="http://code.google.com/p/as3httpclientlib/">as3httpclientlib</a> and <a href="http://code.google.com/p/as3crypto/">as3crypto</a>):</p>
<p style="text-align: justify; "><a href="http://blog.ncatstudios.com/wp-blogfiles/Flex_Amazon.mxml">MXML source</a></p>
<div class="shr-publisher-68"></div>

<p>Related posts:<ol><li><a href='http://blog.ncatstudios.com/2009/09/18/new-tool-flex-pmd/' rel='bookmark' title='Permanent Link: New Tool: Flex PMD'>New Tool: Flex PMD</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.ncatstudios.com/2009/04/19/flex-amazon-s3-and-custom-headers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Flex &amp; Drupal login ( Actionscript remoteObjects )</title>
		<link>http://blog.ncatstudios.com/2009/04/04/flex-drupal-login-actionscript-remoteobjects/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rss</link>
		<comments>http://blog.ncatstudios.com/2009/04/04/flex-drupal-login-actionscript-remoteobjects/#comments</comments>
		<pubDate>Sat, 04 Apr 2009 22:57:07 +0000</pubDate>
		<dc:creator>Xavi Colomer</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[Flex 3]]></category>
		<category><![CDATA[Flex 4]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://blog.ncatstudios.com/?p=52&#038;language=en</guid>
		<description><![CDATA[
			
				
			
		
Hello People!
It has been a long time since my last post so I&#8217;ve decided to post something found interesting. Long ago, seeking a faster way to create my websites I found CMS called Drupal, this CMS provides a lot of very important aspects of a web, such as content creation, scalability and robustness. But as [...]


Related posts:<ol><li><a href='http://blog.ncatstudios.com/2009/01/07/creating-your-first-blazeds-project/' rel='bookmark' title='Permanent Link: Creating your first BlazeDS project'>Creating your first BlazeDS project</a></li>
<li><a href='http://blog.ncatstudios.com/2009/04/19/flex-amazon-s3-and-custom-headers/' rel='bookmark' title='Permanent Link: Flex, Amazon S3 and custom headers'>Flex, Amazon S3 and custom headers</a></li>
<li><a href='http://blog.ncatstudios.com/2009/05/18/flex-swf-optimization-i/' rel='bookmark' title='Permanent Link: Flex swf optimization ( I )'>Flex swf optimization ( I )</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.ncatstudios.com%2F2009%2F04%2F04%2Fflex-drupal-login-actionscript-remoteobjects%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Hello People!</p>
<p>It has been a long time since my last post so I&#8217;ve decided to post something found interesting. Long ago, seeking a faster way to create my websites I found CMS called Drupal, this CMS provides a lot of very important aspects of a web, such as content creation, scalability and robustness. But as you know this blog is basically based on the Flash platform technologies, not Drupal, But I was interested in joining the two sides and make a login.</p>
<p>To follow this tutorial is recommended that you have some knowledge of Drupal and Flex</p>
<p>Requirements</p>
<p>Have a server ( local or remote ) with Drupal</p>
<p><strong>Note: </strong></p>
<p><em><strong>This tutorial was mad with Drupal 6.x but I think you can do it perfectly with the previous version 5.x<br />
</strong></em><br />
To complete this tutorial you will need some modules that do not come with the core ( amfphp and services ) as well as the amfphp server. To install the modules simply unzip them inside drupal_folder/modules but i recommend creating a folder drupal_folder/sites/all/modules and copy them inside. Then it¡s imperative you download the amfphp server and copy the the folder inside the amfphp. ( You should have something like this drupal_folder/modules/amfphp/amfphp, the first amfphp is the module logic and the second is the server.</p>
<p>Now we must activate some options of the modules we just install</p>
<p>- In Services activate Services ( it&#8217;s the only option, you can fail here xD )<br />
- In Services &#8211; servers activate AMFPHP<br />
- In Services &#8211; services activate System Service and User Service</p>
<p>You can go to the Drupal Services option and click on the AMFPHP server, you would see a default message from the server, if you can&#8217;t see it you may missed something.</p>
<p>One more thing before view the Actionscript code, in the Drupal Services menu, inside the Settings Tab, disable the &#8220;Use Keys&#8221; option which is used to provide security when we connect from external applications, and althought this tutorial might be used to create an external login too, we won&#8217;t use keys to simplify the tutorial ( maybe in a next post ) however we will leave the &#8220;Use sessid&#8221; active.</p>
<p>Once you have activate that options ( remember to save once you&#8217;ve activated ) we need to give permissions for anyone to access the services, if not an anonymous user couldn&#8217;t login because it couldn&#8217;t access them. Now we can begin to create our AS3</p>
<p>Before giving the Actionscript code I would like to discuss some aspects of the code:</p>
<p>While creating remoteObjects is easier in mxml I always prefer to avoid it using Actionscript but this meant more time until I found the way to communicate Flex with Drupal because I couldn&#8217;t how I could pass parameters to Drupal, if you&#8217;ve encountered the same problem, I hope this tutorial help.</p>
<p><strong>Note:<br />
<em>Before communicating with any other service you must have your sessid, you&#8217;ll do that connecting with the system.connect service, which will return you an object containing the sessid. If you do not know if your services are working correctly because of your code or because of Drupal, you can execute them directly from the Drupal Services menu, there you can find all the parameters you need to execute any service.</em></strong></p>
<p>Using MXML remoteObject is implemented like this ( using <strong>user.get</strong> as example ) :<br />
id=&#8221;test&#8221;<br />
endpoint=&#8221;http://localhost/drupal/services/amfphp&#8221;<br />
destination=&#8221;amfphp&#8221;<br />
source=&#8221;user&#8221;<br />
result=&#8221;handler_drupalResult( event )&#8221;<br />
fault=&#8221;handler_drupalFault( event )&#8221;&gt;</p>
<p>sessid<br />
1</p>
<p>This service is used to get the information about the user with a certain uid ( user id ). In order to do that you must be logged in.</p>
<p>In Actionscript should be something like this:</p>
<p>drupal.source = &#8220;user&#8221;<br />
var params:Object = new Object();<br />
params.sessid = sessid;<br />
params.uid = 1<br />
<strong>Operation(drupal.getOperation( &#8220;get&#8221; )).argumentNames = ["sessid","uid"]</strong><br />
drupal.getOperation( &#8220;get&#8221; ).arguments = params;<br />
drupal.getOperation( &#8220;get&#8221; ).send();</p>
<p>The lined marked in bold is the one I was searching during hours, this is automatically implemented in the mxml component, if you don&#8217;t put it Drupal will always return &#8220;Missing Arguments&#8221;</p>
<p>Finally, the code:</p>
<p>I hope you find this usefull!!</p>
<div class="shr-publisher-52"></div>

<p>Related posts:<ol><li><a href='http://blog.ncatstudios.com/2009/01/07/creating-your-first-blazeds-project/' rel='bookmark' title='Permanent Link: Creating your first BlazeDS project'>Creating your first BlazeDS project</a></li>
<li><a href='http://blog.ncatstudios.com/2009/04/19/flex-amazon-s3-and-custom-headers/' rel='bookmark' title='Permanent Link: Flex, Amazon S3 and custom headers'>Flex, Amazon S3 and custom headers</a></li>
<li><a href='http://blog.ncatstudios.com/2009/05/18/flex-swf-optimization-i/' rel='bookmark' title='Permanent Link: Flex swf optimization ( I )'>Flex swf optimization ( I )</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.ncatstudios.com/2009/04/04/flex-drupal-login-actionscript-remoteobjects/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Creating your first BlazeDS project</title>
		<link>http://blog.ncatstudios.com/2009/01/07/creating-your-first-blazeds-project/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rss</link>
		<comments>http://blog.ncatstudios.com/2009/01/07/creating-your-first-blazeds-project/#comments</comments>
		<pubDate>Wed, 07 Jan 2009 22:52:45 +0000</pubDate>
		<dc:creator>Xavi Colomer</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[BlazeDS]]></category>
		<category><![CDATA[Flex 3]]></category>
		<category><![CDATA[Flex 4]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://blog.ncatstudios.com/?p=32&#038;language=en</guid>
		<description><![CDATA[
			
				
			
		
Now we&#8217;ve got Adobe Flex configured to work with BlazeDS let&#8217;s start with our first project.
We will do this:
We will create the front-end logic in Actionscript and MXML. 
We will create the back-end logic in JAVA 
We will create the needed config files to establish a bridge or a connection between the front-end and the [...]


Related posts:<ol><li><a href='http://blog.ncatstudios.com/2008/12/18/setting-up-your-blazeds-tomcat-server-on-eclipse-local/' rel='bookmark' title='Permanent Link: Setting up your BlazeDS (tomcat) server on Eclipse ( local )'>Setting up your BlazeDS (tomcat) server on Eclipse ( local )</a></li>
<li><a href='http://blog.ncatstudios.com/2009/04/04/flex-drupal-login-actionscript-remoteobjects/' rel='bookmark' title='Permanent Link: Flex &#038; Drupal login ( Actionscript remoteObjects )'>Flex &#038; Drupal login ( Actionscript remoteObjects )</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.ncatstudios.com%2F2009%2F01%2F07%2Fcreating-your-first-blazeds-project%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p style="text-align: justify; ">Now we&#8217;ve got Adobe Flex configured to work with BlazeDS let&#8217;s start with our first project.</p>
<p style="text-align: justify; "><strong>We will do this:</strong></p>
<p style="text-align: justify; "><em>We will create the front-end logic in Actionscript and MXML. </em></p>
<p style="text-align: justify; "><em>We will create the back-end logic in JAVA </em></p>
<p style="text-align: justify; "><em>We will create the needed config files to establish a bridge or a connection between the front-end and the back-end.</em></p>
<p style="text-align: justify; ">
<p style="text-align: justify; ">So let&#8217;s start creating a new project, this time we want to use a Server technology. Here we must select <strong>J2EE</strong> because tomcat / BlazeDS uses this language / technology and we won&#8217;t touch anything</p>
<p style="text-align: justify; ">you can see the results in the next image:</p>
<p style="text-align: justify; "><a href="http://blog.ncatstudios.com/wp-content/uploads/2009/09/4_1creating.jpg" rel="lightbox[32]"><img class="aligncenter size-thumbnail wp-image-161" title="4_1creating" src="http://blog.ncatstudios.com/wp-content/uploads/2009/09/4_1creating-150x150.jpg" alt="4_1creating" width="150" height="150" /></a></p>
<p style="text-align: justify; "><a href="wp-blogfiles/images/4_1creating.jpg" rel="lightbox[32]"> </a></p>
<p style="text-align: justify; ">At the bottom of the image you&#8217;ll see a check box with this text: <strong>Create combined Java / Flex project using WTP.</strong> In the java source folder will be placed all the raw java files, the logic of the back-end, once you execute the project this logic will be compiled and placed to the server automatically, don&#8217;t worry about that.</p>
<p style="text-align: justify; "><a href="http://blog.ncatstudios.com/wp-content/uploads/2009/09/4_2creating.jpg" rel="lightbox[32]"><img class="aligncenter size-thumbnail wp-image-162" title="4_2creating" src="http://blog.ncatstudios.com/wp-content/uploads/2009/09/4_2creating-150x150.jpg" alt="4_2creating" width="150" height="150" /></a></p>
<p style="text-align: justify; "><a href="wp-blogfiles/images/4_2creating.jpg" rel="lightbox[32]"> </a></p>
<p style="text-align: justify; ">Next we must configure the J2EE settings, the target runtime will be BlazeDS we created in the last post. I always put the same in the Context root and the Content folder, the project name, but in this example I will put context_root and content_folder to show you how the folders and files are created. The project is structured like this:</p>
<p style="text-align: justify; "><a href="http://blog.ncatstudios.com/wp-content/uploads/2009/09/4_3result.jpg" rel="lightbox[32]"><img class="aligncenter size-thumbnail wp-image-163" title="4_3result" src="http://blog.ncatstudios.com/wp-content/uploads/2009/09/4_3result-150x150.jpg" alt="4_3result" width="150" height="150" /></a></p>
<p style="text-align: justify; "><a href="wp-blogfiles/images/4_3result.jpg" rel="lightbox[32]"> </a></p>
<p style="text-align: justify; ">Inside the content_folder to folders has been created: META-INF, and WEB-INF ( this is the important one now&#8230; )</p>
<p style="text-align: justify; ">inside WEB-INF we&#8217;ve got 4 folders:</p>
<p style="text-align: justify; "><strong>classes</strong>: <em>This is the back-end compiled logic created inside the src folder, every time you run the project the JAVA files will be recompiled ( if needed ) and updated inside this folder.</em></p>
<p style="text-align: justify; "><strong>flex</strong>: <em>Here is the messaging configuration you will see 4 files inside this folder but you only need services-config.xml the other files are automatically created for order purposes, if you delete them you will get some errors because you must edit services-config.xml. This file includes the other three, if you delete this inclusions, you can delete the files&#8230; ( of course this files are useful to mantain the messaging structure clean but this is a beginner tutorial!! )</em></p>
<p style="text-align: justify; "><strong>lib</strong>: <em>Some libraries, don&#8217;t need to look here&#8230;</em></p>
<p style="text-align: justify; "><strong>src</strong>: <em>Don&#8217;t need to look here either&#8230;</em></p>
<p style="text-align: justify; "><strong>web.xml</strong> <em>configuration file, we won&#8217;t edit this.</em></p>
<p style="text-align: justify; ">OK.</p>
<p style="text-align: justify; ">Now we&#8217;ve got our structure created the first thing we must do is add our project to our server, this will create a new folder inside the backend with the name of the project and this will contain a copy of our recently created content_folder.</p>
<p style="text-align: justify; "><a href="http://blog.ncatstudios.com/wp-content/uploads/2009/09/4_4addServer.jpg" rel="lightbox[32]"><img class="aligncenter size-thumbnail wp-image-164" title="4_4addServer" src="http://blog.ncatstudios.com/wp-content/uploads/2009/09/4_4addServer-150x150.jpg" alt="4_4addServer" width="150" height="150" /></a></p>
<p style="text-align: justify; "><a href="wp-blogfiles/images/4_4addServer.jpg" rel="lightbox[32]"> </a></p>
<p style="text-align: justify; ">Now we will delete all the files inside content_folder -&gt; WEB-INF -&gt; flex except for services-config.xml, and we will edit the services node like this:</p>
<pre lang="xml"> 	            	com.ncatstudios.remoting.Test</pre>
<p style="text-align: justify; ">The important parts of this piece of XML are the destination and the source. The destination is like the address of the wharehouse where to fetch the data. We must call somewhere from flex to access the data, this name must be the same both sides. The source is the name of the JAVA class ( package doted format ) where we will call the methods.</p>
<p style="text-align: justify; ">Finally here is the code to run the application:</p>
<p style="text-align: justify; ">
<p style="text-align: justify; ">and the JAVA logic:</p>
<pre lang="JAVA">package com.ncatstudios.remoting;

public class Test {

	public String sayHelloTo(String who)
	{
		return "Hello " + who;
	}

}</pre>
<p style="text-align: justify; ">
<p style="text-align: justify; ">Now you can run the application to test it.</p>
<p style="text-align: justify; ">Possible error / bug: I found that sometimes my application doesn&#8217;t run as it should.</p>
<p style="text-align: justify; "><a href="http://blog.ncatstudios.com/wp-content/uploads/2009/09/4_5error.jpg" rel="lightbox[32]"><img class="aligncenter size-thumbnail wp-image-165" title="4_5error" src="http://blog.ncatstudios.com/wp-content/uploads/2009/09/4_5error-150x150.jpg" alt="4_5error" width="150" height="150" /></a></p>
<p style="text-align: justify; "><a href="wp-blogfiles/images/4_5error.jpg" rel="lightbox[32]"> </a></p>
<p style="text-align: justify; ">If you open the project properties, inside the Flex Server section just delete the folder of the root URL, leave it to http://localhost:8080, you probably won&#8217;t need to edit this for rest of the life of this project.</p>
<p style="text-align: justify; ">
<p style="text-align: justify; ">
<div class="shr-publisher-32"></div>

<p>Related posts:<ol><li><a href='http://blog.ncatstudios.com/2008/12/18/setting-up-your-blazeds-tomcat-server-on-eclipse-local/' rel='bookmark' title='Permanent Link: Setting up your BlazeDS (tomcat) server on Eclipse ( local )'>Setting up your BlazeDS (tomcat) server on Eclipse ( local )</a></li>
<li><a href='http://blog.ncatstudios.com/2009/04/04/flex-drupal-login-actionscript-remoteobjects/' rel='bookmark' title='Permanent Link: Flex &#038; Drupal login ( Actionscript remoteObjects )'>Flex &#038; Drupal login ( Actionscript remoteObjects )</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.ncatstudios.com/2009/01/07/creating-your-first-blazeds-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex 3, e4x, xml and filtering using Regular expressions (regExp)</title>
		<link>http://blog.ncatstudios.com/2008/12/22/flex-3-e4x-xml-and-filtering-using-regular-expressions-regexp/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rss</link>
		<comments>http://blog.ncatstudios.com/2008/12/22/flex-3-e4x-xml-and-filtering-using-regular-expressions-regexp/#comments</comments>
		<pubDate>Mon, 22 Dec 2008 00:42:54 +0000</pubDate>
		<dc:creator>Xavi Colomer</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Flex 3]]></category>
		<category><![CDATA[Flex 4]]></category>
		<category><![CDATA[Optimization]]></category>

		<guid isPermaLink="false">http://blog.ncatstudios.com/?p=20&#038;language=en</guid>
		<description><![CDATA[
			
				
			
		
One of the best improvements of AS3 is the inclusion of native support for parsing xml with e4x. E4X give us the possibility of parsing xml data as objects.
You can access the information using &#8220;dot&#8221; notation ie node_name.node_child_node_child&#8230;
As any technology there are advantatges and disadvantatges:
Advantatges:
This technology is fast to write, very intuitive and saves a [...]


Related posts:<ol><li><a href='http://blog.ncatstudios.com/2009/05/18/flex-swf-optimization-i/' rel='bookmark' title='Permanent Link: Flex swf optimization ( I )'>Flex swf optimization ( I )</a></li>
<li><a href='http://blog.ncatstudios.com/2009/04/19/flex-amazon-s3-and-custom-headers/' rel='bookmark' title='Permanent Link: Flex, Amazon S3 and custom headers'>Flex, Amazon S3 and custom headers</a></li>
<li><a href='http://blog.ncatstudios.com/2009/05/21/compile-css-to-swf-memory-bottleneck/' rel='bookmark' title='Permanent Link: Compile CSS to SWF memory bottleneck'>Compile CSS to SWF memory bottleneck</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.ncatstudios.com%2F2008%2F12%2F22%2Fflex-3-e4x-xml-and-filtering-using-regular-expressions-regexp%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p style="text-align: justify; ">One of the best improvements of AS3 is the inclusion of native support for parsing xml with e4x. E4X give us the possibility of parsing xml data as objects.</p>
<p style="text-align: justify; ">You can access the information using &#8220;dot&#8221; notation ie node_name.node_child_node_child&#8230;</p>
<p style="text-align: justify; ">As any technology there are advantatges and disadvantatges:</p>
<p style="text-align: justify; "><strong>Advantatges:</strong></p>
<p style="text-align: justify; ">This technology is fast to write, very intuitive and saves a lot of typing.</p>
<p style="text-align: justify; "><strong>Disadvantatges:</strong></p>
<p style="text-align: justify; ">You must be careful about what are you filtering, large xml means an increasing of flash player time to parse the file, which is stored in memory temporarely, and this is a quite important performance issue.</p>
<p style="text-align: justify; ">In the next example you can find how can you filter a xml file using this technique:</p>
<p style="text-align: justify; ">[SWF]wp-blogfiles/bin-release/regex.swf, 500, 576[/SWF]</p>
<p style="text-align: justify; ">And here some code:</p>
<pre lang="actionscript3">private var _xml:XML;		

private function init():void
{
        loadXML("../assets/XML/texts.xml");
}

private function loadXML(xml:String):void
{
        var loader:URLLoader = new URLLoader();
	loader.addEventListener(Event.COMPLETE, handler_xmlIsLoadedCorrectly);
	loader.dataFormat = "e4x"
	loader.load(new URLRequest(xml));
}

private function handler_xmlIsLoadedCorrectly(event:Event):void
{
	_xml = new XML(event.target.data);
	TA_Xml.text = _xml.toString()
}

private function handler_searchStringIsChanged(event:Event):void
{
	var reg:RegExp = new RegExp(TI_SearchString.text);
	TI_Results.text = _xml..item.(reg.test(text)).@id
}</pre>
<p style="text-align: justify; ">I hope you find it useful!</p>
<div class="shr-publisher-20"></div>

<p>Related posts:<ol><li><a href='http://blog.ncatstudios.com/2009/05/18/flex-swf-optimization-i/' rel='bookmark' title='Permanent Link: Flex swf optimization ( I )'>Flex swf optimization ( I )</a></li>
<li><a href='http://blog.ncatstudios.com/2009/04/19/flex-amazon-s3-and-custom-headers/' rel='bookmark' title='Permanent Link: Flex, Amazon S3 and custom headers'>Flex, Amazon S3 and custom headers</a></li>
<li><a href='http://blog.ncatstudios.com/2009/05/21/compile-css-to-swf-memory-bottleneck/' rel='bookmark' title='Permanent Link: Compile CSS to SWF memory bottleneck'>Compile CSS to SWF memory bottleneck</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.ncatstudios.com/2008/12/22/flex-3-e4x-xml-and-filtering-using-regular-expressions-regexp/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setting up your BlazeDS (tomcat) server on Eclipse ( local )</title>
		<link>http://blog.ncatstudios.com/2008/12/18/setting-up-your-blazeds-tomcat-server-on-eclipse-local/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rss</link>
		<comments>http://blog.ncatstudios.com/2008/12/18/setting-up-your-blazeds-tomcat-server-on-eclipse-local/#comments</comments>
		<pubDate>Thu, 18 Dec 2008 18:28:04 +0000</pubDate>
		<dc:creator>Xavi Colomer</dc:creator>
				<category><![CDATA[BlazeDS]]></category>
		<category><![CDATA[Examples]]></category>
		<category><![CDATA[Flex 3]]></category>
		<category><![CDATA[Flex 4]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://blog.ncatstudios.com/?p=10&#038;language=en</guid>
		<description><![CDATA[
			
				
			
		
BlazeDS is a &#8220;server-based Java remoting and web messaging technology that enables developers to easily connect to back-end distributed data and push data in real-time&#8220;, in other words if you want to write chat applications, or maybe optimize the communications between front-end and back-end this is a great OPEN SOURCE option.
There&#8217;s the enterprise version called [...]


Related posts:<ol><li><a href='http://blog.ncatstudios.com/2009/01/07/creating-your-first-blazeds-project/' rel='bookmark' title='Permanent Link: Creating your first BlazeDS project'>Creating your first BlazeDS project</a></li>
<li><a href='http://blog.ncatstudios.com/2009/04/04/flex-drupal-login-actionscript-remoteobjects/' rel='bookmark' title='Permanent Link: Flex &#038; Drupal login ( Actionscript remoteObjects )'>Flex &#038; Drupal login ( Actionscript remoteObjects )</a></li>
<li><a href='http://blog.ncatstudios.com/2009/05/21/compile-css-to-swf-memory-bottleneck/' rel='bookmark' title='Permanent Link: Compile CSS to SWF memory bottleneck'>Compile CSS to SWF memory bottleneck</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.ncatstudios.com%2F2008%2F12%2F18%2Fsetting-up-your-blazeds-tomcat-server-on-eclipse-local%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p style="text-align: justify; "><strong><a href="http://opensource.adobe.com/wiki/display/blazeds/BlazeDS/">BlazeDS</a></strong> is a &#8220;<em>server-based Java remoting and web messaging technology that enables developers to easily connect to back-end distributed data and push data in real-time</em>&#8220;, in other words if you want to write chat applications, or maybe optimize the communications between front-end and back-end this is a great OPEN SOURCE option.</p>
<p style="text-align: justify; ">There&#8217;s the enterprise version called LCDS (<em> Livecycle Data Services</em> ) which offers some more features like Data-Synchronization, Offline applications, RIA-PDF generation, etc&#8230;</p>
<p style="text-align: justify; ">You can find a comparison between the features of BlazeDS and LCDS here:</p>
<p style="text-align: center;"><a href="http://blog.ncatstudios.com/wp-content/uploads/2009/09/blazeds.JPG" rel="lightbox[10]"><img class="size-thumbnail wp-image-167 aligncenter" title="blazeds" src="http://blog.ncatstudios.com/wp-content/uploads/2009/09/blazeds-150x150.jpg" alt="blazeds" width="150" height="150" /></a><strong> </strong></p>
<p style="text-align: left;"><strong>Requeriments:</strong></p>
<p>- You must download and install <a href="http://java.sun.com/javase/downloads/index.jsp">JDK</a> ( <em>Java Development Kit </em>)</p>
<p>- You must download and copy <a href="http://opensource.adobe.com/wiki/display/blazeds/Release+Builds">BlazeDS</a> ( <em>Copy to the folder you wish, for example C:\Program files\BlazeDS, this is the folder I&#8217;ll be using all the tutorial</em> )</p>
<p>- Obviously you must have installed <a href="http://www.eclipse.org/downloads/">Eclipse</a> or <a href="http://www.adobe.com/products/flex/?promoid=BPDEQ">Flex Builder</a></p>
<p>- You must must/have install/ed the plugin for Java Development on Eclipse / Flex Builder ( <em>Help -&gt; Software Updates</em> )</p>
<p><strong>1. Create an environment variable called JAVA_HOME pointing to the JDK installation.</strong></p>
<p>To create this environment variable you can right-click on MyPC and follow this images ( <em>Remember to change the folder if necessary </em>):</p>
<p><a href="http://blog.ncatstudios.com/wp-content/uploads/2009/09/myPC.jpg" rel="lightbox[10]"><img class="aligncenter size-thumbnail wp-image-172" title="myPC" src="http://blog.ncatstudios.com/wp-content/uploads/2009/09/myPC-150x150.jpg" alt="myPC" width="150" height="150" /></a></p>
<p>Now you must <strong>restart </strong>in order that changes take effect.</p>
<p><strong>1,5. Showing Servers tab</strong></p>
<p>You may want to view the servers tab in order to run it from any perspective.</p>
<p>In this case:</p>
<p>from Flex Builder go to Window -&gt; Other Views&#8230; -&gt; Server -&gt; Servers</p>
<p>from Eclipse go to Window -&gt; Show View -&gt; Other&#8230; -&gt; Server -&gt; Servers</p>
<p>You will see in your bottom view a new tab called Servers.</p>
<p><strong>2. Create a new server in Eclipse / Flex Builder.</strong></p>
<p>Right click in the Servers view and select New&#8230; or New -&gt; Other -&gt; Server -&gt; Server</p>
<p>This window will appear:</p>
<p><a href="http://blog.ncatstudios.com/wp-content/uploads/2009/09/DefineServer.jpg" rel="lightbox[10]"><img class="aligncenter size-thumbnail wp-image-169" title="DefineServer" src="http://blog.ncatstudios.com/wp-content/uploads/2009/09/DefineServer-150x150.jpg" alt="DefineServer" width="150" height="150" /></a></p>
<p>We&#8217;ll let Server&#8217;s host name to <strong>localhost</strong> and will call this new Server <strong>BlazeDS.</strong></p>
<p>Click next.</p>
<p>Now we will point this new server to the tomcat&#8217;s folder in our BlazeDS installation. <em>Be aware to change the path if needed.</em></p>
<p><a href="http://blog.ncatstudios.com/wp-content/uploads/2009/09/SetupTomcat.jpg" rel="lightbox[10]"><img class="aligncenter size-thumbnail wp-image-174" title="SetupTomcat" src="http://blog.ncatstudios.com/wp-content/uploads/2009/09/SetupTomcat-150x150.jpg" alt="SetupTomcat" width="150" height="150" /></a></p>
<p>Click Next.</p>
<p>We won&#8217;t add any project for the moment:</p>
<p><a href="http://blog.ncatstudios.com/wp-content/uploads/2009/09/AddServer.jpg" rel="lightbox[10]"><img class="aligncenter size-thumbnail wp-image-166" title="AddServer" src="http://blog.ncatstudios.com/wp-content/uploads/2009/09/AddServer-150x150.jpg" alt="AddServer" width="150" height="150" /></a></p>
<p>OK. We&#8217;ve just created a new server.</p>
<p>You can run it to test it, but it won&#8217;t work until we configure it correctly, how? keep reading!!!! XD</p>
<p><strong>3. Configuring correctly the server.</strong></p>
<p>Right click on your brand new server in the Servers view and select Open&#8230;</p>
<p>This image should appear:</p>
<p><a href="http://blog.ncatstudios.com/wp-content/uploads/2009/09/Config.jpg" rel="lightbox[10]"><img class="aligncenter size-thumbnail wp-image-168" title="Config" src="http://blog.ncatstudios.com/wp-content/uploads/2009/09/Config-150x150.jpg" alt="Config" width="150" height="150" /></a></p>
<p>Here you must change two values under Server location:</p>
<p>1. On the first radiobuttons select the second one ( Use tomcat installation )</p>
<p>2. Chage Deploy path from wtpwebapps to webapps or your full path to webapps folder.</p>
<p>4. Test the server.</p>
<p>Now you can Restart the server and Test it going to this address in your internet browser http://localhost:8400</p>
<p>A welcome screen will appear with a short many of your options.</p>
<p><strong>Note: In order to get the examples working you must run the file </strong><em><strong>C:\Program Files\BlazeDS\sampledb\startdb.bat ( Change path if needed )</strong></em></p>
<p><strong>5. That&#8217;s all folks</strong></p>
<p>That&#8217;s all!!!  I&#8217;ll post how to connect your AIR / Flex project with this server very soon!!!!</p>
<p><strong>Happy Xmas</strong></p>
<div class="shr-publisher-10"></div>

<p>Related posts:<ol><li><a href='http://blog.ncatstudios.com/2009/01/07/creating-your-first-blazeds-project/' rel='bookmark' title='Permanent Link: Creating your first BlazeDS project'>Creating your first BlazeDS project</a></li>
<li><a href='http://blog.ncatstudios.com/2009/04/04/flex-drupal-login-actionscript-remoteobjects/' rel='bookmark' title='Permanent Link: Flex &#038; Drupal login ( Actionscript remoteObjects )'>Flex &#038; Drupal login ( Actionscript remoteObjects )</a></li>
<li><a href='http://blog.ncatstudios.com/2009/05/21/compile-css-to-swf-memory-bottleneck/' rel='bookmark' title='Permanent Link: Compile CSS to SWF memory bottleneck'>Compile CSS to SWF memory bottleneck</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.ncatstudios.com/2008/12/18/setting-up-your-blazeds-tomcat-server-on-eclipse-local/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

