<?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>dndigital.net &#187; Flex</title>
	<atom:link href="http://dndigital.net/tag/flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://dndigital.net</link>
	<description>Notes on Adobe Flash, Flex, AIR Development</description>
	<lastBuildDate>Wed, 22 Jun 2011 11:15:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>HTML5 training course &#8211; 13th &amp; 14th December 2010 &#8211; London</title>
		<link>http://dndigital.net/2010/11/html5-training-course-13th-14th-december-2010-london/</link>
		<comments>http://dndigital.net/2010/11/html5-training-course-13th-14th-december-2010-london/#comments</comments>
		<pubDate>Thu, 25 Nov 2010 12:52:23 +0000</pubDate>
		<dc:creator>Kat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[2]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[best]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[classes]]></category>
		<category><![CDATA[course]]></category>
		<category><![CDATA[courses]]></category>
		<category><![CDATA[days]]></category>
		<category><![CDATA[dndigital]]></category>
		<category><![CDATA[easy]]></category>
		<category><![CDATA[expect]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[learn]]></category>
		<category><![CDATA[London]]></category>
		<category><![CDATA[Millahn]]></category>
		<category><![CDATA[new]]></category>
		<category><![CDATA[Nils]]></category>
		<category><![CDATA[now]]></category>
		<category><![CDATA[training]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://dndigital.net/?p=358</guid>
		<description><![CDATA[Learn HTML5 before 2011!!! Nils is running our next course on 13th &#38; 14th December 2010. Book now on: http://html5-december-auto.eventbrite.com/ or training@dndigital.net Hello: 0 2 0 7 7 4 9 3 7 7 0 What can you expect? http://dndigital.net/training/html5/ See you soon!]]></description>
			<content:encoded><![CDATA[<p>Learn HTML5 before 2011!!!</p>
<p>Nils is running our next course on 13th &amp; 14th December 2010.</p>
<p>Book now on:</p>
<p>http://html5-december-auto.eventbrite.com/</p>
<p>or training@dndigital.net</p>
<p>Hello: 0 2 0 7 7 4 9 3 7 7 0</p>
<p>What can you expect?<br />

http://dndigital.net/training/html5/</p>

<p>See you soon!</p>
]]></content:encoded>
			<wfw:commentRss>http://dndigital.net/2010/11/html5-training-course-13th-14th-december-2010-london/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RobotLegs Flex Popup Example</title>
		<link>http://dndigital.net/2009/10/robotlegs-as3-framework-flex-popup-example/</link>
		<comments>http://dndigital.net/2009/10/robotlegs-as3-framework-flex-popup-example/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 14:29:50 +0000</pubDate>
		<dc:creator>Nils</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[RobotLegs AS3]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://dndigital.net/blog/?p=39</guid>
		<description><![CDATA[There has been some discussion on the RobotLegs AS3 Framework Google Group about the best workflow for launching popups in Flex, so I thought I&#8217;d do a quick sample. The workflow consists of: A Command to launch the popup (via the Flex PopupManager) A Mediator that handles events coming from the popup view component The [...]]]></description>
			<content:encoded><![CDATA[<p>There has been some discussion on the <a href="http://groups.google.com/group/robotlegs">RobotLegs AS3 Framework Google Group</a> about the best workflow for launching popups in Flex, so I thought I&#8217;d do a quick sample.<span id="more-39"></span></p>
<p>The workflow consists of:</p>
<ul>
<li>A Command to launch the popup (via the Flex PopupManager)</li>
<li>A Mediator that handles events coming from the popup view component</li>
</ul>
<p>The popup view component&#8217;s Mediator also handles closing of the popup and removes itself from the RobotLegs mediatorMap when it&#8217;s no longer required.</p>
<p>Note: I should point out that the source for the SWF below includes only some of the RobotLegs framework source-code. To run the source-code, please <a href="http://github.com/robotlegs/robotlegs-framework">download the current version of RobotLegs</a>. </p>
<p>Here&#8217;s the SWF and sample code. Feel free to use and abuse, no warranties given or implied. <a href="http://tutorials.dndigital.net/flex/robotlegstitlewindow/srcview/" target="_blank">View source</a></p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_RobotLegsTitleWindow_374519545"
			class="flashmovie"
			width="400"
			height="400">
	<param name="movie" value="http://tutorials.dndigital.net/flex/robotlegstitlewindow/RobotLegsTitleWindow.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://tutorials.dndigital.net/flex/robotlegstitlewindow/RobotLegsTitleWindow.swf"
			name="fm_RobotLegsTitleWindow_374519545"
			width="400"
			height="400">
	<!--<![endif]-->
		
<p><a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p><a href="http://tutorials.dndigital.net/flex/robotlegstitlewindow/srcview/" target="_blank">View source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://dndigital.net/2009/10/robotlegs-as3-framework-flex-popup-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex UIComponent subclass needs to resize images</title>
		<link>http://dndigital.net/2008/08/flex-uicomponent-subclass-needs-to-resize-images/</link>
		<comments>http://dndigital.net/2008/08/flex-uicomponent-subclass-needs-to-resize-images/#comments</comments>
		<pubDate>Tue, 12 Aug 2008 12:57:17 +0000</pubDate>
		<dc:creator>Nils</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Image]]></category>
		<category><![CDATA[UIComponent]]></category>

		<guid isPermaLink="false">http://dndigital.net/blog/?p=15</guid>
		<description><![CDATA[The title could do with some improving &#8211; what I&#8217;m trying to say is that when subclassing UIComponent, any Image component instances need to be given an appropriate width/height. I have overlooked this time and time again, only to find that the image doesn&#8217;t appear &#8211; because it&#8217;s width and height are initialised to zero. [...]]]></description>
			<content:encoded><![CDATA[<p>The title could do with some improving &#8211; what I&#8217;m trying to say is that when subclassing UIComponent, any Image component instances need to be given an appropriate width/height. I have overlooked this time and time again, only to find that the image doesn&#8217;t appear &#8211; because it&#8217;s width and height are initialised to zero.</p>
<p>The following code will result in an image with zero width/height, so the image won&#8217;t show:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> img:Image = <span style="color: #000000; font-weight: bold;">new</span> Image<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
img.<span style="color: #006600;">source</span> = <span style="color: #ff0000;">&quot;myfile.jpg&quot;</span>;</pre></div></div>

<p>Solutions:</p>
<ol>
<li>Assign specific values for width and height:

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">img.<span style="color: #0066CC;">width</span> = <span style="color: #cc66cc;">100</span>;
img.<span style="color: #0066CC;">height</span> = <span style="color: #cc66cc;">100</span>;</pre></div></div>

</li>
<li>Set the &#8216;scaleContent&#8217; property to false &#8211; the image will then resize its container automatically, once it has loaded. Note that this technique <strong>has no effect if loading image from non-trusted domains</strong>!

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">img.<span style="color: #006600;">scaleContent</span> = <span style="color: #000000; font-weight: bold;">false</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// or, if loading cross-domain, provided a crossdomain policy file allows access</span>
img.<span style="color: #006600;">trustContent</span> = <span style="color: #000000; font-weight: bold;">true</span>;
img.<span style="color: #006600;">scaleContent</span> = <span style="color: #000000; font-weight: bold;">false</span>;</pre></div></div>

</li>
<li>Use an event listener to detect when the image has finished loading, then assign the correct width and height. <strong>Again, this will only work if the image has been loaded from a trusted domain.</strong>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">img.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">COMPLETE</span>, onImageComplete<span style="color: #66cc66;">&#41;</span>;
&nbsp;
protected <span style="color: #000000; font-weight: bold;">function</span> onImageComplete<span style="color: #66cc66;">&#40;</span>evt:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">var</span> img:Image = evt.<span style="color: #0066CC;">target</span> as Image;
    img.<span style="color: #006600;">removeEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">COMPLETE</span>, onImageComplete<span style="color: #66cc66;">&#41;</span>;
    img.<span style="color: #0066CC;">width</span> = img.<span style="color: #006600;">content</span>.<span style="color: #0066CC;">width</span>;
    img.<span style="color: #0066CC;">height</span> = img.<span style="color: #006600;">content</span>.<span style="color: #0066CC;">height</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

</li>
</ol>
<p>I&#8217;ve mainly blogged about it so I remember the next time I write some code &#8211; but maybe it will also help somebody else debug their missing image problems.</p>
]]></content:encoded>
			<wfw:commentRss>http://dndigital.net/2008/08/flex-uicomponent-subclass-needs-to-resize-images/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Accessing flashvars in a custom Flex preloader</title>
		<link>http://dndigital.net/2008/08/accessing-flashvars-in-a-custom-flex-preloader/</link>
		<comments>http://dndigital.net/2008/08/accessing-flashvars-in-a-custom-flex-preloader/#comments</comments>
		<pubDate>Mon, 04 Aug 2008 00:24:37 +0000</pubDate>
		<dc:creator>Nils</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[custom preloader]]></category>
		<category><![CDATA[flashvars]]></category>

		<guid isPermaLink="false">http://dndigital.net/blog/?p=3</guid>
		<description><![CDATA[Here&#8217;s a little code snippet that allows you to access flashvar parameters inside a custom Flex preloader. The custom preloader class extends Sprite and implements the IPreloaderDisplay class. Once the Sprite&#8217;s &#8216;root&#8217; property becomes available, you can use the standard AS3 way of accessing flashvars, namely: var flashvars:Object = root.loaderInfo.parameters; This code should be used [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a little code snippet that allows you to access flashvar parameters inside a custom Flex preloader.</p>
<p>The custom preloader class extends Sprite and implements the IPreloaderDisplay class. Once the Sprite&#8217;s &#8216;root&#8217; property becomes available, you can use the standard AS3 way of accessing flashvars, namely:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> flashvars:<span style="color: #0066CC;">Object</span> = root.<span style="color: #006600;">loaderInfo</span>.<span style="color: #006600;">parameters</span>;</pre></div></div>

<p>This code should be used once the &#8216;root&#8217; property has been initialised &#8211; for example in the &#8216;initialize()&#8217; method defined by the IPreloaderDisplay interface:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> initialize<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
     <span style="color: #000000; font-weight: bold;">var</span> flashvars:<span style="color: #0066CC;">Object</span> = root.<span style="color: #006600;">loaderInfo</span>.<span style="color: #006600;">parameters</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Just for reference, compare the above approach with the standard Flex method of accessing flashvar parameters &#8211; which becomes possible once the main Application instance has been created:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> flashvars:<span style="color: #0066CC;">Object</span> = Application.<span style="color: #006600;">application</span>.<span style="color: #006600;">parameters</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://dndigital.net/2008/08/accessing-flashvars-in-a-custom-flex-preloader/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

