<?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>Mike Chambers &#187; flex flex4 fxg</title>
	<atom:link href="http://www.mikechambers.com/blog/tag/flex-flex4-fxg/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mikechambers.com/blog</link>
	<description>code = joy</description>
	<lastBuildDate>Sun, 15 Jan 2012 05:46:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Data Binding with FXG in Flex 4</title>
		<link>http://www.mikechambers.com/blog/2008/08/29/data-binding-with-fxg-in-flex-4/</link>
		<comments>http://www.mikechambers.com/blog/2008/08/29/data-binding-with-fxg-in-flex-4/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 20:00:05 +0000</pubDate>
		<dc:creator>mikechambers</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[flex flex4 fxg]]></category>

		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=1403</guid>
		<description><![CDATA[One of the cool things about FXG is that it works with Flex data-binding just as your would expect it to. Below is a simple example (which requires Flash Player 10 RC), followed the code, that shows data-binding with FXG and Flex 4: As you can see, there are still some bugs in the rendering, [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.mikechambers.com%2Fblog%2F2008%2F08%2F29%2Fdata-binding-with-fxg-in-flex-4%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif&amp;source=mesh&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>One of the cool things about <a href="http://opensource.adobe.com/wiki/display/flexsdk/FXG+1.0+Specification">FXG</a> is that it works with Flex data-binding just as your would expect it to.</p>
<p>Below is a simple example (which requires <a href="http://labs.adobe.com/technologies/flashplayer10/">Flash Player 10 RC</a>), followed the code, that shows data-binding with FXG and <a href="http://www.mikechambers.com/blog/2008/08/27/everything-there-is-to-know-about-flex-4-gumbo/">Flex 4</a>:<br />
<span id="more-1403"></span><br />
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="DisplayObjectTest" width="750" height="500" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"><param name="movie" value="/mesh/files/examples/fxgbinding/FXGBinding.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><param name="allowScriptAccess" value="sameDomain" /><embed src="/mesh/files/examples/fxgbinding/FXGBinding.swf" quality="high" bgcolor="#ffffff" width="750" height="500" name="DisplayObjectTest" align="middle" play="true" loop="false" quality="high" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"></embed></object></p>
<p>As you can see, there are still some bugs in the rendering, but that is to be expected as these are very early Flex 4 builds.</p>
<p>Source</p>
<div class="highlight">
<pre><span style="color: #BC7A00">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;</span>
<span style="color: #008000; font-weight: bold">&lt;mx:Application</span>
	<span style="color: #7D9029">xmlns:mx=</span><span style="color: #BA2121">&quot;library:adobe/flex/halo&quot;</span>
	<span style="color: #7D9029">xmlns=</span><span style="color: #BA2121">&quot;http://ns.adobe.com/mxml/2009&quot;</span>
	<span style="color: #7D9029">xmlns:gumbo=</span><span style="color: #BA2121">&quot;library:adobe/flex/gumbo&quot;</span>
	<span style="color: #7D9029">verticalCenter=</span><span style="color: #BA2121">&quot;0&quot;</span> <span style="color: #7D9029">horizontalCenter=</span><span style="color: #BA2121">&quot;0&quot;</span>
	<span style="color: #7D9029">layout=</span><span style="color: #BA2121">&quot;vertical&quot;</span><span style="color: #008000; font-weight: bold">&gt;</span>

	<span style="color: #008000; font-weight: bold">&lt;gumbo:Group</span> <span style="color: #7D9029">verticalCenter=</span><span style="color: #BA2121">&quot;0&quot;</span> <span style="color: #7D9029">horizontalCenter=</span><span style="color: #BA2121">&quot;0&quot;</span><span style="color: #008000; font-weight: bold">&gt;</span>
		<span style="color: #008000; font-weight: bold">&lt;Rect</span> <span style="color: #7D9029">width=</span><span style="color: #BA2121">&quot;300&quot;</span> <span style="color: #7D9029">height=</span><span style="color: #BA2121">&quot;200&quot;</span> <span style="color: #7D9029">radiusX=</span><span style="color: #BA2121">&quot;{radiusSlider.value}&quot;</span>
			<span style="color: #7D9029">radiusY=</span><span style="color: #BA2121">&quot;{radiusSlider.value}&quot;</span><span style="color: #008000; font-weight: bold">&gt;</span>
			<span style="color: #008000; font-weight: bold">&lt;fill&gt;</span>
				<span style="color: #008000; font-weight: bold">&lt;SolidColor</span> <span style="color: #7D9029">color=</span><span style="color: #BA2121">&quot;{fillColor.selectedColor}&quot;</span> <span style="color: #008000; font-weight: bold">/&gt;</span>
			<span style="color: #008000; font-weight: bold">&lt;/fill&gt;</span>
			<span style="color: #008000; font-weight: bold">&lt;stroke&gt;</span>
				<span style="color: #008000; font-weight: bold">&lt;SolidColorStroke</span> <span style="color: #7D9029">weight=</span><span style="color: #BA2121">&quot;{strokeSlider.value}&quot;</span>
					<span style="color: #7D9029">color=</span><span style="color: #BA2121">&quot;{strokeColor.selectedColor}&quot;</span> <span style="color: #7D9029">alpha=</span><span style="color: #BA2121">&quot;1&quot;</span> <span style="color: #008000; font-weight: bold">/&gt;</span>
			<span style="color: #008000; font-weight: bold">&lt;/stroke&gt;</span>
		<span style="color: #008000; font-weight: bold">&lt;/Rect&gt;</span>
	<span style="color: #008000; font-weight: bold">&lt;/gumbo:Group&gt;</span>

	<span style="color: #008000; font-weight: bold">&lt;mx:Label</span> <span style="color: #7D9029">text=</span><span style="color: #BA2121">&quot;Corner Radius&quot;</span> <span style="color: #008000; font-weight: bold">/&gt;</span>
	<span style="color: #008000; font-weight: bold">&lt;mx:HSlider</span> <span style="color: #7D9029">minimum=</span><span style="color: #BA2121">&quot;0&quot;</span> <span style="color: #7D9029">maximum=</span><span style="color: #BA2121">&quot;100&quot;</span> <span style="color: #7D9029">id=</span><span style="color: #BA2121">&quot;radiusSlider&quot;</span> <span style="color: #7D9029">liveDragging=</span><span style="color: #BA2121">&quot;true&quot;</span><span style="color: #008000; font-weight: bold">/&gt;</span>
	<span style="color: #008000; font-weight: bold">&lt;mx:Label</span> <span style="color: #7D9029">text=</span><span style="color: #BA2121">&quot;Stroke Weight&quot;</span> <span style="color: #008000; font-weight: bold">/&gt;</span>
	<span style="color: #008000; font-weight: bold">&lt;mx:HSlider</span> <span style="color: #7D9029">minimum=</span><span style="color: #BA2121">&quot;0&quot;</span> <span style="color: #7D9029">maximum=</span><span style="color: #BA2121">&quot;20&quot;</span> <span style="color: #7D9029">value=</span><span style="color: #BA2121">&quot;5&quot;</span> <span style="color: #7D9029">id=</span><span style="color: #BA2121">&quot;strokeSlider&quot;</span> <span style="color: #7D9029">liveDragging=</span><span style="color: #BA2121">&quot;true&quot;</span><span style="color: #008000; font-weight: bold">/&gt;</span>
	<span style="color: #008000; font-weight: bold">&lt;mx:Label</span> <span style="color: #7D9029">text=</span><span style="color: #BA2121">&quot;Stroke Color&quot;</span> <span style="color: #008000; font-weight: bold">/&gt;</span>
	<span style="color: #008000; font-weight: bold">&lt;mx:ColorPicker</span> <span style="color: #7D9029">id=</span><span style="color: #BA2121">&quot;strokeColor&quot;</span> <span style="color: #7D9029">selectedColor=</span><span style="color: #BA2121">&quot;0x333333&quot;</span> <span style="color: #008000; font-weight: bold">/&gt;</span>
	<span style="color: #008000; font-weight: bold">&lt;mx:Label</span> <span style="color: #7D9029">text=</span><span style="color: #BA2121">&quot;Fill Color&quot;</span> <span style="color: #008000; font-weight: bold">/&gt;</span>
	<span style="color: #008000; font-weight: bold">&lt;mx:ColorPicker</span> <span style="color: #7D9029">id=</span><span style="color: #BA2121">&quot;fillColor&quot;</span> <span style="color: #7D9029">selectedColor=</span><span style="color: #BA2121">&quot;0x999999&quot;</span> <span style="color: #008000; font-weight: bold">/&gt;</span>

<span style="color: #008000; font-weight: bold">&lt;/mx:Application&gt;</span>
</pre>
</div>
<p>You can of course, read more details on this in the <a href="http://opensource.adobe.com/wiki/display/flexsdk/FXG+1.0+Specification">FXG 1.0 Specification</a>.</p>
<p>I also have a post on how to <a href="http://www.mikechambers.com/blog/2008/08/28/getting-started-with-flex-4-fxg-and-flex-builder-3/">get started with Flex 4 FXG in Flex Builder 3</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikechambers.com/blog/2008/08/29/data-binding-with-fxg-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Defining and Reusing Symbols in Flex 4 FXG</title>
		<link>http://www.mikechambers.com/blog/2008/08/29/defining-and-reusing-symbols-in-flex-4-fxg/</link>
		<comments>http://www.mikechambers.com/blog/2008/08/29/defining-and-reusing-symbols-in-flex-4-fxg/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 17:04:25 +0000</pubDate>
		<dc:creator>mikechambers</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[flex flex4 fxg]]></category>

		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=1399</guid>
		<description><![CDATA[If you have done Flash development using the Flash Authoring tool, or have done any low level work with the SWF format, then you should be familiar with the concept of symbols. Basically a symbol is a reusable object (graphics, buttons, MovieClip) that can be included in the SWF once, but referenced and used many [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.mikechambers.com%2Fblog%2F2008%2F08%2F29%2Fdefining-and-reusing-symbols-in-flex-4-fxg%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif&amp;source=mesh&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>If you have done Flash development using the Flash Authoring tool, or have done any low level work with the SWF format, then you should be familiar with the concept of symbols. Basically a symbol is a reusable object (graphics, buttons, MovieClip) that can be included in the SWF once, but referenced and used many times.</p>
<p>Flex 4 <a href="http://opensource.adobe.com/wiki/display/flexsdk/FXG+1.0+Specification">FXG</a> has a similar concept of symbol, although the actual underlying implimentation is different. Using the <code>Library</code> and <code>Definition</code> elements, you can define a graphic symbol, which can then be reused multiple times within the FXG or MXML document.<br />
<span id="more-1399"></span><br />
For example, here is our <a href="http://www.mikechambers.com/blog/2008/08/28/getting-started-with-flex-4-fxg-and-flex-builder-3/">HelloWorld example from yesterday</a>, which uses a symbol to display the content, as opposed to just generating it inline:</p>
<div class="highlight">
<pre><span style="color: #BC7A00">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;</span>
<span style="color: #008000; font-weight: bold">&lt;Application</span>
	<span style="color: #7D9029">xmlns:mx=</span><span style="color: #BA2121">&quot;library:adobe/flex/halo&quot;</span>
	<span style="color: #7D9029">xmlns=</span><span style="color: #BA2121">&quot;http://ns.adobe.com/mxml/2009&quot;</span>
	<span style="color: #7D9029">xmlns:gumbo=</span><span style="color: #BA2121">&quot;library:adobe/flex/gumbo&quot;</span><span style="color: #008000; font-weight: bold">&gt;</span>

	<span style="color: #008000; font-weight: bold">&lt;Library&gt;</span>
		<span style="color: #008000; font-weight: bold">&lt;Definition</span> <span style="color: #7D9029">name=</span><span style="color: #BA2121">&quot;HelloWorldText&quot;</span><span style="color: #008000; font-weight: bold">&gt;</span>
			<span style="color: #008000; font-weight: bold">&lt;gumbo:Group&gt;</span>
				<span style="color: #008000; font-weight: bold">&lt;TextGraphic</span> <span style="color: #7D9029">fontFamily=</span><span style="color: #BA2121">&quot;Verdana&quot;</span> <span style="color: #7D9029">fontWeight=</span><span style="color: #BA2121">&quot;bold&quot;</span><span style="color: #008000; font-weight: bold">&gt;</span>
					<span style="color: #008000; font-weight: bold">&lt;content&gt;</span>Hello, World<span style="color: #008000; font-weight: bold">&lt;/content&gt;</span>
				<span style="color: #008000; font-weight: bold">&lt;/TextGraphic&gt;</span>
			<span style="color: #008000; font-weight: bold">&lt;/gumbo:Group&gt;</span>
		<span style="color: #008000; font-weight: bold">&lt;/Definition&gt;</span>
	<span style="color: #008000; font-weight: bold">&lt;/Library&gt;</span>

	<span style="color: #408080; font-style: italic">&lt;!-- Flex 4 Hello World with FXG --&gt;</span>
	<span style="color: #008000; font-weight: bold">&lt;mx:Canvas</span> <span style="color: #7D9029">top=</span><span style="color: #BA2121">&quot;0&quot;</span> <span style="color: #7D9029">bottom=</span><span style="color: #BA2121">&quot;0&quot;</span> <span style="color: #7D9029">left=</span><span style="color: #BA2121">&quot;0&quot;</span> <span style="color: #7D9029">right=</span><span style="color: #BA2121">&quot;0&quot;</span><span style="color: #008000; font-weight: bold">&gt;</span>
		<span style="color: #008000; font-weight: bold">&lt;gumbo:Group</span> <span style="color: #7D9029">verticalCenter=</span><span style="color: #BA2121">&quot;0&quot;</span> <span style="color: #7D9029">horizontalCenter=</span><span style="color: #BA2121">&quot;0&quot;</span><span style="color: #008000; font-weight: bold">&gt;</span>
			<span style="color: #008000; font-weight: bold">&lt;HelloWorldText</span> <span style="color: #008000; font-weight: bold">/&gt;</span>
		<span style="color: #008000; font-weight: bold">&lt;/gumbo:Group&gt;</span>
	<span style="color: #008000; font-weight: bold">&lt;/mx:Canvas&gt;</span>

	<span style="color: #408080; font-style: italic">&lt;!-- reference the symbol again --&gt;</span>
	<span style="color: #008000; font-weight: bold">&lt;gumbo:Group</span> <span style="color: #7D9029">left=</span><span style="color: #BA2121">&quot;5&quot;</span> <span style="color: #7D9029">bottom=</span><span style="color: #BA2121">&quot;5&quot;</span><span style="color: #008000; font-weight: bold">&gt;</span>
		<span style="color: #008000; font-weight: bold">&lt;HelloWorldText</span> <span style="color: #008000; font-weight: bold">/&gt;</span>
	<span style="color: #008000; font-weight: bold">&lt;/gumbo:Group&gt;</span>
<span style="color: #008000; font-weight: bold">&lt;/Application&gt;</span>
</pre>
</div>
<p>Pay attention to the namespace usage as right now, it can be a little tricky.</p>
<p>Notice that once we define a symbol, we can then reuse it multiple times by referencing its name attribute as if it was a native FXG element.</p>
<p>A <code>Library</code> element must contain one of more <code>Definition</code> elements. A <code>Definition</code> element must have a <code>name</code> attribute and contain one <code>Group</code> element.</p>
<p>One thing to keep in mind, is that currently, this is code that is executed at runtime, and thus underneath the hood, FXG is not creating actual SWF symbols at compile time. However, that is something that we are looking at to optimize working with static assets.</p>
<p>You can of course, read more details on this in the <a href="http://opensource.adobe.com/wiki/display/flexsdk/FXG+1.0+Specification">FXG 1.0 Specification</a>.</p>
<p>I also have a post on how to <a href="http://www.mikechambers.com/blog/2008/08/28/getting-started-with-flex-4-fxg-and-flex-builder-3/">get started with Flex 4 FXG in Flex Builder 3</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikechambers.com/blog/2008/08/29/defining-and-reusing-symbols-in-flex-4-fxg/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

