<?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; Adobe Catalyst</title>
	<atom:link href="http://www.themorphicgroup.com/blog/category/technology/adobe-catalyst-technology/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>Creating a Spark Resizable Title Window with Adobe Catalyst and Flash Builder</title>
		<link>http://www.themorphicgroup.com/blog/2009/06/26/creating-a-spark-resizable-title-window-with-adobe-catalyst-and-flash-builder/</link>
		<comments>http://www.themorphicgroup.com/blog/2009/06/26/creating-a-spark-resizable-title-window-with-adobe-catalyst-and-flash-builder/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 16:41:38 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Adobe Catalyst]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Flash Builder]]></category>
		<category><![CDATA[Spark]]></category>
		<category><![CDATA[SparkSkin]]></category>
		<category><![CDATA[TitleWindow]]></category>

		<guid isPermaLink="false">http://www.themorphicgroup.com/blog/?p=145</guid>
		<description><![CDATA[You may have noticed that with the new Spark components there isn't a new TitleWindow, much like the lack of icon property in a Spark button I wrote about in a previous post. In this tutorial, I'm going to demonstrate how to create a resizable TitleWindow using the new Spark SkinnableContainer component. You can view [...]]]></description>
			<content:encoded><![CDATA[<p>You may have noticed that with the new <a href="http://danorlando.com/?p=374">Spark</a> components there isn't a new <a href="http://livedocs.adobe.com/flex/2/langref/mx/containers/TitleWindow.html">TitleWindow</a>, much like the lack of icon property in a Spark button I wrote about in a previous <a href="http://www.themorphicgroup.com/blog/2009/06/18/how-to-create-a-spark-icon-button-and-skin/">post</a>. In this tutorial, I'm going to demonstrate how to create a resizable TitleWindow using the new Spark <a href="http://livedocs.adobe.com/flex/gumbo/langref/spark/components/SkinnableContainer.html">SkinnableContainer</a> component. You can view the results of this demo <a href="http://www2.themorphicgroup.com/blog/sparkTitleWindow/" target="_blank">here</a> or if you just want to grab the code and be on your way, you can download it <a href="http://www2.themorphicgroup.com/blog/sparkTitleWindow/SparkTitleWindow.zip">here</a>.</p>
<p><strong>Create the UI elements in Catalyst</strong>.</p>
<p>The following screenshot demonstrates how I built and organized the components in my <a href="http://labs.adobe.com/technologies/flashcatalyst/">Catalyst</a> project. For this component, I'm going to need a background, a header, a close button, and a handle to resize the button. I was able to name these components what I wanted by changing their names in the Library panel. Because Catalyst doesn't really let you know the type of components on the stage, it helps to rename these as you build each one.</p>
<p><img src="http://www2.themorphicgroup.com/blog/sparkTitleWindow/catalyst.jpg"/></p>
<p><strong>Import and tweak the Catalyst components in Flash Builder.</strong></p>
<p>After importing the Catalyst project into <a href="http://livedocs.adobe.com/flex/gumbo/html/WS65aa2914f20a58ebd123e2512119993c71-8000.html">Flash Builder</a> I made some changes to the following components:</p>
<p>TitleWindowBG.mxml</p>
<pre class="actionscript3" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?</span>xml <span style="color: #004993;">version</span>=<span style="color: #990000;">&quot;1.0&quot;</span> encoding=<span style="color: #990000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>Group xmlns<span style="color: #000000; font-weight: bold;">:</span>s=<span style="color: #990000;">&quot;library://ns.adobe.com/flex/spark&quot;</span> xmlns<span style="color: #000000; font-weight: bold;">:</span>fx=<span style="color: #990000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>Rect <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;100%&quot;</span> radiusY=<span style="color: #990000;">&quot;10&quot;</span> <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span> radiusX=<span style="color: #990000;">&quot;10&quot;</span> <span style="color: #004993;">alpha</span>=<span style="color: #990000;">&quot;0.75&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>fill<span style="color: #000000; font-weight: bold;">&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>SolidColor <span style="color: #004993;">color</span>=<span style="color: #990000;">&quot;#000000&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;/</span>s<span style="color: #000000; font-weight: bold;">:</span>fill<span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;/</span>s<span style="color: #000000; font-weight: bold;">:</span>Rect<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;/</span>s<span style="color: #000000; font-weight: bold;">:</span>Group<span style="color: #000000; font-weight: bold;">&gt;</span></pre>
<p>With this component I set the height and width of the rectangle to 100%. Currently Catalyst only lets you specify height and widths as fixed numbers.</p>
<p>TitleWindowCloseButton.mxml</p>
<pre class="actionscript3" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?</span>xml <span style="color: #004993;">version</span>=<span style="color: #990000;">&quot;1.0&quot;</span> encoding=<span style="color: #990000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>Skin xmlns<span style="color: #000000; font-weight: bold;">:</span>s=<span style="color: #990000;">&quot;library://ns.adobe.com/flex/spark&quot;</span> xmlns<span style="color: #000000; font-weight: bold;">:</span>fx=<span style="color: #990000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>states<span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>State <span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;up&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>State <span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;over&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>State <span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;down&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>State <span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;disabled&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;/</span>s<span style="color: #000000; font-weight: bold;">:</span>states<span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;</span>fx<span style="color: #000000; font-weight: bold;">:</span>Metadata<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000;">&#91;</span>HostComponent<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;spark.components.Button&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><span style="color: #000000; font-weight: bold;">&lt;/</span>fx<span style="color: #000000; font-weight: bold;">:</span>Metadata<span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>Rect <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;21&quot;</span> radiusY=<span style="color: #990000;">&quot;5&quot;</span> <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;21&quot;</span> radiusX=<span style="color: #990000;">&quot;5&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>fill<span style="color: #000000; font-weight: bold;">&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>LinearGradient <span style="color: #004993;">rotation</span>=<span style="color: #990000;">&quot;90&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
				<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>GradientEntry <span style="color: #004993;">color</span>=<span style="color: #990000;">&quot;#7f0000&quot;</span> <span style="color: #004993;">alpha</span>=<span style="color: #990000;">&quot;1.0&quot;</span> ratio=<span style="color: #990000;">&quot;0&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
				<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>GradientEntry <span style="color: #004993;">color</span>=<span style="color: #990000;">&quot;#ff0000&quot;</span> <span style="color: #004993;">alpha</span>=<span style="color: #990000;">&quot;1.0&quot;</span> ratio=<span style="color: #990000;">&quot;1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;/</span>s<span style="color: #000000; font-weight: bold;">:</span>LinearGradient<span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;/</span>s<span style="color: #000000; font-weight: bold;">:</span>fill<span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;/</span>s<span style="color: #000000; font-weight: bold;">:</span>Rect<span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>RichText
		id=<span style="color: #990000;">&quot;labelElement&quot;</span>
		<span style="color: #004993;">x</span>=<span style="color: #990000;">&quot;7&quot;</span> <span style="color: #004993;">y</span>=<span style="color: #990000;">&quot;6&quot;</span>
		<span style="color: #004993;">color</span>=<span style="color: #990000;">&quot;#ffffff&quot;</span>
		<span style="color: #004993;">text</span>=<span style="color: #990000;">&quot;(Label)&quot;</span>
		<span style="color: #004993;">fontSize</span>=<span style="color: #990000;">&quot;12&quot;</span> fontFamily=<span style="color: #990000;">&quot;Arial&quot;</span> fontWeight=<span style="color: #990000;">&quot;bold&quot;</span>
		<span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;8&quot;</span> <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;12&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;/</span>s<span style="color: #000000; font-weight: bold;">:</span>Skin<span style="color: #000000; font-weight: bold;">&gt;</span>
&nbsp;</pre>
<p>I cleaned out some transistion stuff that wasn't necassary.</p>
<p>TitleWindowHeader.mxml</p>
<pre class="actionscript3" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?</span>xml <span style="color: #004993;">version</span>=<span style="color: #990000;">&quot;1.0&quot;</span> encoding=<span style="color: #990000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>Skin xmlns<span style="color: #000000; font-weight: bold;">:</span>s=<span style="color: #990000;">&quot;library://ns.adobe.com/flex/spark&quot;</span> xmlns<span style="color: #000000; font-weight: bold;">:</span>fx=<span style="color: #990000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>states<span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>State <span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;up&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>State <span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;over&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>State <span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;down&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>State <span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;disabled&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;/</span>s<span style="color: #000000; font-weight: bold;">:</span>states<span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;</span>fx<span style="color: #000000; font-weight: bold;">:</span>Metadata<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000;">&#91;</span>HostComponent<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;spark.components.Button&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><span style="color: #000000; font-weight: bold;">&lt;/</span>fx<span style="color: #000000; font-weight: bold;">:</span>Metadata<span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>Rect <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;28&quot;</span> radiusY=<span style="color: #990000;">&quot;5&quot;</span> <span style="color: #004993;">left</span>=<span style="color: #990000;">&quot;0&quot;</span> <span style="color: #004993;">right</span>=<span style="color: #990000;">&quot;0&quot;</span> radiusX=<span style="color: #990000;">&quot;5&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>fill<span style="color: #000000; font-weight: bold;">&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>LinearGradient <span style="color: #004993;">rotation</span>=<span style="color: #990000;">&quot;90&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
				<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>GradientEntry <span style="color: #004993;">color</span>=<span style="color: #990000;">&quot;#ff0000&quot;</span> <span style="color: #004993;">alpha</span>=<span style="color: #990000;">&quot;1.0&quot;</span> ratio=<span style="color: #990000;">&quot;0&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
				<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>GradientEntry <span style="color: #004993;">color</span>=<span style="color: #990000;">&quot;#7f0000&quot;</span> <span style="color: #004993;">alpha</span>=<span style="color: #990000;">&quot;1.0&quot;</span> ratio=<span style="color: #990000;">&quot;1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;/</span>s<span style="color: #000000; font-weight: bold;">:</span>LinearGradient<span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;/</span>s<span style="color: #000000; font-weight: bold;">:</span>fill<span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;/</span>s<span style="color: #000000; font-weight: bold;">:</span>Rect<span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>RichText
		id=<span style="color: #990000;">&quot;labelElement&quot;</span>
		<span style="color: #004993;">y</span>=<span style="color: #990000;">&quot;8&quot;</span>
		<span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;14&quot;</span>
		<span style="color: #004993;">color</span>=<span style="color: #990000;">&quot;#ffffff&quot;</span>
		<span style="color: #004993;">text</span>=<span style="color: #990000;">&quot;(Label)&quot;</span>
		<span style="color: #004993;">fontSize</span>=<span style="color: #990000;">&quot;14&quot;</span> fontFamily=<span style="color: #990000;">&quot;Arial&quot;</span> fontWeight=<span style="color: #990000;">&quot;bold&quot;</span>
		<span style="color: #004993;">left</span>=<span style="color: #990000;">&quot;5&quot;</span> <span style="color: #004993;">right</span>=<span style="color: #990000;">&quot;20&quot;</span>  <span style="color: #000000; font-weight: bold;">/&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;/</span>s<span style="color: #000000; font-weight: bold;">:</span>Skin<span style="color: #000000; font-weight: bold;">&gt;</span></pre>
<p>I set the left and right properties of the Rect and RichText so it would change size with our eventual component.</p>
<p>TitleWindowResizeHandle.mxml</p>
<pre class="actionscript3" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?</span>xml <span style="color: #004993;">version</span>=<span style="color: #990000;">&quot;1.0&quot;</span> encoding=<span style="color: #990000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>Skin
	xmlns<span style="color: #000000; font-weight: bold;">:</span>s=<span style="color: #990000;">&quot;library://ns.adobe.com/flex/spark&quot;</span>
	xmlns<span style="color: #000000; font-weight: bold;">:</span>fx=<span style="color: #990000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span>
	<span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;100%&quot;</span>
	<span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>states<span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>State <span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;up&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>State <span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;over&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>State <span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;down&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>State <span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;disabled&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;/</span>s<span style="color: #000000; font-weight: bold;">:</span>states<span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;</span>fx<span style="color: #000000; font-weight: bold;">:</span>Metadata<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000;">&#91;</span>HostComponent<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;spark.components.Button&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><span style="color: #000000; font-weight: bold;">&lt;/</span>fx<span style="color: #000000; font-weight: bold;">:</span>Metadata<span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>Group <span style="color: #004993;">y</span>=<span style="color: #990000;">&quot;22&quot;</span> <span style="color: #004993;">rotation</span>=<span style="color: #990000;">&quot;-45&quot;</span> <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;100%&quot;</span> <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>Rect <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;5&quot;</span> radiusY=<span style="color: #990000;">&quot;3&quot;</span> <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;31&quot;</span> radiusX=<span style="color: #990000;">&quot;3&quot;</span> <span style="color: #004993;">alpha</span>=<span style="color: #990000;">&quot;0.5&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>fill<span style="color: #000000; font-weight: bold;">&gt;</span>
				<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>SolidColor <span style="color: #004993;">color</span>=<span style="color: #990000;">&quot;0xFFFFFF&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;/</span>s<span style="color: #000000; font-weight: bold;">:</span>fill<span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;/</span>s<span style="color: #000000; font-weight: bold;">:</span>Rect<span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>Rect <span style="color: #004993;">y</span>=<span style="color: #990000;">&quot;8&quot;</span> <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;5&quot;</span> radiusX=<span style="color: #990000;">&quot;3&quot;</span> <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;18&quot;</span> <span style="color: #004993;">x</span>=<span style="color: #990000;">&quot;7&quot;</span> radiusY=<span style="color: #990000;">&quot;3&quot;</span> <span style="color: #004993;">alpha</span>=<span style="color: #990000;">&quot;0.5&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>fill<span style="color: #000000; font-weight: bold;">&gt;</span>
				<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>SolidColor <span style="color: #004993;">color</span>=<span style="color: #990000;">&quot;0xFFFFFF&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;/</span>s<span style="color: #000000; font-weight: bold;">:</span>fill<span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;/</span>s<span style="color: #000000; font-weight: bold;">:</span>Rect<span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>Rect <span style="color: #004993;">y</span>=<span style="color: #990000;">&quot;16&quot;</span> <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;5&quot;</span> radiusX=<span style="color: #990000;">&quot;3&quot;</span> <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;5&quot;</span> <span style="color: #004993;">x</span>=<span style="color: #990000;">&quot;14&quot;</span> radiusY=<span style="color: #990000;">&quot;3&quot;</span> <span style="color: #004993;">alpha</span>=<span style="color: #990000;">&quot;0.5&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>fill<span style="color: #000000; font-weight: bold;">&gt;</span>
				<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>SolidColor <span style="color: #004993;">color</span>=<span style="color: #990000;">&quot;0xFFFFFF&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;/</span>s<span style="color: #000000; font-weight: bold;">:</span>fill<span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;/</span>s<span style="color: #000000; font-weight: bold;">:</span>Rect<span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;/</span>s<span style="color: #000000; font-weight: bold;">:</span>Group<span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>Rect <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span> <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;100%&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>fill<span style="color: #000000; font-weight: bold;">&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>SolidColor <span style="color: #004993;">color</span>=<span style="color: #990000;">&quot;#ffffff&quot;</span> <span style="color: #004993;">alpha</span>=<span style="color: #990000;">&quot;0&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;/</span>s<span style="color: #000000; font-weight: bold;">:</span>fill<span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;/</span>s<span style="color: #000000; font-weight: bold;">:</span>Rect<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;/</span>s<span style="color: #000000; font-weight: bold;">:</span>Skin<span style="color: #000000; font-weight: bold;">&gt;</span></pre>
<p>With this component I set the height and width of the artwork Group to 100% and added a transparent Rect to help catch mouse events better.</p>
<p><strong>Create a SparkTitleWindow class that extends SkinnableContainer.</strong></p>
<p>For our custom component we create two public bindable properties &quot;title&quot; and &quot;isResizable&quot; so a developer can easier implement the component. We also declare a &quot;close&quot; event that uses the standard <a href="http://livedocs.adobe.com/flex/201/langref/mx/events/CloseEvent.html">CloseEvent</a> object. For the dragging and resizing functionality, we create start and stop methods that start/stop a <a href="http://livedocs.adobe.com/flex/2/langref/flash/utils/Timer.html">Timer</a> that keeps track of the mouse position.</p>
<pre class="actionscript3" style="font-family:monospace;">&nbsp;
<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> <span style="color: #004993;">flash.events</span>.<a href="http://www.google.com/search?q=timerevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:timerevent.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">TimerEvent</span></a>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.geom</span>.<a href="http://www.google.com/search?q=point%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:point.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Point</span></a>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.utils</span>.<a href="http://www.google.com/search?q=timer%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:timer.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Timer</span></a>;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">import</span> mx.core.UIComponent;
	<span style="color: #0033ff; font-weight: bold;">import</span> mx.events.CloseEvent;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">import</span> spark.components.SkinnableContainer;
	<span style="color: #000000;">&#91;</span><a href="http://www.google.com/search?q=event%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:event.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Event</span></a><span style="color: #000000;">&#40;</span><span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;close&quot;</span>, <span style="color: #004993;">type</span>=<span style="color: #990000;">&quot;mx.events.CloseEvent&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> SparkTitleWindow extends SkinnableContainer
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> static const DRAG_INTERVAL<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; font-weight:bold;">1</span>;
		<span style="color: #000000;">&#91;</span>Bindable<span style="color: #000000;">&#93;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> title<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;&quot;</span>;
		<span style="color: #000000;">&#91;</span>Bindable<span style="color: #000000;">&#93;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> isResizable<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=boolean%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:boolean.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Boolean</span></a> = <span style="color: #0033ff; font-weight: bold;">true</span>;
		<span style="color: #009900;">//drag props</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _dragTimer<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=timer%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:timer.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Timer</span></a> = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=timer%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:timer.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Timer</span></a><span style="color: #000000;">&#40;</span>DRAG_INTERVAL<span style="color: #000000;">&#41;</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _dragInitPoint<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=point%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:point.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Point</span></a>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _dragHandle<span style="color: #000000; font-weight: bold;">:</span>UIComponent;
		<span style="color: #009900;">//resize props</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _resizeTimer<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=timer%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:timer.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Timer</span></a> = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=timer%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:timer.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Timer</span></a><span style="color: #000000;">&#40;</span>DRAG_INTERVAL<span style="color: #000000;">&#41;</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _resizeInitPoint<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=point%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:point.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Point</span></a>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _resizeHandle<span style="color: #000000; font-weight: bold;">:</span>UIComponent;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> SparkTitleWindow<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>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> closeWindow<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: #004993;">dispatchEvent</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> CloseEvent<span style="color: #000000;">&#40;</span>CloseEvent.<span style="color: #004993;">CLOSE</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
		<span style="color: #009900;">//drag methods/handlers</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> startWindowDrag<span style="color: #000000;">&#40;</span>dragHandle<span style="color: #000000; font-weight: bold;">:</span>UIComponent<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;">this</span>._dragHandle = dragHandle;
			_dragInitPoint = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=point%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:point.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Point</span></a><span style="color: #000000;">&#40;</span>_dragHandle.<span style="color: #004993;">mouseX</span>, _dragHandle.<span style="color: #004993;">mouseY</span><span style="color: #000000;">&#41;</span>;
			_dragTimer.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><a href="http://www.google.com/search?q=timerevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:timerevent.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">TimerEvent</span></a>.<span style="color: #004993;">TIMER</span>, onDragTimerTick, <span style="color: #0033ff; font-weight: bold;">false</span>, <span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span>;
			_dragTimer.<span style="color: #004993;">start</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> stopWindowDrag<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>
			_dragTimer.<span style="color: #004993;">stop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			_dragTimer.<span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span><a href="http://www.google.com/search?q=timerevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:timerevent.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">TimerEvent</span></a>.<span style="color: #004993;">TIMER</span>, onDragTimerTick<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> onDragTimerTick<span style="color: #000000;">&#40;</span>event<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=timerevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:timerevent.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">TimerEvent</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: #6699cc; font-weight: bold;">var</span> currentMousePoint<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=point%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:point.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Point</span></a> = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=point%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:point.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Point</span></a><span style="color: #000000;">&#40;</span>_dragHandle.<span style="color: #004993;">mouseX</span>, _dragHandle.<span style="color: #004993;">mouseY</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> gPoint<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=point%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:point.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Point</span></a> = _dragHandle.<span style="color: #004993;">localToGlobal</span><span style="color: #000000;">&#40;</span>currentMousePoint<span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> lPoint<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=point%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:point.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Point</span></a> = <span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">parent</span>.<span style="color: #004993;">globalToLocal</span><span style="color: #000000;">&#40;</span>gPoint<span style="color: #000000;">&#41;</span>;
			<span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">x</span> = lPoint.<span style="color: #004993;">x</span> <span style="color: #000000; font-weight: bold;">-</span> _dragInitPoint.<span style="color: #004993;">x</span>;
			<span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">y</span> = lPoint.<span style="color: #004993;">y</span> <span style="color: #000000; font-weight: bold;">-</span> _dragInitPoint.<span style="color: #004993;">y</span>;
&nbsp;
		<span style="color: #000000;">&#125;</span>
		<span style="color: #009900;">//resize methods/handlers</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> startWindowResize<span style="color: #000000;">&#40;</span>resizeHandle<span style="color: #000000; font-weight: bold;">:</span>UIComponent<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;">this</span>._resizeHandle = resizeHandle;
			_resizeInitPoint = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=point%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:point.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Point</span></a><span style="color: #000000;">&#40;</span>_resizeHandle.<span style="color: #004993;">mouseX</span>, _resizeHandle.<span style="color: #004993;">mouseY</span><span style="color: #000000;">&#41;</span>;
			_resizeTimer.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><a href="http://www.google.com/search?q=timerevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:timerevent.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">TimerEvent</span></a>.<span style="color: #004993;">TIMER</span>, onResizeTimerTick, <span style="color: #0033ff; font-weight: bold;">false</span>, <span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span>;
			_resizeTimer.<span style="color: #004993;">start</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> stopWindowResize<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>
			_resizeTimer.<span style="color: #004993;">stop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			_resizeTimer.<span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span><a href="http://www.google.com/search?q=timerevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:timerevent.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">TimerEvent</span></a>.<span style="color: #004993;">TIMER</span>, onResizeTimerTick<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> onResizeTimerTick<span style="color: #000000;">&#40;</span>event<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=timerevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:timerevent.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">TimerEvent</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: #6699cc; font-weight: bold;">var</span> currentMousePoint<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=point%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:point.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Point</span></a> = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=point%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:point.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Point</span></a><span style="color: #000000;">&#40;</span>_resizeHandle.<span style="color: #004993;">mouseX</span>, _resizeHandle.<span style="color: #004993;">mouseY</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> gPoint<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=point%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:point.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Point</span></a> = _resizeHandle.<span style="color: #004993;">localToGlobal</span><span style="color: #000000;">&#40;</span>currentMousePoint<span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> lPoint<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=point%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:point.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Point</span></a> = <span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">parent</span>.<span style="color: #004993;">globalToLocal</span><span style="color: #000000;">&#40;</span>gPoint<span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> newWidth<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: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">width</span> <span style="color: #000000; font-weight: bold;">+</span> lPoint.<span style="color: #004993;">x</span> <span style="color: #000000; font-weight: bold;">-</span> <span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">width</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">x</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #000000;">&#40;</span>_resizeHandle.<span style="color: #004993;">width</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> newHeight<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: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">height</span> <span style="color: #000000; font-weight: bold;">+</span> lPoint.<span style="color: #004993;">y</span> <span style="color: #000000; font-weight: bold;">-</span> <span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">height</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">y</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #000000;">&#40;</span>_resizeHandle.<span style="color: #004993;">height</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: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>newWidth <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #0033ff; font-weight: bold;">this</span>.minWidth<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>
				<span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">width</span> = newWidth;
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>newHeight <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #0033ff; font-weight: bold;">this</span>.minHeight<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>
				<span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">height</span> = newHeight;
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre>
<p><strong>Create SparkTitleWindow SparkSkin.</strong></p>
<p>The last step before implementation is create our <a href="http://livedocs.adobe.com/flex/gumbo/langref/spark/skins/SparkSkin.html">SparkSkin</a> mxml component for our window. This where we incorporate the components we created in Catalyst. Note the Group component &quot;contentGroup.&quot; Because our host component is a SkinnableContainer it is required to have this Group object. This is where the contents of our new container will go.</p>
<pre class="actionscript3" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?</span>xml <span style="color: #004993;">version</span>=<span style="color: #990000;">&quot;1.0&quot;</span> encoding=<span style="color: #990000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>Skin
	xmlns<span style="color: #000000; font-weight: bold;">:</span>fx=<span style="color: #990000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span>
	xmlns<span style="color: #000000; font-weight: bold;">:</span>s=<span style="color: #990000;">&quot;library://ns.adobe.com/flex/spark&quot;</span>
	xmlns<span style="color: #000000; font-weight: bold;">:</span>mx=<span style="color: #990000;">&quot;library://ns.adobe.com/flex/halo&quot;</span>
	<span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span>
	<span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;100%&quot;</span>
	xmlns<span style="color: #000000; font-weight: bold;">:</span>components=<span style="color: #990000;">&quot;components.*&quot;</span>
	<span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;</span>fx<span style="color: #000000; font-weight: bold;">:</span>Script<span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;!</span><span style="color: #000000;">&#91;</span>CDATA<span style="color: #000000;">&#91;</span>
			<span style="color: #0033ff; font-weight: bold;">import</span> components.TitleWindowResizeHandle;
		<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#93;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;/</span>fx<span style="color: #000000; font-weight: bold;">:</span>Script<span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;</span>fx<span style="color: #000000; font-weight: bold;">:</span>Metadata<span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000;">&#91;</span>HostComponent<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;com.tmg.components.SparkTitleWindow&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
	<span style="color: #000000; font-weight: bold;">&lt;/</span>fx<span style="color: #000000; font-weight: bold;">:</span>Metadata<span style="color: #000000; font-weight: bold;">&gt;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>states<span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>State <span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;normal&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;/</span>s<span style="color: #000000; font-weight: bold;">:</span>states<span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>layout<span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>BasicLayout<span style="color: #000000; font-weight: bold;">/&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;/</span>s<span style="color: #000000; font-weight: bold;">:</span>layout<span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;</span>components<span style="color: #000000; font-weight: bold;">:</span>TitleWindowBG
		id=<span style="color: #990000;">&quot;windowBG&quot;</span>
		<span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span> <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;100%&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>Button
		id=<span style="color: #990000;">&quot;windowHeader&quot;</span>
		<span style="color: #004993;">left</span>=<span style="color: #990000;">&quot;5&quot;</span> <span style="color: #004993;">top</span>=<span style="color: #990000;">&quot;5&quot;</span> <span style="color: #004993;">right</span>=<span style="color: #990000;">&quot;5&quot;</span>
		skinClass=<span style="color: #990000;">&quot;components.TitleWindowHeader&quot;</span>
		label=<span style="color: #990000;">&quot;{hostComponent.title}&quot;</span>
		<span style="color: #004993;">mouseDown</span>=<span style="color: #990000;">&quot;{ hostComponent.startWindowDrag(windowHeader) }&quot;</span>
		<span style="color: #004993;">mouseUp</span>=<span style="color: #990000;">&quot;{ hostComponent.stopWindowDrag() }&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>Button
		id=<span style="color: #990000;">&quot;closeButton&quot;</span>
		label=<span style="color: #990000;">&quot;X&quot;</span>
		<span style="color: #004993;">buttonMode</span>=<span style="color: #990000;">&quot;true&quot;</span>
		skinClass=<span style="color: #990000;">&quot;components.TitleWindowCloseButton&quot;</span>
		<span style="color: #004993;">right</span>=<span style="color: #990000;">&quot;7&quot;</span> <span style="color: #004993;">top</span>=<span style="color: #990000;">&quot;8&quot;</span>
		<span style="color: #004993;">click</span>=<span style="color: #990000;">&quot;{ hostComponent.closeWindow()}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>Group
		id=<span style="color: #990000;">&quot;contentGroup&quot;</span>
		clipAndEnableScrolling=<span style="color: #990000;">&quot;true&quot;</span>
		<span style="color: #004993;">top</span>=<span style="color: #990000;">&quot;{windowHeader.y + windowHeader.height + 10}&quot;</span>
		<span style="color: #004993;">left</span>=<span style="color: #990000;">&quot;5&quot;</span> <span style="color: #004993;">right</span>=<span style="color: #990000;">&quot;5&quot;</span> <span style="color: #004993;">bottom</span>=<span style="color: #990000;">&quot;5&quot;</span>
		<span style="color: #004993;">color</span>=<span style="color: #990000;">&quot;#ffffff&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;/</span>s<span style="color: #000000; font-weight: bold;">:</span>Group<span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>Button
		id=<span style="color: #990000;">&quot;resizeButton&quot;</span>
		<span style="color: #004993;">right</span>=<span style="color: #990000;">&quot;2&quot;</span> <span style="color: #004993;">bottom</span>=<span style="color: #990000;">&quot;2&quot;</span>
		<span style="color: #004993;">mouseDown</span>=<span style="color: #990000;">&quot;{ hostComponent.startWindowResize(resizeButton)}&quot;</span>
		<span style="color: #004993;">mouseUp</span>=<span style="color: #990000;">&quot;{ hostComponent.stopWindowResize()}&quot;</span>
		<span style="color: #004993;">visible</span>=<span style="color: #990000;">&quot;{ hostComponent.isResizable }&quot;</span>
		skinClass=<span style="color: #990000;">&quot;components.TitleWindowResizeHandle&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;/</span>s<span style="color: #000000; font-weight: bold;">:</span>Skin<span style="color: #000000; font-weight: bold;">&gt;</span>
&nbsp;</pre>
<p>Also note how we are able to access our newley written public properties and methods via the &quot;<a href="http://livedocs.adobe.com/flex/gumbo/html/WSA95C9644-B650-4783-B5C0-D2C7F95A23E3.html">hostComponent</a>&quot; property.
</p>
<p><strong>Implement new component.</strong></p>
<p>With our new container written and skin created, we can now implement this new window component.</p>
<pre class="actionscript3" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;</span>components<span style="color: #000000; font-weight: bold;">:</span>SparkTitleWindow
		id=<span style="color: #990000;">&quot;myWindow&quot;</span>
		skinClass=<span style="color: #990000;">&quot;com.tmg.skins.SparkTitleWindowSkin&quot;</span>
		title=<span style="color: #990000;">&quot;My Title Window&quot;</span>
		<span style="color: #004993;">x</span>=<span style="color: #990000;">&quot;200&quot;</span> <span style="color: #004993;">y</span>=<span style="color: #990000;">&quot;50&quot;</span>
		<span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;300&quot;</span> <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;300&quot;</span>
		<span style="color: #004993;">close</span>=<span style="color: #990000;">&quot;{myWindow.visible=false}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>components<span style="color: #000000; font-weight: bold;">:</span>layout<span style="color: #000000; font-weight: bold;">&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>VerticalLayout<span style="color: #000000; font-weight: bold;">/&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;/</span>components<span style="color: #000000; font-weight: bold;">:</span>layout<span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>Label <span style="color: #004993;">text</span>=<span style="color: #990000;">&quot;These are the contents of my window:&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>TextInput
			<span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span>
			<span style="color: #004993;">color</span>=<span style="color: #990000;">&quot;#000000&quot;</span>
			<span style="color: #004993;">text</span>=<span style="color: #990000;">&quot;A text input...&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>TextArea
			<span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span>
			<span style="color: #004993;">text</span>=<span style="color: #990000;">&quot;A textarea...&quot;</span>
			<span style="color: #004993;">color</span>=<span style="color: #990000;">&quot;#000000&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>Button label=<span style="color: #990000;">&quot;A Button&quot;</span> <span style="color: #004993;">color</span>=<span style="color: #990000;">&quot;#000000&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;/</span>components<span style="color: #000000; font-weight: bold;">:</span>SparkTitleWindow<span style="color: #000000; font-weight: bold;">&gt;</span></pre>
<p><strong>Summary</strong></p>
<p>There you have it, a brand new container that can be dragged and/or resized. If you don't want to use Catalyst to edit the look and feel of you new component, you could declare style properties in the SparkTitleWindow class and in your skin component bind to these properties. An example of this can be found in my previous Spark <a href="http://www.themorphicgroup.com/blog/2009/06/18/how-to-create-a-spark-icon-button-and-skin/">post</a> where we create an <a href="http://www.themorphicgroup.com/blog/2009/06/18/how-to-create-a-spark-icon-button-and-skin/">IconButton</a>.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.themorphicgroup.com/blog/2009/06/26/creating-a-spark-resizable-title-window-with-adobe-catalyst-and-flash-builder/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>A Chat About PHP with Adobe Flash Builder 4 and Flash Catalyst</title>
		<link>http://www.themorphicgroup.com/blog/2009/06/25/a-chat-about-php-with-flash-builder-4-and-adobe-catalyst/</link>
		<comments>http://www.themorphicgroup.com/blog/2009/06/25/a-chat-about-php-with-flash-builder-4-and-adobe-catalyst/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 19:45:42 +0000</pubDate>
		<dc:creator>Unknown Morphician</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Adobe Catalyst]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[Adobe Flash Builder 4]]></category>

		<guid isPermaLink="false">http://www.themorphicgroup.com/blog/?p=90</guid>
		<description><![CDATA[With all the hoopla that is going on with the Flash Platform... probably the biggest news comes from Flash Builder 4 (Flex) with Data Services. The new wizards that can introspect your data service and help you create code to build effortlessly (well at least it is a good start). You may use whatever flavor [...]]]></description>
			<content:encoded><![CDATA[<p style="margin-bottom: 0in;">With all the hoopla that is going on with the Flash Platform... probably the biggest news comes from Flash Builder 4 (Flex) with Data Services. The new wizards that can introspect your data service and help you create code to build effortlessly (well at least it is a good start). You may use whatever flavor server-side technology you want - from Blaze DS, Cold Fusion, and PHP. This last technology is the focus of my little article. I also talk little bit about the work flow with Flash Catalyst and Flash Builder.</p>
<p style="margin-bottom: 0in;"><strong>ZEND Framework</strong></p>
<p style="margin-bottom: 0in;">First, I will briefly go over how to create a php data service using the wizard provided in Flash Builder. You first need to set up your project as you would for any service (Properties &gt; Flex Server). Once you have configure your php service Class and Package name, you are prompted to use Zend framework. The big hook here is the AMF support which also helps to introspect objects. I will say that the Zend framework has a lot of powerful features and is well know in the php community. The framework's size is 17 MB and needs to be uploaded to your web site whether you like it or not. You can't skip this step. This cause a couple of concerns. What if you Zend installed locally? What if in the future a new version of Zend is released won't this upload be a bit dated at some point?</p>
<p style="margin-bottom: 0in;"><img class="alignnone size-full wp-image-94" title="flexServer" src="http://www.themorphicgroup.com/blog/wp-content/uploads/2009/06/flexServer.jpg" alt="flexServer" width="470" height="435" /></p>
<p style="margin-bottom: 0in;"><img class="alignnone size-full wp-image-93" title="MyService_ZEND" src="http://www.themorphicgroup.com/blog/wp-content/uploads/2009/06/MyService_ZEND.jpg" alt="MyService_ZEND" width="480" height="482" /></p>
<p><!-- 		@page { margin: 0.79in } 		P { margin-bottom: 0.08in } 		A:link { so-language: zxx } --></p>
<p style="margin-bottom: 0in;">From this point on your can get auto generated value objects, configure return types, bind to components just to name a few features. Here is a few great tutorials that illustrate these features and more with Zend:</p>
<ul>
<li><a href="http://devzone.zend.com/article/4705">Data-centric Adobe Flash Builder development with the Zend Framework </a></li>
<li><a href="http://www.adobe.com/devnet/flashcatalyst/articles/building_datacentric_app_flashcast_flashbuilder.html">Building a data-centric application using Flash Catalyst beta and Flash Builder 4 beta</a></li>
<li><a href="http://www.gotoandlearn.com/play?id=110">Lee Brimelow's Flash Builder 4 beta and Flash Catalyst beta video tutorial</a></li>
</ul>
<p><!-- 		@page { margin: 0.79in } 		P { margin-bottom: 0.08in } --></p>
<p style="margin-bottom: 0in;"><strong>AMFPHP</strong></p>
<p style="margin-bottom: 0in;">For the rest of this article, I will take a slightly different path as far as creating a PHP service. I will discuss how to implement a Flex project using PHP with AMFPHP (About a little over 700 KB).</p>
<p style="margin-bottom: 0in;">To illustrate this process, I will run through a simple example application – “CelebrationEvent”, a check list utility. The premise is to distribute a list of items needed  for a party or celebration for a group of friends. In this application, users will log in and sign up for items to be in charge of bringing to the event.</p>
<p><!-- 		@page { margin: 0.79in } 		P { margin-bottom: 0.08in } --></p>
<p style="margin-bottom: 0in;">For this application, I went through the whole cycle from design to development with Illustrator CS3, Adobe Flash Catalyst, and Adobe Flash Builder 4.  I do have some comments on this work flow (trial and error) but my focus here is the actual service creation itself.</p>
<p style="margin-bottom: 0in;">Here is a screen shot of the work at beginning stage:</p>
<p style="margin-bottom: 0in;"><img class="alignnone size-full wp-image-95" title="CelebrationEventListLayout" src="http://www.themorphicgroup.com/blog/wp-content/uploads/2009/06/CelebrationEventListLayout.jpg" alt="CelebrationEventListLayout" width="480" height="362" /></p>
<p><!-- 		@page { margin: 0.79in } 		P { margin-bottom: 0.08in } --></p>
<p style="margin-bottom: 0in;"><em><strong>Setup Process</strong></em></p>
<p style="margin-bottom: 0in;">Since there is no data service wizard, there is a manual setup process involved. In other words, create a remote object.</p>
<p style="margin-bottom: 0in;">Note: Download <a href="http://www.amfphp.org/" target="_blank">AMFPHP</a> if you haven't already done so already. Get familiar with folder structure and Setup. For “CelebrationEvent”, I'm 		using MySQL database with “phpMyAdmin”</p>
<p><!-- 		@page { margin: 0.79in } 		P { margin-bottom: 0.08in } --></p>
<p><!-- 		@page { margin: 0.79in } 		P { margin-bottom: 0.08in } --></p>
<p style="margin-bottom: 0in;"><strong>Create Database and Tables Structure </strong></p>
<p style="margin-bottom: 0in;"><span style="font-weight: normal;">For this application I c</span>reated the EventCelebration database with these tables:</p>
<ul>
<li>
<p style="margin-bottom: 0in;">EventList – check list items for 	the event</p>
</li>
<li>
<p style="margin-bottom: 0in;">Users – User list</p>
</li>
<li>
<p style="margin-bottom: 0in;">EventListToUser – relationship 	of user to check list.</p>
</li>
</ul>
<p style="margin-bottom: 0in;">
<p style="margin-bottom: 0in;"><strong>Create the backend service – PHP/AMFPHP</strong></p>
<ul>
<li>
<p style="margin-bottom: 0in;">Update globals.php under AMFPHP folder root</p>
<ul>
<li>
<p style="margin-bottom: 0in;">Change "DB_HOST", "DB_USER", "DB_PASS" and "DB_NAME" to the corresponding database setting for host address, database privilage user , password and database name ("EventCelebration")</p>
</li>
</ul>
</li>
<li>
<p style="margin-bottom: 0in;">The Service Class: 	CelebrationEventService.php</p>
<ul>
<li>
<p style="margin-bottom: 0in;">Class has four methods – 		createUser(), loginUser(), getList(), and signUpForItem()</p>
</li>
<li>
<p style="margin-bottom: 0in;">You would add this class file under the “services” folder of your AMF Folder</p>
</li>
</ul>
</li>
<li>
<p style="margin-bottom: 0in;">Value Objects: User.php and EventItem.php</p>
<ul>
<li>
<p style="margin-bottom: 0in;">Note: Make sure you reference the data type mapped to the corresponding actionscript value objects “explicitType”.</p>
</li>
<li>
<p style="margin-bottom: 0in;">You would add these class files under “services/vo/[folder package 	structure]</p>
</li>
<li>
<p style="margin-bottom: 0in;">Example folder: “services/vo/com/themorphicgroup/celebrateEvent”</p>
</li>
<li>
<p style="margin-bottom: 0in;">See Sample Code Below</p>
</li>
</ul>
</li>
</ul>
<div><strong>Code Sample - User VO</strong></div>
<div>
<div>&lt;?php<br />
class User {<br />
var $id;<br />
var $fullName;<br />
var $email;<br />
var $password;</p>
<p>// explicit actionscript package<br />
var $_explicitType = "com.themorphicgroup.celebrateEvent.User";</p>
<p>/**<br />
* Constructor with default values<br />
*/<br />
function User($id = -1, $fullName = "", $email = "", $password = ""){<br />
$this-&gt;id = $id;<br />
$this-&gt;fullName = $fullName;<br />
$this-&gt;email = $email;<br />
$this-&gt;password = $password;<br />
}</p>
<p>}<br />
?&gt;</p></div>
</div>
<p style="margin-bottom: 0in;">
<p style="margin-bottom: 0in;"><strong>Create objects and calls in your project - Flex</strong></p>
<ul>
<li>
<p style="margin-bottom: 0in;">RemoteObject with handlers</p>
<ul>
<li>
<p style="margin-bottom: 0in;">With the way that the project was 		imported into Flash Builder, I decided to create actionscript to 		create the remoteObject instead of MXML reference.</p>
</li>
<li>
<p style="margin-bottom: 0in;">See Sample Code Below</p>
</li>
</ul>
</li>
<li>
<p style="margin-bottom: 0in;">Value Objects: User.as and 	EventItem</p>
<ul>
<li>
<p style="margin-bottom: 0in;">Note: Great feature in Flash 		Builder 4… you can now create your private variables and create 		you getters and setters via right click, Source, Generate 		Getter/Setter. Very cool.</p>
</li>
<li>
<p style="margin-bottom: 0in;">Make sure that you add metadata 		to map these objects to the corresponding PHP objects.</p>
</li>
<li>
<p style="margin-bottom: 0in;">See Sample Code Below</p>
</li>
</ul>
</li>
</ul>
<div><strong>Code Samples - RemoteObject with handlers</strong></div>
<div>Note: Service call are not show here since they are used through out application</div>
<div>
<div>
<pre class="actionscript3" style="font-family:monospace;">...
&nbsp;
<span style="color: #0033ff; font-weight: bold;">import</span> mx.rpc.remoting.RemoteObject;
<span style="color: #0033ff; font-weight: bold;">import</span> mx.rpc.events.ResultEvent;
<span style="color: #0033ff; font-weight: bold;">import</span> mx.rpc.events.FaultEvent;
<span style="color: #0033ff; font-weight: bold;">import</span> mx.controls.Alert;
&nbsp;
...
&nbsp;
<span style="color: #0033ff; font-weight: bold;">public</span> static <span style="color: #6699cc; font-weight: bold;">var</span> RESULT<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;result&quot;</span>;
<span style="color: #0033ff; font-weight: bold;">public</span> static <span style="color: #6699cc; font-weight: bold;">var</span> FAULT<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;fault&quot;</span>; 
&nbsp;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _eventList<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=object%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:object.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Object</span></a>;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _service<span style="color: #000000; font-weight: bold;">:</span>RemoteObject;
&nbsp;
....
&nbsp;
<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> createRemoteObject<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>
	_service = <span style="color: #0033ff; font-weight: bold;">new</span> RemoteObject<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
	_service.endpoint = <span style="color: #990000;">&quot;http://www.themorphicgroup.com/CelebrationEventList/service/gateway.php&quot;</span>;
	_service.<span style="color: #004993;">source</span>=<span style="color: #990000;">&quot;CelebrationEventService&quot;</span>;
	_service.destination = <span style="color: #990000;">&quot;amfphp&quot;</span>; 
&nbsp;
	_service.showBusyCursor=<span style="color: #0033ff; font-weight: bold;">true</span>;
&nbsp;
	_service.getList.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>RESULT, getListResultHandler<span style="color: #000000;">&#41;</span>;
	_service.loginUser.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>RESULT, loginUserResultHandler<span style="color: #000000;">&#41;</span>;
	_service.createUser.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>RESULT, createUserResultHandler<span style="color: #000000;">&#41;</span>;
	_service.signUpForItem.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>RESULT, signUpForItemResultHandler<span style="color: #000000;">&#41;</span>;
&nbsp;
	_service.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>FAULT, faultHandler<span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> getListResultHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000000; font-weight: bold;">:</span>ResultEvent<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>
	_eventList = event.result;
&nbsp;
	<span style="color: #6699cc; font-weight: bold;">var</span> dataProvider<span style="color: #000000; font-weight: bold;">:</span>ArrayCollection = <span style="color: #0033ff; font-weight: bold;">new</span> ArrayCollection<span style="color: #000000;">&#40;</span>event.result <span style="color: #0033ff; font-weight: bold;">as</span> <a href="http://www.google.com/search?q=array%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:array.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Array</span></a><span style="color: #000000;">&#41;</span>;
&nbsp;
	list1.dataProvider = dataProvider;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> loginUserResultHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000000; font-weight: bold;">:</span>ResultEvent<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>
	_currentUser = event.result <span style="color: #0033ff; font-weight: bold;">as</span> User;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>event.result <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>
		currentState=<span style="color: #990000;">'List'</span>;
		_service.getList<span style="color: #000000;">&#40;</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>
		mx.controls.Alert.<span style="color: #004993;">show</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;Login Failed&quot;</span><span style="color: #000000;">&#41;</span>;
	<span style="color: #000000;">&#125;</span>
	inpName.<span style="color: #004993;">text</span> = <span style="color: #990000;">&quot;&quot;</span>;
	inpEmail.<span style="color: #004993;">text</span> = <span style="color: #990000;">&quot;&quot;</span>;
	inpPassword.<span style="color: #004993;">text</span> = <span style="color: #990000;">&quot;&quot;</span>;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> createUserResultHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000000; font-weight: bold;">:</span>ResultEvent<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>event.result <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>
		<span style="color: #6699cc; font-weight: bold;">var</span> user<span style="color: #000000; font-weight: bold;">:</span>User = User<span style="color: #000000;">&#40;</span>event.result <span style="color: #0033ff; font-weight: bold;">as</span> User<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>
		mx.controls.Alert.<span style="color: #004993;">show</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;User Creation Failed&quot;</span><span style="color: #000000;">&#41;</span>;
	<span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>user <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>
		_service.loginUser<span style="color: #000000;">&#40;</span>user.email, user.password<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>
		mx.controls.Alert.<span style="color: #004993;">show</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;User Creation Failed&quot;</span><span style="color: #000000;">&#41;</span>;
	<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> signUpForItemResultHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000000; font-weight: bold;">:</span>ResultEvent<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>event.result<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>
		mx.controls.Alert.<span style="color: #004993;">show</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;Signed up for item&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>
		mx.controls.Alert.<span style="color: #004993;">show</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;Item could not be Signed up&quot;</span><span style="color: #000000;">&#41;</span>;
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> faultHandler <span style="color: #000000;">&#40;</span>event<span style="color: #000000; font-weight: bold;">:</span>FaultEvent<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>
	mx.controls.Alert.<span style="color: #004993;">show</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;Error&quot;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span></pre>
</div>
</div>
<div><strong>Code Sample - User VO</strong></div>
<div>
<div>
<pre class="actionscript3" style="font-family:monospace;">...
<span style="color: #9900cc; font-weight: bold;">package</span> com.themorphicgroup.celebrateEvent
<span style="color: #000000;">&#123;</span>
	<span style="color: #000000;">&#91;</span>RemoteClass<span style="color: #000000;">&#40;</span>alias=<span style="color: #990000;">&quot;com.themorphicgroup.celebrateEvent.User&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> User
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _id<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: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _fullName<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: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _email<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: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _password<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>;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> User<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">get</span> fullName<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><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: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">return</span> _fullName;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">set</span> fullName<span style="color: #000000;">&#40;</span>v<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: #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>
			_fullName = v;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">get</span> id<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><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: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">return</span> _id;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">set</span> id<span style="color: #000000;">&#40;</span>v<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: #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>
			_id = v;
		<span style="color: #000000;">&#125;</span>
&nbsp;
    	        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">get</span> email<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><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: #000000;">&#123;</span>
    		       <span style="color: #0033ff; font-weight: bold;">return</span> _email;
    	       <span style="color: #000000;">&#125;</span>
&nbsp;
    	       <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">set</span> email<span style="color: #000000;">&#40;</span>v<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: #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>
    		      _email = v;
    	       <span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">get</span> password<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><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: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">return</span> _password;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">set</span> password<span style="color: #000000;">&#40;</span>v<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: #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>
			_password = v;
		<span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre>
</div>
</div>
<p>You can find the working application here <a href="http://www2.themorphicgroup.com/projects/celebrationEventList/" target="_blank">"CelebrationEvent"</a>. I am still adding more features and fixing some issues but the setup is the same. Check it out.</p>
<p style="margin-bottom: 0in;"><strong>Array to ArrayCollection</strong></p>
<p style="margin-bottom: 0in;">Just something to point out... One question comes to mind when working with AMFPHP and Flex... How to convert arrays in php to  ArrayCollection for Flex/Actionscript? I found the best idea for me was to convert the array within the result call.</p>
<p style="margin-bottom: 0in;" align="left"><span style="font-family: Courier New,monospace;"><span style="font-size: x-small;"><span style="color: #6699cc;"><strong>...</strong></span></span></span></p>
<p style="margin-bottom: 0in;" align="left"><span style="font-family: Courier New,monospace;"><span style="font-size: x-small;"><span style="color: #6699cc;"><strong>var</strong></span><span style="color: #000000;"> dataProvider:ArrayCollection = </span><span style="color: #0033ff;"><strong>new</strong></span><span style="color: #000000;"> ArrayCollection(event.result </span><span style="color: #0033ff;"><strong>as</strong></span><span style="color: #000000;"> Array);</span></span></span></p>
<p style="margin-bottom: 0in;">…</p>
<p style="margin-bottom: 0in;">For more on this subject check out this blog from <a href="http://wadearnold.com/blog/flash/amfphp/amfphp-arraycollection" target="_blank">Wade Arnald - AMFPHP ArrayCollection</a></p>
<p style="margin-bottom: 0in;"><strong>Conclusion</strong></p>
<p style="margin-bottom: 0in;">I can't praise Adobe enough with the improvement of the debugging process. Now you have a network monitor where you can see the data packet and inspect the request and response. You can set conditional breakpoints ..  Check out this video blog by<a href="http://www.iheartair.com/?p=322" target="_blank"> Jun Heider</a> (thanks Seth)</p>
<p style="margin-bottom: 0in;">
<p style="margin-bottom: 0in;">The path from Illustrator file to Flash Catalyst to Flash Builder was pretty straight forward. I did have a few weird moments in Flash Catalyst.</p>
<ul>
<li>
<p style="margin-bottom: 0in;">I don't have Illustrator CS 4. So I 	couldn't edit any text or assets in Flash Catalyst. It would be nice to be 	able to have this functionality but I understand the push 	to most recent version of Adobe products.</p>
</li>
<li>
<p style="margin-bottom: 0in;">In Flash Catalyst, I wanted to change 	every component name to a logical naming convention. That didn't go 	so well. You can select the component in the library but there is no 	preview and no selection on the stage.</p>
</li>
<li>
<p style="margin-bottom: 0in;">Within Flash Catalyst, make sure you copy from the last 	state that you created when creating new states. I made some mistakes in a few tests assuming that I could copy through states. Not a good idea.</p>
</li>
<li>
<p style="margin-bottom: 0in;">The code that is generated when 	you import your Catalyst project to Flash Builder 4 is impressive 	but still bulky. A developer would still have a intense chore to 	wire it up the application properly. And with that … try to use a design pattern 	or established framework with what is given? One big Main class. I'm 	still scratching my head on what to do on that issue.</p>
</li>
</ul>
<p style="margin-bottom: 0in;">
<p style="margin-bottom: 0in;">With all these criticisms I do understand that this is beta software... I will say that Flash Catalyst is a great tool to start putting the pieces together. In fact, I don't think I could start a Flex 4 (with Spark component) project without Flash Catalyst at the start. I have a lot of hope in the evolution of the Flash Platform.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.themorphicgroup.com/blog/2009/06/25/a-chat-about-php-with-flash-builder-4-and-adobe-catalyst/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
