<?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>Sweeping Design &#187; flex</title>
	<atom:link href="http://www.sweepingdesign.com/blog/category/flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sweepingdesign.com/blog</link>
	<description>Flex, Drugs, and Rock and Roll</description>
	<lastBuildDate>Tue, 23 Mar 2010 22:15:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>ValidatorForm as a base class and in a TabbedNavigator</title>
		<link>http://www.sweepingdesign.com/blog/2008/07/09/validatorform-as-a-base-class-and-in-a-tabbednavigator/</link>
		<comments>http://www.sweepingdesign.com/blog/2008/07/09/validatorform-as-a-base-class-and-in-a-tabbednavigator/#comments</comments>
		<pubDate>Thu, 10 Jul 2008 01:54:07 +0000</pubDate>
		<dc:creator>dylan</dc:creator>
				<category><![CDATA[flex]]></category>
		<category><![CDATA[callLater()]]></category>
		<category><![CDATA[creationComplete]]></category>
		<category><![CDATA[TabbedNavigator]]></category>
		<category><![CDATA[ValidatorForm]]></category>

		<guid isPermaLink="false">http://www.sweepingdesign.com/wordpress/2008/07/09/validatorform-as-a-base-class-and-in-a-tabbednavigator/</guid>
		<description><![CDATA[I had trouble using ValidatorForm as the base tag for Form components, and still more trouble when I used those in a TabNavigator. In both cases, the fault was in trying to refer to add a CHANGE event listener to the as-yet null {source} for the validators.
The solution to the first part was to pull [...]]]></description>
			<content:encoded><![CDATA[<p>I had trouble using ValidatorForm as the base tag for Form components, and still more trouble when I used those in a TabNavigator. In both cases, the fault was in trying to refer to add a CHANGE event listener to the as-yet <code>null</code> {source} for the validators.</p>
<p>The solution to the first part was to pull the meat out of the validators() setter and into an assignValidators() function, saving the array of validators to a private _validators for later use in calling assignValidators() from creationComplete(). This worked until I used the ValidatorForm in a TabbedNavigator, which doesn&#8217;t create its grandchildren &#8211; our {source} &#8211; until the tab is activated (or unless you set creationPolicy=&#8217;all&#8217;, but a component just shouldn&#8217;t make you do that). The solution here is to use callLater(assignValidators) in creationComplete() instead of just assignValidators().</p>
<p>Here&#8217;s the <a href='http://www.sweepingdesign.com/wordpress/wp-content/validatorform.as' title='ValidatorForm.as'>source</a>, and what changed:</p>
<pre>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;private var _validators: Array;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public function set validators(validators:Array):void&nbsp;&nbsp;{ 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_validators = validators; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public function get validators(): Array {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return _validators;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;protected function creationComplete(): void {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;callLater(assignValidators);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;private function assignValidators(): void {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for(var i:uint=0; i &lt; validators.length; i++) { &#46;..
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.sweepingdesign.com/blog/2008/07/09/validatorform-as-a-base-class-and-in-a-tabbednavigator/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Working with Full-Screen in Flex</title>
		<link>http://www.sweepingdesign.com/blog/2008/07/02/working-with-full-screen-in-flex/</link>
		<comments>http://www.sweepingdesign.com/blog/2008/07/02/working-with-full-screen-in-flex/#comments</comments>
		<pubDate>Thu, 03 Jul 2008 00:39:56 +0000</pubDate>
		<dc:creator>dylan</dc:creator>
				<category><![CDATA[flex]]></category>
		<category><![CDATA[full-screen]]></category>

		<guid isPermaLink="false">http://www.sweepingdesign.com/wordpress/2008/07/02/working-with-full-screen-in-flex/</guid>
		<description><![CDATA[I visited the topic of using flex in full-screen for the first time today and found the examples at Flex Examples and Everything Flex wanting in clarity and style. Here, then, is the low-down &#8211; as clean and simple as it gets!

<object	type="application/x-shockwave-flash"
			data="http://www.sweepingdesign.com/wordpress/wp-content/fullscreentest.swf"
			width="300"
			height="300">
	<param name="movie" value="http://www.sweepingdesign.com/wordpress/wp-content/fullscreentest.swf" />
	<param name=menu" value="false" />
	<param name=allowFullScreen" value="true" />
</object>
View source here.
This example allows you to enter [...]]]></description>
			<content:encoded><![CDATA[<p>I visited the topic of using flex in full-screen for the first time today and found the examples at <a href="http://blog.flexexamples.com/2007/08/07/creating-full-screen-flex-applications">Flex Examples</a> and <a href="http://blog.everythingflex.com/2006/10/17/lets-go-full-screen-sample/">Everything Flex</a> wanting in clarity and style. Here, then, is the low-down &#8211; as clean and simple as it gets!</p>

<object	type="application/x-shockwave-flash"
			data="http://www.sweepingdesign.com/wordpress/wp-content/fullscreentest.swf"
			width="300"
			height="300">
	<param name="movie" value="http://www.sweepingdesign.com/wordpress/wp-content/fullscreentest.swf" />
	<param name=menu" value="false" />
	<param name=allowFullScreen" value="true" />
</object>
<p>View source <a href="http://www.sweepingdesign.com/wordpress/wp-content/srcview/index.html">here</a>.</p>
<p>This example allows you to enter full-screen with &#8220;fullScreen=true&#8221; and exit with &#8220;fullScreen=false&#8221;. The listener for FullScreenEvent.FULL_SCREEN updates fullScreen in case the user exits by pressing escape rather than by clicking the checkbox. As a result, fullScreen is bindable, as shown in the checkbox.</p>
<p>Do note that you will need to set allowFullScreen to true in your project&#8217;s index.template.html, lest you get:<br />
<code>Error #2152: Full screen mode is not allowed.</code></p>
<pre>
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; layout=&quot;absolute&quot; &gt;
&nbsp;&nbsp;&lt;mx:initialize&gt;&lt;![CDATA[
&nbsp;&nbsp;&nbsp;&nbsp;systemManager.stage.addEventListener(
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FullScreenEvent.FULL_SCREEN,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function(event: FullScreenEvent): void { fullScreen = event.fullScreen; }
&nbsp;&nbsp;&nbsp;&nbsp;);
&nbsp;&nbsp;]]&gt;&lt;/mx:initialize&gt;
&nbsp;
&nbsp;&nbsp;&lt;mx:Script&gt;&lt;![CDATA[
&nbsp;&nbsp;&nbsp;&nbsp;private var _fullScreen: Boolean;
&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;[Bindable] public function get fullScreen(): Boolean { return _fullScreen; }
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;public function set fullScreen(isFull:Boolean):void {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_fullScreen = isFull;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;stage.displayState = (isFull) ? StageDisplayState.FULL_SCREEN : StageDisplayState.NORMAL; }
&nbsp;&nbsp;]]&gt;&lt;/mx:Script&gt;
&nbsp;
&nbsp;&nbsp;&lt;mx:CheckBox id=&quot;fs&quot; label=&quot;Full Screen&quot;
&nbsp;&nbsp;&nbsp;&nbsp;click=&quot;fullScreen=event.target.selected&quot; selected=&quot;{fullScreen}&quot;
&nbsp;&nbsp;&nbsp;&nbsp;horizontalCenter=&quot;0&quot; verticalCenter=&quot;0&quot;/&gt;
&nbsp;
&lt;/mx:Application&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.sweepingdesign.com/blog/2008/07/02/working-with-full-screen-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
