<?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; Uncategorized</title>
	<atom:link href="http://www.themorphicgroup.com/blog/category/uncategorized/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>The Morphic Group&#8217;s IRL Race Control Nominated for 2010 Webby</title>
		<link>http://www.themorphicgroup.com/blog/2010/02/22/the-morphic-groups-irl-race-control-nominated-for-2010-webby/</link>
		<comments>http://www.themorphicgroup.com/blog/2010/02/22/the-morphic-groups-irl-race-control-nominated-for-2010-webby/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 18:20:39 +0000</pubDate>
		<dc:creator>Sam Roach</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.themorphicgroup.com/blog/?p=366</guid>
		<description><![CDATA[The Morphic Group is proud to announce that Indycar Race Control has been nominated for a 2010 Webby Award ! Congradulations to everyone at The Morphic Group. :) Indycar Race Control is a fully immersive way to experience Indy Racing. Not only can you watch the live race or in-car video but you can monitor [...]]]></description>
			<content:encoded><![CDATA[<p>The Morphic Group is proud to announce that Indycar Race Control has been nominated for a 2010 Webby Award ! Congradulations to everyone at The Morphic Group. :)</p>
<p><a href="http://www.themorphicgroup.com/blog/wp-content/uploads/2009/09/tmgindy.jpg"><img src="http://www.themorphicgroup.com/blog/wp-content/uploads/2009/09/racecontrol300.png" border="none" alt="" width="361" height="275" /></a></p>
<p>Indycar Race Control is a fully immersive way to experience Indy Racing. Not only<br />
can you watch the live race or in-car video but you can monitor each car's<br />
telemetry data. Here are just some of the features:</p>
<ul>
<li>Live race and in-car video (up to 5 simultaneous videos)</li>
<li>Real-time car telemetry (speed, throttle, RMP, steering, etc)</li>
<li>Switch any in-car camera to full view and listen to driver &amp; pit crew</li>
<li>Race standings and scoring</li>
<li>Configurable driver 'pods' allowing individually drivers to be tracked</li>
<li>Customizable layouts</li>
<li>2 driver compete mode</li>
<li>Fullscreen mode</li>
</ul>
<p>Indy Race Control is only available during live Indy Races, please visit <a href="http://downforce.indycar.com/racecontrol/" target="_blank"><strong>indycar.com</strong></a><br />
for more information on race dates.</p>
<h2>Indycar Race Control Technical Details</h2>
<p>Indy Race Control is an Adobe Flex application created by The Morphic Group that receives<br />
live streaming video and live telemetry data from the race track during a race.</p>
<p><strong>Race &amp; in-car video</strong><br />
During an Indy car race live video and in-car video are encoded and redistributed from a<br />
Flash Video CDN. Each video stream is encoded at multiple sizes. The Indy Race Control<br />
Flex client is given information on which cars have in-car video and which is the main<br />
video feed. The client allows any of the in-car videos to be switch from the small viewer<br />
to the main viewer.</p>
<p><strong>Real-time race car telemetry</strong><br />
Each car's live telemetry data is acquired by a cluster of Wowza servers. The Indy Race<br />
Control Flex client connects to a Wowza server via a load balanced cluster living on<br />
Amazon EC2. After connecting the client receives real-time race car telemetry data.<br />
The Morphic Group create a Wowza based application that can scale to multiple<br />
thousands of simulations clients.</p>
<p><strong>Video Statistics</strong><br />
Conviva's LivePass gives Indy Racing the ability to view real-time statistics of video<br />
streams being watched with the Indy Race Control.</p>
<p><strong>Indy Racing Control Flex Client</strong><br />
The user interface was created by The Morphic Group using Adobe Flex. This Flex based<br />
client provides the race fan with a huge amount of information displayed in friendly<br />
and useful way. The user can customize the application to meet their needs. Specific<br />
drivers and/or videos can be selected, and these custom layous can be saved.</p>
<p>Visit <a href="http://downforce.indycar.com/racecontrol/" target="_blank"><strong>indycar.com</strong></a> to view Indy Race Control during races.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.themorphicgroup.com/blog/2010/02/22/the-morphic-groups-irl-race-control-nominated-for-2010-webby/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>“Content Assist” did not complete normally &#8211; bat file workaround</title>
		<link>http://www.themorphicgroup.com/blog/2009/11/03/%e2%80%9ccontent-assist%e2%80%9d-did-not-complete-normally-bat-file-workaround/</link>
		<comments>http://www.themorphicgroup.com/blog/2009/11/03/%e2%80%9ccontent-assist%e2%80%9d-did-not-complete-normally-bat-file-workaround/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 15:34:55 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flash Builder]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Adobe Flash Builder 4]]></category>
		<category><![CDATA[com.adobe.flexbuilder.codemodel]]></category>
		<category><![CDATA[Content Assist]]></category>
		<category><![CDATA[Flash Builder 4 beta 2]]></category>
		<category><![CDATA[Flex Builder]]></category>
		<category><![CDATA[FlexBuilder]]></category>
		<category><![CDATA[FlexBuiler]]></category>

		<guid isPermaLink="false">http://www.themorphicgroup.com/blog/?p=334</guid>
		<description><![CDATA[Follow up to my last post. I am having to do this enough that I wrote a bat file for it. Here is what it looks like if anyone is interested. Just copy and paste the code below into a notepad and save as a .bat file. I put mine in the root of my [...]]]></description>
			<content:encoded><![CDATA[<p>Follow up to my last post.  I am having to do this enough that I wrote a bat file for it.  Here is what it looks like if anyone is interested.  Just copy and paste the code below into a notepad and save as a .bat file.  I put mine in the root of my C: drive so I can simple do Start-->Run-->fix_content_assist.bat</p>
<p>fix_content_assist.bat<br />
<code><br />
@echo off<br />
REM The following will delete the prefs file in Flash Builder 4 Beta 2 that caused content assist to break<br />
RMDIR C:\work\dev\morphic\myproject\trunk\code\as_fb4\.metadata\.plugins\com.adobe.flexbuilder.codemodel /s /q<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.themorphicgroup.com/blog/2009/11/03/%e2%80%9ccontent-assist%e2%80%9d-did-not-complete-normally-bat-file-workaround/feed/</wfw:commentRss>
		<slash:comments>0</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>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>How to Create a Spark Icon Button and Skin</title>
		<link>http://www.themorphicgroup.com/blog/2009/06/18/how-to-create-a-spark-icon-button-and-skin/</link>
		<comments>http://www.themorphicgroup.com/blog/2009/06/18/how-to-create-a-spark-icon-button-and-skin/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 18:39:29 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.themorphicgroup.com/blog/?p=83</guid>
		<description><![CDATA[With the new spark components in MXML 2009 you may have noticed there is not longer an "icon" style property you can set for a button. So what do you do if you want an icon in your button? One solution is to put the icon in your button skin, but this would require you [...]]]></description>
			<content:encoded><![CDATA[<p>With the new spark components in MXML 2009 you may have noticed there is not longer an "icon" style property you can set for a button. So what do you do if you want an icon in your button?</p>
<p>One solution is to put the icon in your button skin, but this would require you to build multiple skins for multiple icons.</p>
<p>Another solution is to use an Image component as a button. However, let's say we want to have different icons used for different rollover states. We could definitely use MouseEvent event listeners to switch the source property of the Image component. Unfortunately, transparent pixels in an image have been known to cause problems with MouseEvents firing properly. To avoid these type of pitfalls, we are going to create our own custom component by doing the following:<br />
<span id="more-83"></span></p>
<div><strong>Create a new IconButton class that extends spark.components.Button</strong></div>
<div>
<pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> com.tmg.components
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> spark.components.Button;
&nbsp;
	<span style="color: #009900;">//icons</span>
	<span style="color: #000000;">&#91;</span>Style<span style="color: #000000;">&#40;</span><span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;iconUp&quot;</span>,<span style="color: #004993;">type</span>=<span style="color: #990000;">&quot;*&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
	<span style="color: #000000;">&#91;</span>Style<span style="color: #000000;">&#40;</span><span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;iconOver&quot;</span>,<span style="color: #004993;">type</span>=<span style="color: #990000;">&quot;*&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
	<span style="color: #000000;">&#91;</span>Style<span style="color: #000000;">&#40;</span><span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;iconDown&quot;</span>,<span style="color: #004993;">type</span>=<span style="color: #990000;">&quot;*&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
	<span style="color: #000000;">&#91;</span>Style<span style="color: #000000;">&#40;</span><span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;iconDisabled&quot;</span>,<span style="color: #004993;">type</span>=<span style="color: #990000;">&quot;*&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
	<span style="color: #009900;">//paddings</span>
	<span style="color: #000000;">&#91;</span>Style<span style="color: #000000;">&#40;</span><span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;paddingLeft&quot;</span>,<span style="color: #004993;">type</span>=<span style="color: #990000;">&quot;Number&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
	<span style="color: #000000;">&#91;</span>Style<span style="color: #000000;">&#40;</span><span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;paddingRight&quot;</span>,<span style="color: #004993;">type</span>=<span style="color: #990000;">&quot;Number&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
	<span style="color: #000000;">&#91;</span>Style<span style="color: #000000;">&#40;</span><span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;paddingTop&quot;</span>,<span style="color: #004993;">type</span>=<span style="color: #990000;">&quot;Number&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
	<span style="color: #000000;">&#91;</span>Style<span style="color: #000000;">&#40;</span><span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;paddingBottom&quot;</span>,<span style="color: #004993;">type</span>=<span style="color: #990000;">&quot;Number&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> IconButton extends Button
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> IconButton<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre>
</div>
<div>
<p>In this class we define Style Metadata tags to let Flash Builder know what styles are available for this component in addition to the default style properties of Button. With this component, we want the developer to be able to specify images for different states of the button. We also want to give the developer the ability to specify the padding around the elements of our button.</p>
</div>
<div><strong>Create a skin mxml component</strong></div>
<div>
<pre class="mxml" style="font-family:monospace;">&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SparkSkin</span></span>
<span style="color: #000000;">	xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">	xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">	xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/halo&quot;</span></span>
<span style="color: #000000;">	currentStateChanging=<span style="color: #ff0000;">&quot;onCurrentStateChanging(event)&quot;</span></span>
<span style="color: #000000;">	<span style="color: #7400FF;">&gt;</span></span>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Metadata</span><span style="color: #7400FF;">&gt;</span></span>
		[HostComponent(&quot;com.freckle.oceania.client.view.components.IconButton&quot;)]
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Metadata</span><span style="color: #7400FF;">&gt;</span></span>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
		<span style="color: #000000;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span>
<span style="color: #000000;">			import mx.events.StateChangeEvent;</span>
&nbsp;
<span style="color: #000000;">			private function onCurrentStateChanging<span style="color: #66cc66;">&#40;</span>event:StateChangeEvent<span style="color: #66cc66;">&#41;</span>:void<span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">				switch<span style="color: #66cc66;">&#40;</span>event.newState<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">					case <span style="color: #ff0000;">&quot;up&quot;</span>:</span>
<span style="color: #000000;">						setIcon<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;iconUp&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">						break;</span>
<span style="color: #000000;">					case <span style="color: #ff0000;">&quot;over&quot;</span>:</span>
<span style="color: #000000;">						setIcon<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;iconOver&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">						break;</span>
<span style="color: #000000;">					case <span style="color: #ff0000;">&quot;down&quot;</span>:</span>
<span style="color: #000000;">						setIcon<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;iconDown&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">						break;</span>
<span style="color: #000000;">					case <span style="color: #ff0000;">&quot;disabled&quot;</span>:</span>
<span style="color: #000000;">						setIcon<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;iconDisabled&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">						break;</span>
<span style="color: #000000;">				<span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">			<span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">			private function setIcon<span style="color: #66cc66;">&#40;</span>type:String<span style="color: #66cc66;">&#41;</span>:void<span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">				if<span style="color: #66cc66;">&#40;</span>hostComponent.getStyle<span style="color: #66cc66;">&#40;</span>type<span style="color: #66cc66;">&#41;</span> != null<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">					icon.source = hostComponent.getStyle<span style="color: #66cc66;">&#40;</span>type<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">				<span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">			<span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">		<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #7400FF;">&gt;</span></span>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:layout</span><span style="color: #7400FF;">&gt;</span></span>
		<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:BasicLayout</span><span style="color: #7400FF;">/&gt;</span></span>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:layout</span><span style="color: #7400FF;">&gt;</span></span>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:states</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:State</span> name=<span style="color: #ff0000;">&quot;up&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:State</span> name=<span style="color: #ff0000;">&quot;over&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:State</span> name=<span style="color: #ff0000;">&quot;down&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:State</span> name=<span style="color: #ff0000;">&quot;disabled&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:states</span><span style="color: #7400FF;">&gt;</span></span> 
&nbsp;
 	<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> left=<span style="color: #ff0000;">&quot;0&quot;</span> right=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> bottom=<span style="color: #ff0000;">&quot;0&quot;</span> width=<span style="color: #ff0000;">&quot;69&quot;</span> height=<span style="color: #ff0000;">&quot;20&quot;</span> radiusX=<span style="color: #ff0000;">&quot;2&quot;</span> radiusY=<span style="color: #ff0000;">&quot;2&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:stroke</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColorStroke</span> id=<span style="color: #ff0000;">&quot;outline&quot;</span> weight=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:stroke</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
        	<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:LinearGradient</span><span style="color: #7400FF;">&gt;</span></span>
        		<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:GradientEntry</span> color=<span style="color: #ff0000;">&quot;#ffffff&quot;</span> ratio=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
        		<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:GradientEntry</span> color=<span style="color: #ff0000;">&quot;#cccccc&quot;</span> ratio=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
        	<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:LinearGradient</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
 	<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Group</span></span>
<span style="color: #000000;"> 		horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;"> 		verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;"> 		<span style="color: #7400FF;">&gt;</span></span>
 		<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:layout</span><span style="color: #7400FF;">&gt;</span></span>
 			<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:HorizontalLayout</span></span>
<span style="color: #000000;"> 				paddingBottom=<span style="color: #ff0000;">&quot;{ hostComponent.getStyle('paddingBottom')}&quot;</span></span>
<span style="color: #000000;"> 				paddingTop=<span style="color: #ff0000;">&quot;{ hostComponent.getStyle('paddingTop')}&quot;</span></span>
<span style="color: #000000;"> 				paddingLeft=<span style="color: #ff0000;">&quot;{ hostComponent.getStyle('paddingLeft')}&quot;</span></span>
<span style="color: #000000;"> 				paddingRight=<span style="color: #ff0000;">&quot;{ hostComponent.getStyle('paddingRight')}&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
 		<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:layout</span><span style="color: #7400FF;">&gt;</span></span>
 		<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Image</span></span>
<span style="color: #000000;">	    	id=<span style="color: #ff0000;">&quot;icon&quot;</span></span>
<span style="color: #000000;">	    	source=<span style="color: #ff0000;">&quot;{hostComponent.getStyle('iconUp')}&quot;</span></span>
<span style="color: #000000;">	    	verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">	    	alpha=<span style="color: #ff0000;">&quot;{(this.currentState == 'up')?.5:1}&quot;</span></span>
<span style="color: #000000;">	    	<span style="color: #7400FF;">/&gt;</span></span>
	    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SimpleText</span></span>
<span style="color: #000000;">	    	text=<span style="color: #ff0000;">&quot;{hostComponent.label}&quot;</span></span>
<span style="color: #000000;">	    	verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">	    	includeInLayout=<span style="color: #ff0000;">&quot;{( hostComponent.label != '' )}&quot;</span></span>
<span style="color: #000000;">	    	visible=<span style="color: #ff0000;">&quot;{( hostComponent.label != '' )}&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
 	<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Group</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:SparkSkin</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;</pre>
</div>
<p>One of the first things you may notice is the Metadata tag declaring the Hostcomponent. This is important because it lets this skin component know what kind of component will be using this skin. Note the SimpleText component's text property is set to the hostComponent's label property.</p>
<p>Another key element to this piece of code is the event handler for when the state changes. As you may have guessed from the contents of the states tag, the hostComponent changes the state of this skin for the different button mouse states. By listening to this event, we can change the current source of the icon image component.</p>
<p>This brings us to our last step...</p>
<div><strong>Implement the new component</strong></div>
<div>
<pre class="mxml" style="font-family:monospace;"><span style="color: #000000;"><span style="color: #7400FF;">&lt;components:IconButton</span></span>
<span style="color: #000000;">		width=<span style="color: #ff0000;">&quot;100%&quot;</span></span>
<span style="color: #000000;">		iconUp=<span style="color: #ff0000;">&quot;assets/images/icons/toolbar/arrow_out.png&quot;</span></span>
<span style="color: #000000;">		iconDisabled=<span style="color: #ff0000;">&quot;assets/images/icons/toolbar/arrow_out_disabled.png&quot;</span></span>
<span style="color: #000000;">		fontFamily=<span style="color: #ff0000;">&quot;Times&quot;</span></span>
<span style="color: #000000;">		fontWeight=<span style="color: #ff0000;">&quot;bold&quot;</span></span>
<span style="color: #000000;">		skinClass=<span style="color: #ff0000;">&quot;com.tmg.skins.IconButtonSkin&quot;</span></span>
<span style="color: #000000;">		paddingLeft=<span style="color: #ff0000;">&quot;5&quot;</span></span>
<span style="color: #000000;">		paddingTop=<span style="color: #ff0000;">&quot;5&quot;</span></span>
<span style="color: #000000;">		paddingRight=<span style="color: #ff0000;">&quot;5&quot;</span></span>
<span style="color: #000000;">		paddingBottom=<span style="color: #ff0000;">&quot;5&quot;</span></span>
<span style="color: #000000;">		<span style="color: #7400FF;">/&gt;</span></span>
&nbsp;</pre>
</div>
<p>When implementing your own skins, be sure to set the skinClass property. In this implementation we just set the iconUp and iconDisabled properties. Because of how we wrote the set icon method in our skin, the skin will only use the icons that have been declared. As for the label, we have also coded the skin to not show the text component if the label text is empty, but in this case we do have a label.</p>
<div><strong>Summary</strong></div>
<p>So there you have it, a brand new component that uses the new MXML 2009 Spark architecture for skinning. With this new approach, we can break out our UI code into it's own file/component. A benefit of this new method is that we don't have much code in the actual component class. By using component skins, we can not only define the look via MXML but we can also add some logic/code. For example, it would be really easy to add a method that spins the icon on rollover or to change the text of label when disabled.</p>
<p>For more information about this, check out: <a href="https://xd.adobe.com/#/videos/video/165">https://xd.adobe.com/#/videos/video/165</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.themorphicgroup.com/blog/2009/06/18/how-to-create-a-spark-icon-button-and-skin/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Ben Bishop joins The Morphic Group</title>
		<link>http://www.themorphicgroup.com/blog/2009/04/11/ben-bishop-joins-the-morphic-group/</link>
		<comments>http://www.themorphicgroup.com/blog/2009/04/11/ben-bishop-joins-the-morphic-group/#comments</comments>
		<pubDate>Sat, 11 Apr 2009 15:07:49 +0000</pubDate>
		<dc:creator>Sam Roach</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.themorphicgroup.com/blog/?p=79</guid>
		<description><![CDATA[We are happy to announce that Ben Bishop has joined The Morphic Group. Ben brings his interactive development expertise and professional process to our team. Having worked with Ben on past projects, we had the advantage of knowing the level of code and attention to detail that Ben brings to his work. Again we are [...]]]></description>
			<content:encoded><![CDATA[<p>We are happy to announce that Ben Bishop has joined The Morphic Group.</p>
<p>Ben brings his interactive development expertise and professional process to our team. Having worked with Ben on past projects, we had the advantage of knowing the level of code and attention to detail that Ben brings to his work.</p>
<p>Again we are delighted to have Ben aboard...welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.themorphicgroup.com/blog/2009/04/11/ben-bishop-joins-the-morphic-group/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Morphic Group Welcomes Ash Atkins</title>
		<link>http://www.themorphicgroup.com/blog/2009/04/11/the-morphic-group-welcomes-ash-atkins/</link>
		<comments>http://www.themorphicgroup.com/blog/2009/04/11/the-morphic-group-welcomes-ash-atkins/#comments</comments>
		<pubDate>Sat, 11 Apr 2009 15:05:03 +0000</pubDate>
		<dc:creator>Sam Roach</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.themorphicgroup.com/blog/?p=80</guid>
		<description><![CDATA[We are pleased to announce that Ash Atkins has joined The Morphic Group. Ash is a highly focused seasoned senior software developer, with a well known reputation for delivering quality code on every project.  Co-author of " Adobe Air in Action", Ash also brings to the table a wealth of knowledge which has benefited the [...]]]></description>
			<content:encoded><![CDATA[<p>We are pleased to announce that Ash Atkins has joined The Morphic Group.</p>
<p>Ash is a highly focused seasoned senior software developer, with a well known reputation for delivering quality code on every project.  Co-author of " Adobe Air in Action", Ash also brings to the table a wealth of knowledge which has benefited the greater development community and will no doubt be a great asset to The Morphic Group and it's clientele.</p>
<p>Having worked with Ash in the past, we know The Morphic Group has added another great talent to the team.</p>
<p>Welcome to The Morphic Group.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.themorphicgroup.com/blog/2009/04/11/the-morphic-group-welcomes-ash-atkins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disable Caching In Firefox</title>
		<link>http://www.themorphicgroup.com/blog/2009/03/09/disable-caching-in-firefox/</link>
		<comments>http://www.themorphicgroup.com/blog/2009/03/09/disable-caching-in-firefox/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 19:45:00 +0000</pubDate>
		<dc:creator>Joey</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Caching]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Flex Builder]]></category>

		<guid isPermaLink="false">http://www.themorphicgroup.com/blog/?p=75</guid>
		<description><![CDATA[This is a silly post. I'm going to write something that probably everyone else in the whole Flex world already knows. But I didn't know this. And it was helpful for me. For a project I'm working on we are having to integrate a feature that uses a .swc provided by the client. This feature, [...]]]></description>
			<content:encoded><![CDATA[<p>This is a silly post. I'm going to write something that probably everyone else in the whole Flex world already knows. But I didn't know this. And it was helpful for me.</p>
<p>For a project I'm working on we are having to integrate a feature that uses a .swc provided by the client. This feature, which we are merely integrating and didn't have technical control over the implementation, requires that the Flex application run from a Web server (from an http directive, not from a file directive) in the browser or it won't work. I thought that was annoying, but I realized just how annoying it really was after I ran it from Apache (which I just installed on my machine for this purpose) and my new trace statements didn't show up. After a few minutes I realized it was because the .swf was cached by Firefox. I could clear the cache every time just before running the application. But that was not a very workable solution. instead, I wanted to disable caching entirely.</p>
<p>The way I found to disable caching from Firefox is to run Firefox and in the address bar type about:config. This will take you to a page with a datagrid and a bunch of configuration settings for Firefox. I set browser.cache.disk.enable and browser.cache.memory.enable both to false.</p>
<p>That was all I had to do to disable caching. Oh, and it does occur to me that I *could* have customized the .html template FlexBuilder is using in order to load the .swf with a unique query string value each time, which would have solved the caching issue in a different way. But disabling caching in Firefox entirely seemed far more silly. Plus, it required far less work.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.themorphicgroup.com/blog/2009/03/09/disable-caching-in-firefox/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>FABridge Error: &#8220;You are trying to call recursively into the Flash Player which is not allowed&#8230;&#8221;</title>
		<link>http://www.themorphicgroup.com/blog/2009/02/14/fabridge-error-you-are-trying-to-call-recursively-into-the-flash-player-which-is-not-allowed/</link>
		<comments>http://www.themorphicgroup.com/blog/2009/02/14/fabridge-error-you-are-trying-to-call-recursively-into-the-flash-player-which-is-not-allowed/#comments</comments>
		<pubDate>Sat, 14 Feb 2009 22:06:10 +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[Uncategorized]]></category>
		<category><![CDATA[FABridge EventsToCallLater MethodsToCallLater]]></category>

		<guid isPermaLink="false">http://www.themorphicgroup.com/blog/?p=71</guid>
		<description><![CDATA[Like many people, I've been using the FABridge a lot and loving the simplicity it provides. Also like many people I've run into the following JavaScript error thrown by the FABridge:  You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used [...]]]></description>
			<content:encoded><![CDATA[<p>Like many people, I've been using the FABridge a lot and loving the simplicity it provides. Also like many people I've run into the following JavaScript error thrown by the FABridge: </p>
<blockquote><p><em>You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.</em></p></blockquote>
<p>In a pinch, I've worked around this error using the suggested JS setTimeout() function or by retrieving data by other means. I've finally decided to see if there was a better way and found one.</p>
<p><span style="color: #808080;">For the impatient (like myself), the solution is to use the following FABridge static constants: </span></p>
<blockquote>
<pre><span style="font-family: 'Courier New'; line-height: 18px; white-space: pre; "><span style="color: #808080;">FABridge.EventsToCallLater
FABridge.MethodsToCallLater </span></span></pre>
</blockquote>
<p>Let's look at a test project:</p>
<ul>
<li><a title="FABridge Test" href="http://www2.themorphicgroup.com/projects/examples/fabridgetest/" target="_blank">FABridge Test</a></li>
<li><a title="FABridge Test Source View" href="http://www2.themorphicgroup.com/projects/examples/fabridgetest/srcview/" target="_blank">FABridge Test Source View</a></li>
</ul>
<p>Open the FABridge Test and you'll see a bunch of links. Click <strong>FireBugLite</strong> to open a console. Then click <strong>embedSwf()</strong> to embed the swf which will output to the console when the FABridge has initialized (see the JavaScript callback() method on the HTML page . You should then see the following in the console:</p>
<blockquote>
<pre>
<div class="logRow">embedSwf
franky.name: franky
franky.children.length: <span class="objectBox-number">2
franky.children[0]: <span class="objectBox-object">Object
franky.children[0].name: john</span></span></div>
</pre>
</blockquote>
<p>The JS callback() method is a simple demonstration of getting data from the SWF through the FABridge.  Now click on the <strong>requestRingo()</strong> link.  That calls the following JS code:</p>
<blockquote>
<pre>getRoot().requestRingo();</pre>
</blockquote>
<p>That in turn calls the following ActionScipt code in FABridgetTest.as which dispatches a ringoRequested event:</p>
<blockquote>
<pre>public function requestRingo():void {
    var e:NodeEvent = new NodeEvent("ringoRequested");
     e.node = new Node("ringo", 14);
     e.node.children.push(new Node("dingo", 2));
     dispatchEvent(e); // dispatch right away
}</pre>
</blockquote>
<p>In the JavaScript, we've added an event listener for that event in the callback() method. The JS requestRingoHandler() method is called as a result:</p>
<blockquote>
<pre>function requestRingoHandler(event) {
    console.log("ringo");
      try {
         var ringo = event.getNode();
         console.log("ringo.name:", ringo.getName());
         console.log("ringo.children[0].name:", ringo.getChildren()[0].getName());
    } catch (e) {
        console.log("error:", e.message);
    }
}</pre>
</blockquote>
<p>So we've click on the <strong>requestRingo()</strong> link and will get the following output in the console:</p>
<blockquote>
<pre>ringo
error: You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.</pre>
</blockquote>
<div class="logRow">The error occurred because in requestRingoHandler(), we're accessing properties of the given event object and in this case the event was dispatched immediately when calling the AS requestRingo() method. We could avoid the error by dispatching the event after a delay. A more general solution would better of course. So now click on the <strong>setEventsToCallLater("fabridgetest::NodeEvent")</strong> link. Click on <strong>requestRingo()</strong> again and you'll get the following output:</div>
<div class="logRow">
<blockquote>
<pre>
<div class="logRow">ringo
ringo.name: ringo
ringo.children[0].name: dingo</div>
</pre>
</blockquote>
</div>
<p>The setEventsToCallLater() method registered the fabridgetest::NodeEvent class with the FABridge as an event to dispatch after a delay. This registration is done using the FABridge.EventsToCallLater Object constant. In a normal application you'd hard code these registrations, e.g.</p>
<blockquote>
<pre>FABridge.EventsToCallLater["fabridgetest::NodeEvent"] = "true";</pre>
</blockquote>
<p>You can also register the general flash.events.::Event class to cover all cases, but there may be performance concerns so that will have to be tested before I use it in production code.  </p>
<p>In addition to the EventsToCallLater constant, FABridge has the MethodsToCallLater constant which is the same thing but for specified methods for classes. The FABridge registers the following automatically:</p>
<blockquote>
<pre>MethodsToCallLater["mx.collections::ArrayCollection"]="refresh,removeItemAt";</pre>
</blockquote>
<p>Between EventsToCallLater and MethodsToCallLater you should be able to avoid many of the "<em>You are trying to call recursively into the Flash Player...</em>" errors.</p>
<p>Have you successfully uses these constants? Are there any pitfalls and/or performance issues?</p>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.themorphicgroup.com/blog/2009/02/14/fabridge-error-you-are-trying-to-call-recursively-into-the-flash-player-which-is-not-allowed/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
