<?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>The Morphic Group &#187; Flash</title>
	<atom:link href="http://www.themorphicgroup.com/blog/tag/flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.themorphicgroup.com/blog</link>
	<description></description>
	<lastBuildDate>Mon, 22 Feb 2010 18:20:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Flex 4 Custom Preloader</title>
		<link>http://www.themorphicgroup.com/blog/2009/11/11/flex-4-custom-preloader/</link>
		<comments>http://www.themorphicgroup.com/blog/2009/11/11/flex-4-custom-preloader/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 18:10:07 +0000</pubDate>
		<dc:creator>Seth</dc:creator>
				<category><![CDATA[Flash Builder]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[flex 4]]></category>
		<category><![CDATA[preloader]]></category>

		<guid isPermaLink="false">http://www.themorphicgroup.com/blog/?p=340</guid>
		<description><![CDATA[In this example were going to look at a way to create a custom preloader SWC in Flash Professional and use it inside of a Flex 4 application by extending the SparkDownloadProgressBar class. This preloader will display the progress percentage of loading and also a count of RSLs as they are being loaded, after loading [...]]]></description>
			<content:encoded><![CDATA[<p>
In this example were going to look at a way to create a custom preloader SWC in Flash Professional and use it inside of a Flex 4 application by extending the SparkDownloadProgressBar class.<br />
<br />
This preloader will display the progress percentage of loading and also a count of RSLs as they are being loaded, after loading is complete the progress of initialization will be displayed. Both of the progresses will be displayed by a graphical progress bar and in text.
</p>
<p>
	<a href="http://www.themorphicgroup.com/examples/Flex4PreloaderExample/Flex4PreloaderExample.html" target="_blank"><strong>View Demo Preloader App</strong> (right click for source view)</a>
</p>
<p>
	The preloader may fly by, so lets first take a look at how this progress bar looks as it is loading the Flex app:<br />
	<br/><br />
	<img src="http://www.themorphicgroup.com/blog/wp-content/uploads/2009/11/flex4_preloader01.png" width="331" height="171" alt="flex 4 preloader" />
</p>
<p>
	The next screenshot shows the progress as RSLs are being loaded:<br />
	<br/><br />
	<img src="http://www.themorphicgroup.com/blog/wp-content/uploads/2009/11/flex4_preloader02.png" width="331" height="171" alt="flex 4 preloader" />
</p>
<p>
	Finally the progress of initialization, with a second progress bar:<br />
	<br/><br />
	<img src="http://www.themorphicgroup.com/blog/wp-content/uploads/2009/11/flex4_preloader03.png" width="331" height="171" alt="flex 4 preloader" />
</p>
<h2>Creating the Preloader SWC in Flash Pro</h2>
<p>
	In Flash professional we create a custom preloader. In this example there are several layers which the design is created from.<br />
	The layer 'prog_bar' and 'initilize_bar" hold shapes that we will use to resize to show progress.<br />
	The 'loading text' layer contains some dynamic text that has Character Embedding for upper/lower/numbers.<br />
	The layers look like this:
</p>
<p><img src="http://www.themorphicgroup.com/blog/wp-content/uploads/2009/11/flex4_preloader_flash.png" width="218" height="159" alt="flex 4 preloader" /></p>
<p>
	The custom preloader FLA can be found in the example by viewing source.
</p>
<p>
	The FLA preloader is a movie clip and its properties are set for &quot;Export for ActioScript&quot; the &quot;Class&quot; property is set to &quot;PreloaderDisplay&quot; this allows us to have a PreloaderDisplay.swc created when this FLA is published.
</p>
<p><a href="http://www.themorphicgroup.com/blog/wp-content/uploads/2009/11/flex4_preloader_flash_prop_large.png"><img src="http://www.themorphicgroup.com/blog/wp-content/uploads/2009/11/flex4_preloader_flash_prop_small.png" width="230" height="148" alt="flex 4 preloader" border="none" /></a></p>
<p>
	In the first frame of the FLA &quot;actions&quot; layer we create the functions to set the two different progress bars:
</p>
<pre class="actionscript3" style="font-family:monospace;">&nbsp;
<span style="color: #009900;">//reset</span>
setMainProgress<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span>;
setInitalizeProgress<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span>;
loading_txt.<span style="color: #004993;">text</span> = <span style="color: #990000;">&quot;&quot;</span>;
&nbsp;
<span style="color: #009900;">//function for setting main prgress bar</span>
<span style="color: #339966; font-weight: bold;">function</span> setMainProgress<span style="color: #000000;">&#40;</span>percent<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=number%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:number.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Number</span></a><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
	prog_bar.<span style="color: #004993;">width</span> = percent <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight:bold;">275</span>;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #009900;">//function for setting the initilize bar</span>
<span style="color: #339966; font-weight: bold;">function</span> setInitalizeProgress<span style="color: #000000;">&#40;</span>percent<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=number%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:number.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Number</span></a><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
	initialize_bar.<span style="color: #004993;">width</span> = percent <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight:bold;">275</span>;
<span style="color: #000000;">&#125;</span>
&nbsp;</pre>
<p>
	The final step is to &quot;Publish&quot; the FLA so that the SWC file is create, this SWC will be used in Flash Builder.
</p>
<h2>Creating the Custom Preloader in Flex 4</h2>
<p>
	The first step is to place the PreloaderDisplay.swc in the &quot;libs&quot; folder, this will make the PreloaderDisplay and its methods available to Flex:
</p>
<p><img src="http://www.themorphicgroup.com/blog/wp-content/uploads/2009/11/flex4_preloader_libs.png" width="189" height="55" alt="preloader swc libs" /></p>
<p>
	To define a custom preloader we will do this in the Flex application's Application file, we simply specify the preloader class:
</p>
<pre class="actionscript3" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>Application preloader=<span style="color: #990000;">&quot;com.themorphicgroup.preload.Preloader&quot;</span> ...
&nbsp;</pre>
<p>
	In the Preloader class we will extend &quot;SparkDownloadProgressBar&quot;.</p>
<p>	The SparkDownloadProgressBar class displays download progress. </p>
<p>	From Flex 4 docs: It is used by the Preloader control to provide user feedback while the application is downloading and loading.<br />
	The download progress bar displays information about two different phases of the application: the download phase and the initialization phase.
</p>
<p>
	The Preloader.as extends &quot;SparkDownloadProgressBar&quot; and we will use the FLA PreloaderDisplay.swc by creating a variable called &quot;preloaderDisplay&quot;:
</p>
<pre class="actionscript3" style="font-family:monospace;">&nbsp;
<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> Preloader extends SparkDownloadProgressBar <span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> preloaderDisplay<span style="color: #000000; font-weight: bold;">:</span>PreloaderDisplay;
	...
&nbsp;</pre>
<p>
	To add the PreloaderDisplay we will override the SparkDownloadProgressBar's &quot;createChildren&quot; method, in this method we will create a new PreloaderDisplay and<br />
	use the &quot;addChild&quot; method (SparkDownloadProgressBar inherits addChild from DisplayObjectContainer):
</p>
<pre class="actionscript3" style="font-family:monospace;">&nbsp;
override <span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> createChildren<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight: bold;">!</span>preloaderDisplay<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
		preloaderDisplay = <span style="color: #0033ff; font-weight: bold;">new</span> PreloaderDisplay<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
		<span style="color: #6699cc; font-weight: bold;">var</span> startX<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=number%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:number.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Number</span></a> = <a href="http://www.google.com/search?q=math%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:math.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Math</span></a>.<span style="color: #004993;">round</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">stageWidth</span> <span style="color: #000000; font-weight: bold;">-</span> preloaderDisplay.<span style="color: #004993;">width</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight:bold;">2</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #6699cc; font-weight: bold;">var</span> startY<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=number%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:number.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Number</span></a> = <a href="http://www.google.com/search?q=math%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:math.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Math</span></a>.<span style="color: #004993;">round</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">stageHeight</span> <span style="color: #000000; font-weight: bold;">-</span> preloaderDisplay.<span style="color: #004993;">height</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight:bold;">2</span><span style="color: #000000;">&#41;</span>;
&nbsp;
		preloaderDisplay.<span style="color: #004993;">x</span> = startX;
		preloaderDisplay.<span style="color: #004993;">y</span> = startY;
		<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>preloaderDisplay<span style="color: #000000;">&#41;</span>;
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;</pre>
<p>
	There are several methods that we will override so that we can make updates to the PreloaderDisplay.swc.<br />
	The rslProgressHandler method will be called each time a RSL is being loaded. We will use this method to set text indicating the current count of RSL being loaded:
</p>
<pre class="actionscript3" style="font-family:monospace;">&nbsp;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> rslBaseText<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">String</span></a> = <span style="color: #990000;">&quot;loading: &quot;</span>;
override <span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> rslProgressHandler<span style="color: #000000;">&#40;</span>evt<span style="color: #000000; font-weight: bold;">:</span>RSLEvent<span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>evt.rslIndex <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> evt.rslTotal<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
		<span style="color: #009900;">//create text to track the RSLs being loaded</span>
		rslBaseText = <span style="color: #990000;">&quot;loading RSL &quot;</span> <span style="color: #000000; font-weight: bold;">+</span> evt.rslIndex <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #990000;">&quot; of &quot;</span> <span style="color: #000000; font-weight: bold;">+</span> evt.rslTotal <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #990000;">&quot;: &quot;</span>;
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;</pre>
<p>
	The next method we will override is setDownloadProgress. This method indicateds the current download progress. in this method we will set the<br />
	PreloaderDisplay.swc main progress bar and set the text:
</p>
<pre class="actionscript3" style="font-family:monospace;">&nbsp;
override <span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> setDownloadProgress<span style="color: #000000;">&#40;</span>completed<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=number%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:number.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Number</span></a>, total<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=number%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:number.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Number</span></a><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>preloaderDisplay<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
		<span style="color: #009900;">//set the main progress bar inside PreloaderDisplay</span>
		preloaderDisplay.setMainProgress<span style="color: #000000;">&#40;</span>completed<span style="color: #000000; font-weight: bold;">/</span>total<span style="color: #000000;">&#41;</span>;
		<span style="color: #009900;">//set percetage text to display, if loading RSL the rslBaseText will indicate the number</span>
		setPreloaderLoadingText<span style="color: #000000;">&#40;</span>rslBaseText <span style="color: #000000; font-weight: bold;">+</span> <a href="http://www.google.com/search?q=math%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:math.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Math</span></a>.<span style="color: #004993;">round</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>completed<span style="color: #000000; font-weight: bold;">/</span>total<span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #000000; font-weight:bold;">100</span><span style="color: #000000;">&#41;</span>.<span style="color: #004993;">toString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #990000;">&quot;%&quot;</span><span style="color: #000000;">&#41;</span>;
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;</pre>
<p>
	Finally we will look at overriding setInitProgress, this method indicates the progress of the Flex app as it initializes.<br />
	We will set the text in PreloaderDisplay.swc and change the progress of the second initialize progress bar:
</p>
<pre class="actionscript3" style="font-family:monospace;">&nbsp;
override <span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> setInitProgress<span style="color: #000000;">&#40;</span>completed<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=number%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:number.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Number</span></a>, total<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=number%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:number.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Number</span></a><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>preloaderDisplay<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
		<span style="color: #009900;">//set the initialization progress bar inside PreloaderDisplay</span>
		preloaderDisplay.setInitalizeProgress<span style="color: #000000;">&#40;</span>completed<span style="color: #000000; font-weight: bold;">/</span>total<span style="color: #000000;">&#41;</span>;
		<span style="color: #009900;">//set loading text</span>
		<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>completed <span style="color: #000000; font-weight: bold;">&gt;</span> total<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
			setPreloaderLoadingText<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;almost done&quot;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span> <span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #000000;">&#123;</span>
			setPreloaderLoadingText<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;initializing &quot;</span> <span style="color: #000000; font-weight: bold;">+</span> completed <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #990000;">&quot; of &quot;</span> <span style="color: #000000; font-weight: bold;">+</span> total<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;</pre>
<p>&nbsp;</p>
<p>
	This blog entry does not cover every bit of code used in the preloader, so<br />
	<a href="http://www.themorphicgroup.com/examples/Flex4PreloaderExample/Flex4PreloaderExample.html" target="_blank"><strong>View Demo Preloader App</strong> right click for source view</a>
</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.themorphicgroup.com/blog/2009/11/11/flex-4-custom-preloader/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>&#8220;Content Assist&#8221; did not complete normally. Please see log for more information.</title>
		<link>http://www.themorphicgroup.com/blog/2009/10/27/content-assist-did-not-complete-normally/</link>
		<comments>http://www.themorphicgroup.com/blog/2009/10/27/content-assist-did-not-complete-normally/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 15:44:41 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Content Assist]]></category>
		<category><![CDATA[Flash Builder]]></category>
		<category><![CDATA[Flash Builder 4 beta 2]]></category>
		<category><![CDATA[Flex Builder]]></category>
		<category><![CDATA[FlexBuilder]]></category>
		<category><![CDATA[work around]]></category>

		<guid isPermaLink="false">http://www.themorphicgroup.com/blog/?p=331</guid>
		<description><![CDATA[Here is a work around for this annoying bug in Flash Builder 4 beta 2: From: http://bugs.adobe.com/jira/browse/FB-21566 Close Flash Builder 4 beta 2 Delete this folder in your workspace: \.metadata\.plugins\com.adobe.flexbuilder.codemodel. Relaunch Flash Builder 4 beta 2]]></description>
			<content:encoded><![CDATA[<p>Here is a work around for this annoying bug in Flash Builder 4 beta 2:</p>
<p>From: http://bugs.adobe.com/jira/browse/FB-21566</p>
<p>Close Flash Builder 4 beta 2</p>
<p>Delete this folder in your workspace:</p>
<p><workspace root>\.metadata\.plugins\com.adobe.flexbuilder.codemodel.</p>
<p>Relaunch Flash Builder 4 beta 2</p>
]]></content:encoded>
			<wfw:commentRss>http://www.themorphicgroup.com/blog/2009/10/27/content-assist-did-not-complete-normally/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Flash Camp St Louis 2009 &#8211; Code Samples</title>
		<link>http://www.themorphicgroup.com/blog/2009/09/13/flash-camp-code-samples/</link>
		<comments>http://www.themorphicgroup.com/blog/2009/09/13/flash-camp-code-samples/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 01:09:51 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[City Museum]]></category>
		<category><![CDATA[Dev]]></category>
		<category><![CDATA[Flash Camp]]></category>
		<category><![CDATA[Flash Camp 2009]]></category>
		<category><![CDATA[Flex Builder]]></category>
		<category><![CDATA[FlexBuilder]]></category>
		<category><![CDATA[FlexBuiler]]></category>
		<category><![CDATA[Jason Hanson]]></category>
		<category><![CDATA[St. Louis]]></category>

		<guid isPermaLink="false">http://www.themorphicgroup.com/blog/?p=272</guid>
		<description><![CDATA[I had a great time presenting at Flash Camp St Louis this last Friday. The City Museum was a great venue. All the other speakers did a great job. Thanks JP for putting together such a great event! Here is the sample code I showed in the presentation. Rt-click and select View Source for the [...]]]></description>
			<content:encoded><![CDATA[<p>I had a great time presenting at Flash Camp St Louis this last Friday.  The City Museum was a great venue.  All the other speakers did a great job.  Thanks JP for putting together such a great event!</p>
<p>Here is the sample code I showed in the presentation.  Rt-click and select View Source for the source.</p>
<p><a href="http://www2.themorphicgroup.com/blog/flashcamp2009/singleton/Singleton_Complete.html">http://www2.themorphicgroup.com/blog/flashcamp2009/singleton/Singleton_Complete.html</a><br />
<a href="http://www2.themorphicgroup.com/blog/flashcamp2009/singleton/srcview/index.html">source</a></p>
<p><a href="http://www2.themorphicgroup.com/blog/flashcamp2009/observer/Observer_Complete.html">http://www2.themorphicgroup.com/blog/flashcamp2009/observer/Observer_Complete.html</a><br />
<a href="http://www2.themorphicgroup.com/blog/flashcamp2009/observer/srcview/index.html">source</a></p>
<p><a href="http://www2.themorphicgroup.com/blog/flashcamp2009/event/Event_Complete.html">http://www2.themorphicgroup.com/blog/flashcamp2009/event/Event_Complete.html</a><br />
<a href="http://www2.themorphicgroup.com/blog/flashcamp2009/observer/srcview/index.html">source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.themorphicgroup.com/blog/2009/09/13/flash-camp-code-samples/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Flash Camp St. Louis 2009 &#8211; This Friday</title>
		<link>http://www.themorphicgroup.com/blog/2009/09/08/flash-camp-st-louis-2009-this-friday/</link>
		<comments>http://www.themorphicgroup.com/blog/2009/09/08/flash-camp-st-louis-2009-this-friday/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 16:30:28 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Adobe Catalyst]]></category>
		<category><![CDATA[City Museum]]></category>
		<category><![CDATA[Dev]]></category>
		<category><![CDATA[Flash Camp]]></category>
		<category><![CDATA[Flash Camp 2009]]></category>
		<category><![CDATA[Flex Builder]]></category>
		<category><![CDATA[Flex Conference]]></category>
		<category><![CDATA[FlexBuilder]]></category>
		<category><![CDATA[TMG]]></category>

		<guid isPermaLink="false">http://www.themorphicgroup.com/blog/?p=262</guid>
		<description><![CDATA[Two TMG employees presenting at Flash Camp St. Louis this Friday at the City Museum, Ben Bishop and Jason Hanson. Should be a good time. If you are in St. Louis and have any interest in Flash, Flex, or Catalyst think about coming. Tickets still available. www.flashcampstlouis.com]]></description>
			<content:encoded><![CDATA[<p>Two TMG employees presenting at Flash Camp St. Louis this Friday at the City Museum, Ben Bishop and Jason Hanson.</p>
<p>Should be a good time.  If you are in St. Louis and have any interest in Flash, Flex, or Catalyst think about coming.  </p>
<p>Tickets still available.</p>
<p><a href="http://www.flashcampstlouis.com/">www.flashcampstlouis.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.themorphicgroup.com/blog/2009/09/08/flash-camp-st-louis-2009-this-friday/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More Memory for FlexBuilder</title>
		<link>http://www.themorphicgroup.com/blog/2009/08/14/more-memory-for-flexbuilder/</link>
		<comments>http://www.themorphicgroup.com/blog/2009/08/14/more-memory-for-flexbuilder/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 13:37:56 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[edit]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex Builder]]></category>
		<category><![CDATA[FlexBuilder]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[The Morphic Group]]></category>

		<guid isPermaLink="false">http://www.themorphicgroup.com/blog/?p=257</guid>
		<description><![CDATA[If you are like me and cannot stand long compile times you may find that increasing the memory allocation for FlexBuilder will help. To do this edit this file. Likewise, if FlexBuilder uses too much memory for your system you can make edits to this file. C:\Program Files\Adobe\Flex Builder 3\FlexBuilder.ini Here are my settings ### [...]]]></description>
			<content:encoded><![CDATA[<p>If you are like me and cannot stand long compile times you may find that increasing the memory allocation for FlexBuilder will help.  To do this edit this file.  Likewise, if FlexBuilder uses too much memory for your system you can make edits to this file.  </p>
<p>C:\Program Files\Adobe\Flex Builder 3\FlexBuilder.ini</p>
<p>Here are my settings<br />
###</p>
<p>-vmargs<br />
-Xms512m<br />
-Xmx1024m<br />
-XX:MaxPermSize=256m<br />
-XX:PermSize=64m<br />
-Djava.net.preferIPv4Stack=true</p>
<p>###<br />
-Xms512m (minimum memory allocated for FlexBuilder)<br />
-Xmx1024m (max memory cap for FlexBuilder)</p>
<p>If you happen to have 8GB of ram you might change your settings to this :).</p>
<p>-Xms512m<br />
-Xms4096m</p>
]]></content:encoded>
			<wfw:commentRss>http://www.themorphicgroup.com/blog/2009/08/14/more-memory-for-flexbuilder/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Flash ContextMenu</title>
		<link>http://www.themorphicgroup.com/blog/2009/07/06/contextmenu-copy-paste-delete/</link>
		<comments>http://www.themorphicgroup.com/blog/2009/07/06/contextmenu-copy-paste-delete/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 13:45:45 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[ContextMenu]]></category>
		<category><![CDATA[copy]]></category>
		<category><![CDATA[delete]]></category>
		<category><![CDATA[Flex Builder]]></category>
		<category><![CDATA[FlexBuilder]]></category>
		<category><![CDATA[paste]]></category>
		<category><![CDATA[rt-click menu]]></category>
		<category><![CDATA[The Morphic Group]]></category>

		<guid isPermaLink="false">http://www.themorphicgroup.com/blog/?p=166</guid>
		<description><![CDATA[Recently I attempted at add copy, paste, delete to a ContextMenu (rt-click menu) of a Flash movie. I quickly discovered that copy, paste, and delete are reserved words and cannot be used. I tried the trick of putting a space after the words, i.e. "copy ". That did not work. I found a decent work [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I attempted at add <strong>copy</strong>, <strong>paste</strong>, <strong>delete </strong>to a ContextMenu (rt-click menu) of a Flash movie.  I quickly discovered that copy, paste, and delete are reserved words and cannot be used.  I tried the trick of putting a space after the words, i.e. "copy ".  That did not work.  </p>
<p>I found a decent work around.  I added a non-breaking space to the end of each string and that was enough of a change to get copy, paste, and delete to show up in my context menu.  The unicode character for a non-breaking space is <strong>00A0</strong>.  The syntax looks like this "<strong>\u00A0</strong>".</p>
<pre class="actionscript3" style="font-family:monospace;">elementContextMenu = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=contextmenu%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:contextmenu.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">ContextMenu</span></a><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
elementContextMenu.<span style="color: #004993;">hideBuiltInItems</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> cutItem<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=contextmenuitem%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:contextmenuitem.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">ContextMenuItem</span></a> = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=contextmenuitem%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:contextmenuitem.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">ContextMenuItem</span></a><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;Cut<span style="">\u</span>00A0&quot;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #6699cc; font-weight: bold;">var</span> copyItem<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=contextmenuitem%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:contextmenuitem.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">ContextMenuItem</span></a> = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=contextmenuitem%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:contextmenuitem.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">ContextMenuItem</span></a><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;Copy<span style="">\u</span>00A0&quot;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #6699cc; font-weight: bold;">var</span> pasteItem<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=contextmenuitem%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:contextmenuitem.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">ContextMenuItem</span></a> = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=contextmenuitem%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:contextmenuitem.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">ContextMenuItem</span></a><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;Paste<span style="">\u</span>00A0&quot;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
cutItem.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><a href="http://www.google.com/search?q=contextmenuevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:contextmenuevent.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">ContextMenuEvent</span></a>.<span style="color: #004993;">MENU_ITEM_SELECT</span>, onCutItem<span style="color: #000000;">&#41;</span>;
copyItem.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><a href="http://www.google.com/search?q=contextmenuevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:contextmenuevent.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">ContextMenuEvent</span></a>.<span style="color: #004993;">MENU_ITEM_SELECT</span>, onCopyItem<span style="color: #000000;">&#41;</span>;
pasteItem.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><a href="http://www.google.com/search?q=contextmenuevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:contextmenuevent.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">ContextMenuEvent</span></a>.<span style="color: #004993;">MENU_ITEM_SELECT</span>, onPasteItem<span style="color: #000000;">&#41;</span>;
&nbsp;
elementContextMenu.<span style="color: #004993;">customItems</span>.<span style="color: #004993;">push</span><span style="color: #000000;">&#40;</span>cutItem<span style="color: #000000;">&#41;</span>;
elementContextMenu.<span style="color: #004993;">customItems</span>.<span style="color: #004993;">push</span><span style="color: #000000;">&#40;</span>copyItem<span style="color: #000000;">&#41;</span>;
elementContextMenu.<span style="color: #004993;">customItems</span>.<span style="color: #004993;">push</span><span style="color: #000000;">&#40;</span>pasteItem<span style="color: #000000;">&#41;</span>;
&nbsp;
Application.application.<span style="color: #004993;">contextMenu</span> = elementContextMenu;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.themorphicgroup.com/blog/2009/07/06/contextmenu-copy-paste-delete/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Notes: Adding SEO to a Flex web site</title>
		<link>http://www.themorphicgroup.com/blog/2009/06/11/notes-adding-seo-to-a-flex-web-site/</link>
		<comments>http://www.themorphicgroup.com/blog/2009/06/11/notes-adding-seo-to-a-flex-web-site/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 18:22:32 +0000</pubDate>
		<dc:creator>Unknown Morphician</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Deep linking]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Meta]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[sitemap]]></category>
		<category><![CDATA[Yahoo]]></category>

		<guid isPermaLink="false">http://www.themorphicgroup.com/blog/?p=69</guid>
		<description><![CDATA[SEO or Search engine optimization is the skill set that helps market your web site/application. It is the process of improving the search results of a web site in popular search engines, such as Yahoo and Google. What it all comes down to is how your web content, text, is presented and referenced into searches. [...]]]></description>
			<content:encoded><![CDATA[<p>SEO or Search engine optimization is the skill set that helps market your web site/application. It is the process of improving the search results of a web site in popular search engines, such as Yahoo and Google. What it all comes down to is how your web content, text, is presented and referenced into searches.  This process allows the search engines to effectively index or parse through your<br />
web content.</p>
<p>Search engines use “spiders” (scripted site crawlers),  that runs through the hierarchy paths of your content, looking for patterns and associated links based on text. There are guidelines to be followed when formatting your web pages. <a href="http://www.google.com/support/webmasters/bin/answer.py?answer=35769" target="_new">Google has these guidelines defined out</a>. This is pretty straight forward for web sites that only consist of text. For Flash/Flex media, it is not so easy. Most of these “spiders” can't index into binary modules.</p>
<p>Recently Google has made strives in solving this <a href="http://googlewebmastercentral.blogspot.com/2008/06/improved-flash-indexing.html" target="_new">issue</a>. They have advanced the ability to index text in flash content. If all of your text content is embedded in your Flash/Flex media, your web content will be found in a search.</p>
<p>The problem  is that most flash/flex web applications keep the text content external to the actual application. This allows the ability to change text without recompiling the application. External files can not be properly indexed in search engines alone [UPDATE: As of June 18, Google will index external content - <a title="google" href="http://googlewebmastercentral.blogspot.com/2009/06/flash-indexing-with-external-resource.html" target="_blank">google</a>]. There are techniques to do this in a flash application. Kenny Bunch of Dreamsocket has a great article on <a href="http://dreamsocket.com/support/articles/seo/seo-flash" target="new">Flash SEO</a>.</p>
<p>In a typical Flex application, you may be using deeplinks for paging sections of your application and external text data. I will discuss a technique to improve the search results for Flex applications that have external text content with deeplink functionality. Note: For the most part, I am following <a href="http://www.google.com/support/webmasters/bin/answer.py?answer=35769" target="new">Google guidelines</a>.</p>
<h2>Example Solution - <a title="Flash SEO" href="http://www2.themorphicgroup.com/projects/FlashSEO/" target="_blank">"My Company"</a></h2>
<p>Let's evaluate the content section of a example flex application. My application has three major sections: Home, About Us, and Clients. The “About Us” section has two sub-section Mission Statement and Company Location. The “Portfolio” section has two subsections as well, “Client List” and “Projects”.</p>
<p>Here is the hierarchy of the "My Company" site:</p>
<ul>
<li>Home</li>
<li>About Us
<ul>
<li>Mission Statement</li>
<li>Company Location</li>
</ul>
</li>
<li>Portfolio
<ul>
<li>Client List</li>
<li>Projects</li>
</ul>
</li>
</ul>
<p>The company site has one page (index.html) that loads the Flex application(swf) and external files (xml, images, video, and stylesheet css). All of the text content for these sections are kept in external XML files.</p>
<p>In essence, we need to break out the sections into html pages. If possible, avoid duplication of content.</p>
<ul>
<li>Add a reference to the section in the title tag. This should always be unique on every page.</li>
<li>The <a href="http://en.wikipedia.org/wiki/Meta_tag" target="_blank">meta description and keyword attributes</a> needs a unique and descriptive text.</li>
<li>Each page needs to link to each other via a series of anchor html tags.</li>
<li>Most importantly it needs to contain the particular text content that would pertain to the each page section. This does involve manually copying particular section from the xml to each<br />
html page, preferably into div tags.</li>
</ul>
<p><a href="http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&amp;productId=2&amp;postId=9563" target="_blank">Deeplinks</a> are being used for paging ability. We need to make sure that the deeplink can be changed with the different page sections. Every page will reference the root of the site with the particular deeplink moniker. This way each page will open the correct section when it is found in the search. I will use javascript to direct the page deeplink back to the relative root.</p>
<p><code><em>document.location.href = "/#portfolio";</em></code></p>
<p>The search engine should ignore the javascript and parse or read the text content, the basis of the search text.</p>
<p><a title="Flash SEO" href="http://www2.themorphicgroup.com/projects/FlashSEO/" target="_blank">"My Company"</a> example illustrates this functionality (right click application page to see and download source). SwfObject is used to reference the swf. The meta description and keywords are very general examples. Your project may involve much more thought into what information is used. It needs to be very detailed and unique.</p>
<p>With my "My Company" solution, I created html pages based on SEO concepts that can reference the Flex application. It should work as if nothing changed. The goal is to reference particular text content of web application, improving the search ability of the web site.</p>
<p>This solution does have one drawback. The text content is not centralized. You anticipate constant (monthly or weekly) changes are made to the external data. It will need to be changed in the particular page that references that particular content.</p>
<p>So a further discussion would be: Could we dynamically generate html pages that with the external data used? Of course. One idea is to use a server-side language like php or ruby to generate the site like we did with the static html solution.</p>
<h2>Verification and Sitemap</h2>
<p>To verify that your site will be viewed as expected by search engines, it should be viewable regardless of having the flash player installed or javascript enabled. The best way to check this is to view the site in a barebones a text-mode web browser like Lynx.  This is a tool I used to check this: <a href="http://www.yellowpipe.com/yis/tools/lynx/lynx_viewer.php" target="_new">lynx viewer</a></p>
<p>Next, you will need to create a sitemap for referencing the content of your web application. For the "My Company" site I would created a sitemap with all of the html pages I found a great resource that automates the process: <a href="http://www.sitemaps.org/protocol.php">sitemaps.org</a>. It also has some great information about what the sitemap consists of and what each attribute means. For the "My Company" site, I would create a sitemap with all of the html pages referenced.</p>
<p>Now submit your sitemap to a popular search engines (you may need to create an account). It may take up to a week to see real results.<br />
Yahoo: <a href="https://siteexplorer.search.yahoo.com/submit" target="new">Site Explorer</a><br />
Google Web master tools: <a href="http://www.google.com/support/webmasters/bin/answer.py?answer=34575&amp;cbid=1k07ny5fup4ym&amp;src=cb&amp;lev=answer" target="new">Webmasters</a></p>
<p>Note: The usage of these sources are beyond the scope of this article. I have found that the google webmaster tools are great for monitoring the progress of this functionality.</p>
<h2>Summary</h2>
<p>In this article, I gave some tips and a possible solution for getting your flex application noticed by the most popular search engines. It does take some trial and error to see results. In one project, it took some weeks of tweeking to the content to find the right results. I hope this article is helpful to you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.themorphicgroup.com/blog/2009/06/11/notes-adding-seo-to-a-flex-web-site/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Web Ads with ClickTags</title>
		<link>http://www.themorphicgroup.com/blog/2009/04/10/web-ads-with-clicktags/</link>
		<comments>http://www.themorphicgroup.com/blog/2009/04/10/web-ads-with-clicktags/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 20:54:47 +0000</pubDate>
		<dc:creator>Unknown Morphician</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[ClickTag]]></category>
		<category><![CDATA[flash cs3]]></category>
		<category><![CDATA[Web Ad]]></category>

		<guid isPermaLink="false">http://www.themorphicgroup.com/blog/?p=74</guid>
		<description><![CDATA[When creating web ads for third party companies, you maybe asked to add a clickTag, a reference to an external variable. The variable is passed from within the html Object/Embed tags via query string or FlashVar parameter. This allows an ad manager to track the click-through of the Flash SWF. Usually, the ad manager would [...]]]></description>
			<content:encoded><![CDATA[<p>When creating web ads for third party companies, you maybe asked to add a clickTag,<br />
a reference to an external variable. The variable is passed from within the html Object/Embed tags via query string or FlashVar parameter. This allows an ad manager to track the click-through of the<br />
Flash SWF. Usually, the ad manager would create an ad server value with the target url address. As the developer, you need to reference this variable from within your project.</p>
<p>Let's walk though a solution for building a Flash ad (in AS 3.0) with a clickTag. <em>Note: In most cases, ad companies and developers are required to use AS 2.0. There are plenty of great articles that discuss this implementation. There is an adobe article that is widely used <a href="http://www.adobe.com/resources/richmedia/tracking/designers_guide/" target="_new">Designer's Guide: Building Macromedia Flash Banners with Tracking Capabilities</a>. This article will not discuss this how to create ads with clickTags using AS 2.0 .</em></p>
<p>The ad manager will also want to prevent the click-through target from being blocked by any<br />
popup blockers. This usually the case with certain web browsers like IE 7.0+. Note: At this<br />
time there is a new Flash player version out (version 11). I don't know if this issue is fixed.</p>
<p style="margin-bottom: 0in;">So we have three requirements …</p>
<ul>
<li>
<p style="margin-bottom: 0in;">Get a reference to the clickTag 	variable</p>
</li>
<li>
<p style="margin-bottom: 0in;">Build your web ad with AS 3.0</p>
</li>
<li>
<p style="margin-bottom: 0in;">Handle the issue with the Popup 	Blockers</p>
</li>
</ul>
<p>Here is an example of code for satisfying these requirements.</p>
<p>html embed parameter<br />
...<br />
&lt;param name="FlashVars" value="clickTag=http://www.adserver.com/target.php?track=1123" /&gt;<br />
...</p>
<p>actionscript code</p>
<pre><code>
package
{

import flash.external.ExternalInterface;
import flash.net.navigateToURL;
import flash.net.URLRequest;

public class Main extends MovieClip
{
  private var paramList:Object;
  public var clickTag:String = ""; 

  function Main()
  {
    paramList = this.root.loaderInfo.parameters;

    if(paramList["clickTag"] != null)
    {
        clickTag = paramList["clickTag"];
    }

    clickTagBtn.addEventListener(MouseEvent.CLICK, onClick);

  } 

  function onClick( event:MouseEvent ):void
  {
    if( clickTag != ""  )
    {
      var req:URLRequest = new URLRequest(clickTag);

      if ( !ExternalInterface.available )
      {
        navigateToURL(req, "_blank");
      }
      else
      {
        var strUserAgent:String =
          String(ExternalInterface.call(
		"function() {return navigator.userAgent;}"
		)).toLowerCase();

        if ( strUserAgent.indexOf("firefox") != -1 )
        {
          ExternalInterface.call( "window.open", req.url, "_blank" );
        }
        else
        {
          if( strUserAgent.indexOf("msie") != -1 &amp;&amp;
            uint(strUserAgent.substr(strUserAgent.indexOf("msie") + 5, 3)) &gt;= 7 )
          {
            ExternalInterface.call("window.open", req.url, "_top");
          }
          else
          {
            navigateToURL(req, "_top");
          }
        }
      }
    }

  }

}

}

</code></pre>
<p>I am assuming that you are using Flash CS 3 or greater and that Main is your document class for your fla project.</p>
<p style="margin-bottom: 0in;">First I need to get the get the value of the clickTag.</p>
<ul>
<li>
<p style="margin-bottom: 0in;">Reference the 	loaderInfo.parameters as an Object and then reference the key value 	of clickTag.</p>
</li>
<li>
<p style="margin-bottom: 0in;">The character's case is very 	important. Letter case is important, otherwise you won't be able to 	reference this value.</p>
</li>
</ul>
<p style="margin-bottom: 0in;">
<p style="margin-bottom: 0in;">The key to handling the issue with popup blockers is to use a little javascript, with the help of External interface.</p>
<ul>
<li>
<p style="margin-bottom: 0in;">If ExternalInterface is not available, use 	NavigateToUrl directly.</p>
</li>
<li>
<p style="margin-bottom: 0in;">Get the userAgent (browser) 	information via javascript. I use this info to handle browser 	different quirks.</p>
</li>
<li>
<p style="margin-bottom: 0in;">Call the javascript method 	window.open to open the link specified by the clickTag value.  It is 	absolutely necessary to enable AllowScripting for “sameDomain” 	or “always” . Otherwise a security sandbox error will display.</p>
</li>
</ul>
<p>This solution should get you out of most jams in regards to ClickTag functionality using AS 3.0 .</p>
]]></content:encoded>
			<wfw:commentRss>http://www.themorphicgroup.com/blog/2009/04/10/web-ads-with-clicktags/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Setting Parameters With The Same Name Using URLVariables</title>
		<link>http://www.themorphicgroup.com/blog/2009/03/20/setting-parameters-with-the-same-name-using-urlvariables/</link>
		<comments>http://www.themorphicgroup.com/blog/2009/03/20/setting-parameters-with-the-same-name-using-urlvariables/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 12:34:54 +0000</pubDate>
		<dc:creator>Unknown Morphician</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Array]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[parameters]]></category>
		<category><![CDATA[URLVariables]]></category>

		<guid isPermaLink="false">http://www.themorphicgroup.com/blog/?p=77</guid>
		<description><![CDATA[The ability to set and send form parameters with the same name is available with URLVariables though it's not quite documented very well (at all?). Below are 4 examples of setting 2 values with same parameter name. The first example results in 1 parameter. The rest result in 2 parameters as expected. &#160; // results [...]]]></description>
			<content:encoded><![CDATA[<p>The ability to set and send form parameters with the same name is available with URLVariables though it's not quite documented very well (at all?).</p>
<p>Below are 4 examples of setting 2 values with same parameter name. The first example results in 1 parameter. The rest result in 2 parameters as expected.</p>
<pre class="actionscript3" style="font-family:monospace;">&nbsp;
<span style="color: #009900;">// results in 1 parameter</span>
<span style="color: #6699cc; font-weight: bold;">var</span> urlVarsA<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=urlvariables%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:urlvariables.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">URLVariables</span></a> = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=urlvariables%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:urlvariables.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">URLVariables</span></a><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
urlVarsA<span style="color: #000000;">&#91;</span><span style="color: #990000;">&quot;foo&quot;</span><span style="color: #000000;">&#93;</span> = <span style="color: #990000;">&quot;Hello&quot;</span>;
urlVarsA<span style="color: #000000;">&#91;</span><span style="color: #990000;">&quot;foo&quot;</span><span style="color: #000000;">&#93;</span> = <span style="color: #990000;">&quot;World!&quot;</span>; <span style="color: #009900;">// this overwrites the previous</span>
<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span>urlVarsA<span style="color: #000000;">&#41;</span>; <span style="color: #009900;">// foo=World%21</span>
&nbsp;
<span style="color: #009900;">// results in 2 parameters as expected</span>
<span style="color: #6699cc; font-weight: bold;">var</span> urlVarsB<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=urlvariables%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:urlvariables.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">URLVariables</span></a> = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=urlvariables%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:urlvariables.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">URLVariables</span></a><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
urlVarsB.<span style="color: #004993;">decode</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;foo=Hello&quot;</span><span style="color: #000000;">&#41;</span>;
urlVarsB.<span style="color: #004993;">decode</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;foo=World!&quot;</span><span style="color: #000000;">&#41;</span>; <span style="color: #009900;">// decode() has logic to detect existing params</span>
<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span>urlVarsB<span style="color: #000000;">&#41;</span>; <span style="color: #009900;">// foo=Hello&amp;foo=World%21</span>
&nbsp;
<span style="color: #009900;">// results in 2 parameters as expected</span>
<span style="color: #6699cc; font-weight: bold;">var</span> urlVarsC<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=urlvariables%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:urlvariables.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">URLVariables</span></a> = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=urlvariables%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:urlvariables.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">URLVariables</span></a><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;foo=Hello&amp;foo=World!&quot;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span>urlVarsC<span style="color: #000000;">&#41;</span>; <span style="color: #009900;">// foo=Hello&amp;foo=World%21</span>
&nbsp;
<span style="color: #009900;">// results in 2 parameters as expected</span>
<span style="color: #6699cc; font-weight: bold;">var</span> urlVarsD<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=urlvariables%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:urlvariables.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">URLVariables</span></a> = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=urlvariables%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:urlvariables.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">URLVariables</span></a><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
urlVarsD<span style="color: #000000;">&#91;</span><span style="color: #990000;">&quot;foo&quot;</span><span style="color: #000000;">&#93;</span> = <span style="color: #000000;">&#91;</span><span style="color: #990000;">&quot;Hello&quot;</span>, <span style="color: #990000;">&quot;World!&quot;</span><span style="color: #000000;">&#93;</span>; <span style="color: #009900;">// Arrays are special to URLVariables</span>
<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span>urlVarsD<span style="color: #000000;">&#41;</span>; <span style="color: #009900;">// foo=Hello&amp;foo=World%21</span>
&nbsp;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.themorphicgroup.com/blog/2009/03/20/setting-parameters-with-the-same-name-using-urlvariables/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Deconstruction and reconstruction of a ByteArray</title>
		<link>http://www.themorphicgroup.com/blog/2008/12/02/deconstruction-and-reconstruction-of-a-bytearray/</link>
		<comments>http://www.themorphicgroup.com/blog/2008/12/02/deconstruction-and-reconstruction-of-a-bytearray/#comments</comments>
		<pubDate>Tue, 02 Dec 2008 17:59:57 +0000</pubDate>
		<dc:creator>Unknown Morphician</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[ByteArray]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.themorphicgroup.com/blog/?p=59</guid>
		<description><![CDATA[Many times you may come up with tasks that seem pretty straight forward but involve a bit of researching. In a recent project, I needed to find a way pass a dynamically generated image from one flex application (swf) to another. My senior developer suggested that I pass the ByteArray data of the image via [...]]]></description>
			<content:encoded><![CDATA[<p>Many times you may come up with tasks that seem pretty straight forward but involve a bit of researching. In a recent project, I needed to find a way pass a dynamically generated image from one flex application (swf) to another. My senior developer suggested that I pass the ByteArray data of the image via local connection. But there is one small problem. There is a size limit for local connection, 40K. So the original data needs to be cut into smaller pieces, sent via LC and then reconstructed into the complete image data. (Note: LC = Local Connection)</p>
<p>I would suggest creating a unique local connection name between your applications (swfs). Check out Joey’s blog on this task - <a href="http://www.themorphicgroup.com/blog/2008/05/30/unique-local-connection-names/" target="_blank">unique local connection names</a>. In this project summary, I will not reference a unique connection name.</p>
<p>Here is the set up… In the first swf, I’ve set up a LC object (transSendLC) and an image object (imgOriginal). The second app (swf) somewhat mimics the first app (swf). The only difference is that I created a custom class, inheriting from LC. I’ve added a method for receiving the ByteArray and a Bitmap object. The bitmap object can be used to bind to the Image source. Note: You don’t need to create a custom class. I found that it made sense for my particular flex project.</p>
<p>Within my first app (swf), I have supplied an image (imgOriginal). Now with I need to chop up the data and send it to the second app (swf).</p>
<pre>
<code>
Example Code:
...
var width:Number = imgOriginal.width
var height:Number = imgOriginal.height;
var bytes:ByteArray =
   imgOriginal.bitmapData.getPixels(new Rectangle(0, 0, width, height))

var tempByteArray:ByteArray;

// limit byteArray to 40K - localconnection limit
var byteLimit:uint = uint(40000);

if(bytes.length &gt; byteLimit){

   var currentSize:uint = byteLimit;
   var position:uint = 0;
   var totalSize:uint = 0;

   while(totalSize &lt; bytes.length){
      tempByteArray = new ByteArray();
      tempByteArray.length = currentSize;

      // Write bytes from position to current size
      tempByteArray.writeBytes(bytes, position, currentSize);

      //send ByteArray chunk
      transSendLC.send(uniqueLCName, "sendSnapShot",
              tempByteArray, bytes.length, width, height);

      //get current total and get next position
      totalSize = totalSize + tempByteArray.length;
      position = totalSize;

      //set current size based on limit
      currentSize = bytes.length - totalSize;
      if(currentSize &gt;  byteLimit){
         currentSize = byteLimit;
      }
  }
  else{
     //less than limit - send Byte Array
     bytes.writeBytes(tempByteArray, 0, uint(bytes.length));
     imgLCSend.send(uniqueLCName, "sendByteArrayData",
                 tempByteArray, bytes.length, width, height);
  }
...
</code>
</pre>
<p>Next in my second app (swf), I need to build the sendCopy method within my custom object (inheriting from LC). Note: It is assumed that you have logic to connect the shared local connection name, a Bitmap and a ByteArray object in your custom class.</p>
<pre>
<code>
Example Code:
public function sendByteArrayData(bytes:Object, bytesLength:Number,
                              width:Number, height:Number):void {
   var byteArray:ByteArray = bytes as ByteArray;

   //New ByteArray size
   if(byteArraySnapShot == null){
      byteArraySnapShot = new ByteArray();
      byteArraySnapShot.length = bytesLength;
      byteArraySnapShot.position = 0;
   }

   //Write byte array
   byteArraySnapShot.writeBytes(byteArray);

   //Once length/size is filled based on total bytes create bitmap
   if(byteArraySnapShot.bytesAvailable == 0){
      var bitmapDataSnapShot:BitmapData = new BitmapData(width, height);
      byteArraySnapShot.position = 0;
      bitmapDataSnapShot.setPixels(new Rectangle(0, 0, width, height),
            byteArraySnapShot);

      var bitmapSnapShot:Bitmap = new Bitmap(bitmapDataSnapShot);
      snapShotImg = bitmapSnapShot;

      byteArraySnapShot = null;
   }

}

</code>
</pre>
<p>There perhaps a few ways to achieve the functionality.  My purpose here is to show the process of reading and writing ByteArray in a real world application set. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.themorphicgroup.com/blog/2008/12/02/deconstruction-and-reconstruction-of-a-bytearray/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Using FlexBuilder 3 to debug &amp; edit Flash CS3 projects</title>
		<link>http://www.themorphicgroup.com/blog/2008/05/16/10/</link>
		<comments>http://www.themorphicgroup.com/blog/2008/05/16/10/#comments</comments>
		<pubDate>Fri, 16 May 2008 19:00:40 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[debugger]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[edit]]></category>
		<category><![CDATA[flash cs3]]></category>
		<category><![CDATA[Flex Builder]]></category>
		<category><![CDATA[FlexBuilder]]></category>
		<category><![CDATA[hello world]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.themorphicgroup.com/blog/?p=10</guid>
		<description><![CDATA[Recently I was working on a project that due to a requirement had to be compiled in Flash CS3. Having spent the last few years exclusively using FlexBuilder I was shocked at the HORRIBLE AS3 editor and debugger in Flash CS3. I quickly tried to figure out how to edit and debug from FlexBuilder 3. [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I was working on a project that due to a requirement had to be compiled in Flash CS3.  Having spent the last few years exclusively using FlexBuilder I was shocked at the HORRIBLE AS3 editor and debugger in Flash CS3.  I quickly tried to figure out how to edit and debug from FlexBuilder 3.  I got some help along the way, and wanted to share the process.</p>
<p>Step 1: (FB3) Create a new ActionScript project in Flex Builder 3 and give it a name.</p>
<p><img src="http://i162.photobucket.com/albums/t253/jayfour000/new_as3_project.gif" border="0" alt="Photobucket" /></p>
<p><img src="http://i162.photobucket.com/albums/t253/jayfour000/name_as3_project.gif" border="0" alt="Photobucket" /></p>
<p>Step 2: (Flash CS3) Make a new Flash CS3 project, save it in the SAME DIRECTORY as the AS3 project.</p>
<p><img src="http://i162.photobucket.com/albums/t253/jayfour000/new_cs3_project.gif" border="0" alt="Photobucket" /></p>
<p><img src="http://i162.photobucket.com/albums/t253/jayfour000/name_cs3_project.gif" border="0" alt="Photobucket" /></p>
<p>Step 3: (Flash CS3) Open up File --&gt; Publish Settings in your Flash CS3 project and select "Permit debugging".</p>
<p><img src="http://i162.photobucket.com/albums/t253/jayfour000/permit_debuging.gif" border="0" alt="Photobucket" /></p>
<p>Step 4: (Flash CS3) Click on the Settings button and enter the name of your main AS3 class.  If your main AS3 class is not in the same directory as the FLA then add the directory as a Classplath.  Click the green check mark to validate the class location.</p>
<p><img src="http://i162.photobucket.com/albums/t253/jayfour000/document_class.gif" border="0" alt="Photobucket" /></p>
<p>Step 5: (FB3) Write a bit of code and put in a break point.</p>
<p><img src="http://i162.photobucket.com/albums/t253/jayfour000/write_code.gif" border="0" alt="Photobucket" /></p>
<p>Step 6: (Flash CS3) Compile a debug version of the SWF.  The breakpoint you entered in FB3 will be compiled into the SWF.  After it compiles and opens in the Flash CS3 debugger just close it.  The SWF should have been compiled into the root of your FB3 project.  I had to quit FB3 and reopen it for the SWF to show up.</p>
<p><img src="http://i162.photobucket.com/albums/t253/jayfour000/debug_movie.gif" border="0" alt="Photobucket" /></p>
<p><img src="http://i162.photobucket.com/albums/t253/jayfour000/swf_in_fb_project.gif" border="0" alt="Photobucket" /></p>
<p>Step 7: (FB3) Make a new debugging profile that points directly to the Flash CS3 complied SWF (NOT THE FB3 SWF in the bin directory).</p>
<p><img src="http://i162.photobucket.com/albums/t253/jayfour000/new_debug_profile.gif" border="0" alt="Photobucket" /></p>
<p><img src="http://i162.photobucket.com/albums/t253/jayfour000/new_debug_profile_2.gif" border="0" alt="Photobucket" /></p>
<p>Step 8: (FB3) Debug with your new profile.</p>
<p><img src="http://i162.photobucket.com/albums/t253/jayfour000/debug_it.gif" border="0" alt="Photobucket" /></p>
<p><img src="http://i162.photobucket.com/albums/t253/jayfour000/debug_working.gif" border="0" alt="Photobucket" /></p>
<p>If the debugger times-out and does not connect you may need to configure the debugger setting in your Flash Player.  Do this by rt-clicking on the SWF and selecting Debugger.</p>
<p><img src="http://i162.photobucket.com/albums/t253/jayfour000/flash_debugger.gif" border="0" alt="Photobucket" /></p>
<p>This workflow allows for you to use the code hinting and debugger in FlexBuilder 3 even when compiling in Flash CS3.  Let me know if you run into any problems.</p>
<p>Special thanks to Melih Elibol who helped me with some of these steps :).</p>
<p>--jason</p>
]]></content:encoded>
			<wfw:commentRss>http://www.themorphicgroup.com/blog/2008/05/16/10/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
	</channel>
</rss>
