<?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>Adnan Doric &#187; Flex</title>
	<atom:link href="http://www.adnandoric.com/category/flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.adnandoric.com</link>
	<description>Flex, Flash, AIR, RIA</description>
	<lastBuildDate>Thu, 02 Jun 2011 08:34:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Flex &#8220;Hero&#8221; public preview is out</title>
		<link>http://www.adnandoric.com/2010/10/26/flex-hero-public-preview-is-out/</link>
		<comments>http://www.adnandoric.com/2010/10/26/flex-hero-public-preview-is-out/#comments</comments>
		<pubDate>Tue, 26 Oct 2010 09:15:58 +0000</pubDate>
		<dc:creator>adnandoric</dc:creator>
				<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Flash Player]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.adnandoric.com/?p=309</guid>
		<description><![CDATA[You can read more about it on Adobe Flex Team blog : Public Preview Releases of Flex SDK, Flash Builder and Flash Catalyst available for download]]></description>
			<content:encoded><![CDATA[<p>You can read more about it on <a title="Flex Team Blox" href="http://blogs.adobe.com/flex">Adobe Flex Team blog</a> :</p>
<p><a href="http://feedproxy.google.com/%7Er/flexteam/%7E3/guylSS75kso/public-preview-releases-of-flex-sdk-flash-builder-and-flash-catalyst-available-for-download.html" target="_blank">Public Preview Releases of Flex SDK, Flash Builder and Flash Catalyst available for download</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.adnandoric.com/2010/10/26/flex-hero-public-preview-is-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use multiple Eclipse versions with one Flex plugin installation</title>
		<link>http://www.adnandoric.com/2009/07/13/how-to-use-multiple-eclipse-versions-with-one-flex-plugin-installation/</link>
		<comments>http://www.adnandoric.com/2009/07/13/how-to-use-multiple-eclipse-versions-with-one-flex-plugin-installation/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 12:59:06 +0000</pubDate>
		<dc:creator>adnandoric</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[multiple]]></category>

		<guid isPermaLink="false">http://www.adnandoric.com/?p=227</guid>
		<description><![CDATA[I was using Eclipse 3.4 Ganymede until now but wanted to test the new Eclipse 3.5 Galileo with my current Flex plugin installation. The problem is that if you try to install a Flex plugin for the second time, it tells you that it is already installed and you have to choose another install path. [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">I was using Eclipse 3.4 Ganymede until now but wanted to test  the new <a title="Eclipse Galileo Release Now Available" href="http://www.eclipse.org/org/press-release/20090624_galileo.php" target="_blank">Eclipse 3.5 Galileo</a> with my current Flex plugin installation. The problem is that if you try to install a Flex plugin for the second time, it tells you that it is already installed and you have to choose another install path. Obviously, I don&#8217;t want to have a separate Flex installation for each Eclipse IDE so I looked for a solution.</p>
<p style="text-align: justify;">The solution is quite simple when you know what to look for, if you examine both Eclipse installations, you&#8217;ll notice that there is an extra &#8220;<strong>links</strong>&#8221; folder in one of them where the Flex is installed. You just have to copy the file <strong><em>com.adobe.flexbuilder.feature.core.link</em></strong> into the the new eclipse&#8217;s &#8220;<strong>links</strong>&#8221; folder (create it if it doesn&#8217;t exists).</p>
<p style="text-align: justify;">Or, if you prefer, you can create it from scratch, it is pretty simple as it contains only the path to the Flex plugin installation (path keyword is not mandatory) :</p>
<blockquote><p>path=C:/Program Files/Adobe/Flex Builder 3 Plug-in</p></blockquote>
<p>This solution works of course, for multiple Eclipse installations.</p>
<p>(For the moment, there is a<a title="Eclipse 3.5 and Flex builder 3 plug-in" href="http://bugs.adobe.com/jira/browse/FB-21284" target="_blank"> bug in Flex compiler</a>, so we have to wait)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adnandoric.com/2009/07/13/how-to-use-multiple-eclipse-versions-with-one-flex-plugin-installation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>We want Flex Builder for Linux</title>
		<link>http://www.adnandoric.com/2009/04/28/we-want-flex-builder-for-linux/</link>
		<comments>http://www.adnandoric.com/2009/04/28/we-want-flex-builder-for-linux/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 19:48:05 +0000</pubDate>
		<dc:creator>adnandoric</dc:creator>
				<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.adnandoric.com/?p=142</guid>
		<description><![CDATA[Adobe is planning to halt the Linux Flex Builder development (currently in alpha stage) ! I am on windows only because of Adobe products, mainly Flex. I would like to «format c:» and work on my ubuntu Do you want to develop Flex applications on Linux? Vote for it now and save the world!]]></description>
			<content:encoded><![CDATA[<p>Adobe is planning to halt the Linux Flex Builder development (<a title="Flex builder for Linux" href="http://labs.adobe.com/technologies/flex/flexbuilder_linux/" target="_blank">currently in alpha stage</a>) !</p>
<p>I am on windows only because of Adobe products, mainly Flex. I would like to «format c:»  and work on my ubuntu <img src='http://www.adnandoric.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Do you want to develop Flex applications on Linux?</p>
<p><a href="http://bugs.adobe.com/jira/browse/FB-19053" target="_blank">Vote for it now and save the world!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.adnandoric.com/2009/04/28/we-want-flex-builder-for-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Error creating AIR File: 303</title>
		<link>http://www.adnandoric.com/2009/04/13/error-creating-air-file-303/</link>
		<comments>http://www.adnandoric.com/2009/04/13/error-creating-air-file-303/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 14:08:10 +0000</pubDate>
		<dc:creator>adnandoric</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[error 303]]></category>

		<guid isPermaLink="false">http://www.adnandoric.com/?p=136</guid>
		<description><![CDATA[Adding custom icons to your AIR application can be painful if you forget to copy them in &#8220;bin-release&#8221; folder prior to exporting your project. You can also just check in &#8220;Copy non-embedded files to output folder&#8221; in Flex compiler properties:]]></description>
			<content:encoded><![CDATA[<p>Adding custom icons to your AIR application can be painful if you forget to copy them in &#8220;bin-release&#8221; folder prior to exporting your project.   <img src='http://www.adnandoric.com/wp-includes/images/smilies/icon_cool.gif' alt='8-)' class='wp-smiley' /> </p>
<p>You can also just check in &#8220;Copy non-embedded files to output folder&#8221; in Flex compiler properties:</p>
<div id="attachment_140" class="wp-caption aligncenter" style="width: 548px"><img class="size-full wp-image-140" title="error_3031" src="http://www.adnandoric.com/wp-content/uploads/2009/04/error_3031.jpg" alt="Flex compiler properties" width="538" height="315" /><p class="wp-caption-text">Flex compiler properties</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.adnandoric.com/2009/04/13/error-creating-air-file-303/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Bugquash.com</title>
		<link>http://www.adnandoric.com/2009/03/28/bugquashcom/</link>
		<comments>http://www.adnandoric.com/2009/03/28/bugquashcom/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 15:50:35 +0000</pubDate>
		<dc:creator>adnandoric</dc:creator>
				<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[Bugquash]]></category>
		<category><![CDATA[Flex SDK]]></category>

		<guid isPermaLink="false">http://www.adnandoric.com/?p=131</guid>
		<description><![CDATA[In about one hour will begin the first session of Flex SDK community bug chasing and fixing. Online participation is possible too. You are experienced Flex developer? Stop reading and get ready! goToAndFixFlex(); Want this for your site? http://bugquash.com/]]></description>
			<content:encoded><![CDATA[<p>In about one hour will begin the first session of Flex SDK community bug chasing and fixing.</p>
<p>Online participation is possible too.</p>
<p>You are experienced Flex developer? Stop reading and get ready!  <img src='http://www.adnandoric.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p style="text-align: center;"><a title="bugquash.com" href="http://bugquash.com/" target="_blank">goToAndFixFlex();</a></p>
<p style="visibility: visible; text-align: center;"><object width="300" height="170" data="http://bugquash.com/includes/flash/countdown/countdown_v1.swf" type="application/x-shockwave-flash"><param name="name" value="countdown" /><param name="align" value="middle" /><param name="src" value="http://bugquash.com/includes/flash/countdown/countdown_v1.swf" /><param name="wmode" value="transparent" /><param name="quality" value="high" /></object><br />
<a href="http://www.bugquash.com/promos/" target="_blank">Want this for your site?</a></p>
<p><a title="bugquash.com" href="http://bugquash.com/" target="_blank">http://bugquash.com/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.adnandoric.com/2009/03/28/bugquashcom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VerifyError: Error #1025: An invalid register 3 was accessed</title>
		<link>http://www.adnandoric.com/2009/03/03/verifyerror-error-1025-an-invalid-register-3-was-accessed/</link>
		<comments>http://www.adnandoric.com/2009/03/03/verifyerror-error-1025-an-invalid-register-3-was-accessed/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 19:34:11 +0000</pubDate>
		<dc:creator>adnandoric</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[1025]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[VerifyError]]></category>

		<guid isPermaLink="false">http://www.adnandoric.com/?p=122</guid>
		<description><![CDATA[Working with XML in Flex or AIR can sometimes be very painfull if you mess with namespaces. I just spent few hours figuring how to solve the «VerifyError» puzzle: VerifyError: Error #1025: An invalid register 1 was accessed. VerifyError: Error #1025: An invalid register 2 was accessed. VerifyError: Error #1025: An invalid register 3 was [...]]]></description>
			<content:encoded><![CDATA[<p>Working with XML in Flex or AIR can sometimes be very painfull if you mess with namespaces.<br />
I just spent few hours figuring how to solve the «VerifyError» puzzle:</p>
<p><code>VerifyError: Error #1025: An invalid register 1 was accessed.<br />
VerifyError: Error #1025: An invalid register 2 was accessed.<br />
VerifyError: Error #1025: An invalid register 3 was accessed.<br />
VerifyError: Error #1025: An invalid register 4 was accessed.<br />
VerifyError: Error #1025: An invalid register 5 was accessed.</code></p>
<p>I was loading some fancy XML spitted by REST backend and had to set the default xml namespace in a function scope in order to access it:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">default</span> <span style="color: #0066CC;">xml</span> namespace = <span style="color: #0066CC;">xml</span>.<span style="color: #006600;">namespace</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>Don&#8217;t ask me why, but you have to «reset it» when you finish manipulating the XML otherwise you wont be able to call functions in the same scope:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">default</span> <span style="color: #0066CC;">xml</span> namespace = <span style="color: #000000; font-weight: bold;">new</span> Namespace<span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<div id="attachment_128" class="wp-caption aligncenter" style="width: 509px"><img class="size-full wp-image-128" title="zoidberg-why" src="http://www.adnandoric.com/wp-content/uploads/2009/03/zoidberg-why.png" alt="Zoidberg: Why? Why? Why?" width="499" height="301" /><p class="wp-caption-text">Zoidberg: Why? Why? Why?</p></div>
<p>I hope that helps  <img src='http://www.adnandoric.com/wp-includes/images/smilies/icon_cool.gif' alt='8-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.adnandoric.com/2009/03/03/verifyerror-error-1025-an-invalid-register-3-was-accessed/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Preloader deep linking bug still not resolved</title>
		<link>http://www.adnandoric.com/2009/02/11/preloader-deep-linking-bug-still-not-resolved/</link>
		<comments>http://www.adnandoric.com/2009/02/11/preloader-deep-linking-bug-still-not-resolved/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 11:41:46 +0000</pubDate>
		<dc:creator>adnandoric</dc:creator>
				<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flash Player]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.adnandoric.com/?p=114</guid>
		<description><![CDATA[If you try to implement the deep linking for flash/flex using SWFAddress or similar technology, you will notice the &#8220;#&#8221; character (anchor) somewhere in the URL, this is the delimiter for the interpreted URL string by the browser. If the string following the anchor change in the address bar, the browser will not change (nor [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><a id="top" name="top"></a>If you try to implement the <a title="Deep linking on Wikipedia" href="http://en.wikipedia.org/wiki/Deep_linking" target="_blank">deep linking</a> for flash/flex using <a title="SWFAddress" href="http://www.asual.com/swfaddress/" target="_blank">SWFAddress</a> or similar technology, you will notice the &#8220;#&#8221; character (anchor) somewhere in the URL, this is the delimiter for the interpreted URL string by the browser. If the string following the anchor change in the <a title="Address bar" href="http://en.wikipedia.org/wiki/Address_bar" target="_blank">address bar</a>, the browser will not change (nor refresh) the currently displayed page, instead it will try to find that anchor in it&#8217;s body. In the ordinary HTML based pages, the browser simply scrolls to the anchor somewhere in the page. For example, on this page I defined two anchors: <a href="#top">top anchor</a> and <a href="#bottom">bottom anchor</a>. If you click on those links, you&#8217;ll notice that the browser only scrolls the page.</p>
<p style="text-align: justify;">Whatever, long story short, this feature can be used to navigate inside flash content as flash can read the URL and act accordingly, just by changing the URL string after the anchor. That&#8217;s great, really. The problem is that there is an issue in flash player or Flex (not quite sure) <a title="Preloader deep linking bug on Adobe JIRA" href="http://bugs.adobe.com/jira/browse/SDK-14162" target="_blank">filled more than a year ago</a> preventing the Flex preloader to show. This is not very important if your application&#8217;s SWF size is small enough, but when you have moderately large application, not seeing the feedback while preloading can actually be a real problem for your customers.</p>
<p style="text-align: justify;">But hey, you can do something about it if it bothers you as much as it bothers me: vote for it <img src='http://www.adnandoric.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>More votes means more chances this bug will be fixed soon.</p>
<p><a title="Preloader deep linking bug on Adobe JIRA" href="http://bugs.adobe.com/jira/browse/SDK-14162" target="_blank">Please vote for this bug to be resolved.</a></p>
<p>If you are not familiar with flash based deep linking, take a look at this page :</p>
<p><a title="SWFAddress flex deep linking" href="http://www.asual.com/swfaddress/samples/flex/" target="_blank">Flex deep linking based on SWFAddress example</a><br />
<a id="bottom" name="bottom"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.adnandoric.com/2009/02/11/preloader-deep-linking-bug-still-not-resolved/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Understanding the Flex Event propagation</title>
		<link>http://www.adnandoric.com/2008/12/29/understanding-the-flex-event-propagation/</link>
		<comments>http://www.adnandoric.com/2008/12/29/understanding-the-flex-event-propagation/#comments</comments>
		<pubDate>Mon, 29 Dec 2008 19:44:56 +0000</pubDate>
		<dc:creator>adnandoric</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Flash Player]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[bubbling]]></category>
		<category><![CDATA[capturing]]></category>
		<category><![CDATA[event flow]]></category>
		<category><![CDATA[events]]></category>
		<category><![CDATA[itemRenderer]]></category>
		<category><![CDATA[propagation]]></category>
		<category><![CDATA[targeting]]></category>

		<guid isPermaLink="false">http://www.adnandoric.com/?p=40</guid>
		<description><![CDATA[Everybody knows that ActionScript is an event based language and that dispatching and listening events are the base of Flex development, so I&#8217;ll not emphasize it here. I will talk about something else, something more intriguing: event propagation. Most components communicate with others using events which conveys useful informations and data but only visual components [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Everybody knows that ActionScript is an event based language and that dispatching and listening events are the base of Flex development, so I&#8217;ll not emphasize it here. I will talk about something else, something more intriguing: <strong>event propagation</strong>. Most components communicate with others using events which conveys useful informations and data but only visual components (objects in the display list) can participate in what is called &#8220;<strong>event flow</strong>&#8220;. The event flow describes how an event object propagates through the display list in three phases: capturing, targeting and bubbling. Non-visual components are only concerned by what is called targeting phase.</p>
<p style="text-align: justify;">Event propagation mechanism is rather counter-intuitive and often misunderstood by new Flex developers. I&#8217;ll try to explain some of the key principles that you should keep in mind when working with events.</p>
<p><span id="more-40"></span></p>
<p style="text-align: justify;">The Flex event model is based on (a not so perfect implementation of) the <a title="DOM Level 3 Events" href="http://www.w3.org/TR/DOM-Level-3-Events/events.html" target="_blank">Document Object Model (DOM) Level 3 events model</a>. Visit the <a title="DOM Level 3 Events" href="http://www.w3.org/TR/DOM-Level-3-Events/events.html" target="_blank">w3 site</a> for more informations on the subject.</p>
<p>Take a look at the EventPropagation application :</p>
<div id="attachment_41" class="wp-caption aligncenter" style="width: 394px"><a title="EventPropagation.html" href="http://www.adnandoric.com/wp-content/uploads/2008/12/flex/EventPropagation/EventPropagation.html" target="_blank"><img class="size-full wp-image-41" title="event_propagation" src="http://www.adnandoric.com/wp-content/uploads/2008/12/event_propagation.jpg" alt="Event Propagation" width="384" height="310" /></a><p class="wp-caption-text">Event Propagation</p></div>
<ul>
<li><a title="EventPropagation.html" href="http://www.adnandoric.com/wp-content/uploads/2008/12/flex/EventPropagation/EventPropagation.html" target="_blank">launch application</a></li>
<li><a title="EventPropagation source" href="http://www.adnandoric.com/wp-content/uploads/2008/12/flex/EventPropagation/srcview/index.html" target="_blank">view source</a></li>
</ul>
<p style="text-align: justify;">As you can see, the blueBox (Vbox) is child of the EventPropagation (Application), the redBox (Vbox) is child of the blueBox and finally, &#8220;Click me!&#8221; button (Button) is child of the redBox :</p>
<pre>EventPropagation &gt; blueBox &gt; redBox &gt; button</pre>
<p style="text-align: justify;">There is something else that you can&#8217;t see in the application, but that is very important to know: Application has one parent, mx.managers.SystemManager, who has also one parent: flash.display.Stage (display list root). Both of them are DisplayObjects in the display list and thus participate in event flow. The final chain is as follows :</p>
<pre>Stage &gt; SystemManager &gt; EventPropagation &gt; blueBox &gt; redBox &gt; button</pre>
<p style="text-align: justify;">When you click on the &#8220;Click me!&#8221; button, the flash player initiates the event flow starting from the root element of the display list, Stage, goes down to the event dispatcher (Button) then it returns up again to the stage. It visits all of display objects between the root object and the event dispatcher, looking for registered MouseEvent.CLICK listeners in three phases.</p>
<p style="text-align: justify;">If the &#8220;useCapture&#8221; CheckBox is checked, six event listeners are set for all display objects in our chain with useCapture property set to true, that means that listeners will handle only the capturing phase. Because of that behavior, useCapture should be named useCaptureOnly in my opinion.</p>
<p>Example:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">this</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span> MouseEvent.<span style="color: #006600;">CLICK</span>, onClick, <span style="color: #000000; font-weight: bold;">true</span> <span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p style="text-align: justify;">If the CheckBox  is unchecked, all event listeners are removed then re-added with useCapture set to false (default behavior) thus the targeting and bubbling phases are monitored and the capturing phase is skipped.</p>
<p style="text-align: justify;">note: To monitor all three phases, event listeners need to be registered with useCapture set to false AND true.</p>
<p>Example:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">this</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span> MouseEvent.<span style="color: #006600;">CLICK</span>, onClick <span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">this</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span> MouseEvent.<span style="color: #006600;">CLICK</span>, onClick, <span style="color: #000000; font-weight: bold;">true</span> <span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p style="text-align: justify;">The status TextArea will display information about event propagation as it gathers it. Click on the button, the colored boxes or the application, with useCapture enabled or disabled and observe the status zone.</p>
<p style="text-align: justify;">This image shows aforementioned three distinct event flow phases: capturing, targeting and bubbling:</p>
<div id="attachment_42" class="wp-caption aligncenter" style="width: 410px"><img class="size-full wp-image-42" title="event_flow" src="http://www.adnandoric.com/wp-content/uploads/2008/12/event_flow.jpg" alt="Event flow" width="400" height="400" /><p class="wp-caption-text">Event flow</p></div>
<h4>Capturing Phase</h4>
<pre>Stage &gt; SystemManager &gt; EventPropagation &gt; blueBox &gt; redBox</pre>
<p style="text-align: justify;">If capturing is enabled, each item in the display list tree, starting from the root ancestor flash.display.Stage and going down the display list to the direct ancestor of the event dispatcher (target), is checked for event listeners. If one of those display objects is registered as an event listener for that specific triggered event, flash player creates the event object and pass it to the listener so it can handle it (event object is created when needed, not before, furthermore, once created its properties are changed as it propagates, no new event object is created). Event listeners registered for this phase can handle the event before it reaches its target.</p>
<h4>Targeting Phase</h4>
<pre>&gt; button &gt;</pre>
<p style="text-align: justify;">During this phase, the event object has reached the event&#8217;s target and its listeners are invoked (if any). Event&#8217;s currentTarget and target properties are the same at this very moment.</p>
<h4>Bubbling Phase</h4>
<pre>redBox &gt; blueBox &gt; EventPropagation &gt; SystemManager &gt; Stage</pre>
<p style="text-align: justify;">In bubbling phase, if bubbling is enabled (MouseEvent bubbles by default), events are emerging like Champagne bubbles on the surface taking the exact opposite path from capturing phase examining all event dispatcher&#8217;s ancestors starting from it&#8217;s direct parent and continuing up the display list to the flash.display.Stage root. Event listeners registered for this phase can handle the event after it has reached its target.</p>
<h3>Why should I care ?</h3>
<p style="text-align: justify;">Most of the time, we don&#8217;t have to care about all this stuff. All that matters is the targeting phase: we add the listener for the event on the target dispatching object and that&#8217;s it ! But sometimes you will be confronted to a situation where you will need to intercept and stop the propagation of an event before it even reaches the dispatching object ( it sounds weird I know <img src='http://www.adnandoric.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ).</p>
<h3>Stopping the propagation</h3>
<p style="text-align: justify;">If an object is listening for this particular event, it can intercept it and stop its propagation if needed at any given moment in any phase. Two methods: stopPropagation() prevents the event to propagate after the current listener was executed, stopImmediatePropagation() prevents even the current object&#8217;s remaining listeners to execute.</p>
<p style="text-align: justify;">An obvious example would be an itemRenderer in a List-based component. Maybe you don&#8217;t want to select the item in the list when clicking it, but still want to execute some logic inside the renderer ?</p>
<p style="text-align: justify;">In the following example, the MouseEvent.DOWN is captured inside the itemRenderer and its propagation is stopped during the bubbling phase so it&#8217;s containing List will not be notified thus the related item will not be selected.</p>
<p>Example:<br />
<p><a href="http://www.adnandoric.com/2008/12/29/understanding-the-flex-event-propagation/"><em>Click here to view the embedded video.</em></a></p></p>
<h3>Prioritize Events</h3>
<p style="text-align: justify;">If several listeners are listening a same event on a dispatcher, it is possible to define priority for each of them and thus control the order they are executed. Higher the priority, sooner the listener is triggered.</p>
<p>Example:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">this</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span> MouseEvent.<span style="color: #006600;">CLICK</span>, onClick3, <span style="color: #000000; font-weight: bold;">false</span>, -<span style="color: #cc66cc;">8</span> <span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">this</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span> MouseEvent.<span style="color: #006600;">CLICK</span>, onClick1, <span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #cc66cc;">4</span> <span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">this</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span> MouseEvent.<span style="color: #006600;">CLICK</span>, onClick2, <span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p style="text-align: justify;">In this example, the handlers will be called in this order : onClick1, onClick2, onClick3.</p>
<p>That&#8217;s all folks !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adnandoric.com/2008/12/29/understanding-the-flex-event-propagation/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Update your Flex SDK to 3.2</title>
		<link>http://www.adnandoric.com/2008/12/23/update-your-flex-sdk-to-32/</link>
		<comments>http://www.adnandoric.com/2008/12/23/update-your-flex-sdk-to-32/#comments</comments>
		<pubDate>Tue, 23 Dec 2008 11:14:15 +0000</pubDate>
		<dc:creator>adnandoric</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Flex Builder]]></category>

		<guid isPermaLink="false">http://www.adnandoric.com/?p=25</guid>
		<description><![CDATA[If you are lucky, the eclipse feature Help &#62; Search for Flex Builder Updates will work for you. I am not lucky so it doesn&#8217;t works. There is a bug filled for Windows Vista based computers (I am on windows XP 64bit). Anyway, there is Flex builder updater on Adobe site, maybe it will help [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">If you are lucky, the eclipse feature Help &gt; Search for Flex Builder Updates will work for you. I am not lucky so it doesn&#8217;t works. There is a <a title="Flex builder Vista bug" href="http://bugs.adobe.com/jira/browse/FB-14132" target="_blank">bug filled for Windows Vista</a> based computers (I am on windows XP 64bit).</p>
<div id="attachment_28" class="wp-caption aligncenter" style="width: 393px"><img class="size-full wp-image-28" title="flex_builder_eclipse_update" src="http://www.adnandoric.com/wp-content/uploads/2008/12/flex_builder_eclipse_update.jpg" alt="Flex builder Eclipse update" width="383" height="325" /><p class="wp-caption-text">Flex builder Eclipse update</p></div>
<p style="text-align: justify;">Anyway, there is Flex builder updater on Adobe site, maybe it will help someone out there :</p>
<p><a title="Flex builder updater 3.0.2" href="http://www.adobe.com/support/flex/downloads_updaters.html" target="_blank">Go and grab the Flex builder 3.0.2 updater</a>.</p>
<p style="text-align: justify;">If you have some more time, you can read Read the <a title="Matt Chotin" href="http://weblogs.macromedia.com/mchotin/" target="_blank">Matt Chotin&#8217;s</a> article on subject <a title="Introducing Flex SDK 3.2 and Flex Builder 3.0.2" href="http://www.adobe.com/devnet/flex/articles/sdk32_fb302.html" target="_blank">here</a>.</p>
<p>Bug fixes :</p>
<ul>
<li><a title="SDK Bug Fixes" href="https://bugs.adobe.com/jira/secure/IssueNavigator.jspa?mode=hide&amp;requestId=11865" target="_blank">SDK</a></li>
<li><a title="IDE Bug Fixes" href="https://bugs.adobe.com/jira/secure/IssueNavigator.jspa?mode=hide&amp;requestId=11866" target="_blank">IDE</a></li>
<li><a title="Data visualization Bug Fixes" href="https://bugs.adobe.com/jira/secure/IssueNavigator.jspa?mode=hide&amp;requestId=11867" target="_blank">Data visualization components</a></li>
</ul>
<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adnandoric.com/2008/12/23/update-your-flex-sdk-to-32/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

