<?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>Tom Cornilliac &#187; Flex 4</title>
	<atom:link href="http://www.tomcornilliac.com/tag/flex-4/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tomcornilliac.com</link>
	<description>Flex, AIR and Rich Internet Goodness</description>
	<lastBuildDate>Wed, 17 Jun 2009 15:40:49 +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>Using SwizConfig with Flex 4</title>
		<link>http://www.tomcornilliac.com/2009/06/using-swizconfig-with-flex-4/</link>
		<comments>http://www.tomcornilliac.com/2009/06/using-swizconfig-with-flex-4/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 16:11:32 +0000</pubDate>
		<dc:creator>Tom Cornilliac</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Flex 4]]></category>
		<category><![CDATA[Swiz]]></category>

		<guid isPermaLink="false">http://www.tomcornilliac.com/?p=65</guid>
		<description><![CDATA[I recently started my first Flex 4 project using the Swiz framework. After setting up my main application class to use SwizConfig and compiling I was greeted with this error. &#8220;In initializer for &#8216;mxmlContentFactory&#8217;, type org.swizframework.SwizConfig is not assignable to target type Array or target element type mx.core.IVisualElement&#8221; The solution: Flex 4 introduced a new [...]]]></description>
			<content:encoded><![CDATA[<p>I recently started my first Flex 4 project using the <a href="http://www.swizframework.org">Swiz framework</a>. After setting up my main application class to use SwizConfig and compiling I was greeted with this error.</p>
<blockquote><p><span style="color: #000000;"><strong>&#8220;In initializer for &#8216;mxmlContentFactory&#8217;, type org.swizframework.SwizConfig is not assignable to target type Array or target element type mx.core.IVisualElement&#8221;</strong></span></p></blockquote>
<p>The solution: Flex 4 introduced a new method of grouping non-visual elements together <span style="color: #0000ff;">&lt;fx:Declarations&gt;</span>. In Flex 4 non-visual elements such as formatters, validators, effects etc. need to be grouped within a <span style="color: #0000ff;">&lt;fx:Declarations&gt;</span> section. So if you&#8217;re using Flex 4 (Gumbo) your SwizConfig would look something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:WindowedApplication</span></span>
<span style="color: #000000;">	xmlns:swiz=<span style="color: #ff0000;">&quot;http://swiz.swizframework.org&quot;</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 style="color: #7400FF;">&gt;</span></span>
&nbsp;
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Declarations</span><span style="color: #7400FF;">&gt;</span></span>
		<span style="color: #000000;"><span style="color: #7400FF;">&lt;swiz:SwizConfig</span> </span>
<span style="color: #000000;">			viewPackages=<span style="color: #ff0000;">&quot;com.myapp.views&quot;</span></span>
<span style="color: #000000;">			eventPackages=<span style="color: #ff0000;">&quot;com.myapp.events&quot;</span></span>
<span style="color: #000000;">			strict=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">			beanLoaders=<span style="color: #ff0000;">&quot;{[Beans]}&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Declarations</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:WindowedApplication</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.tomcornilliac.com/2009/06/using-swizconfig-with-flex-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
