<?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>FlexOut &#187; event</title>
	<atom:link href="http://flex.exposedout.net/tag/event/feed/" rel="self" type="application/rss+xml" />
	<link>http://flex.exposedout.net</link>
	<description>i am an itemrendrer in the making!</description>
	<lastBuildDate>Fri, 11 Jun 2010 15:54:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>event.bubbles, event.cancelable, and event.currenttarget</title>
		<link>http://flex.exposedout.net/2008/09/19/eventbubbles-eventcancelable-and-eventcurrenttarget/</link>
		<comments>http://flex.exposedout.net/2008/09/19/eventbubbles-eventcancelable-and-eventcurrenttarget/#comments</comments>
		<pubDate>Fri, 19 Sep 2008 09:17:23 +0000</pubDate>
		<dc:creator>Vikram singh</dc:creator>
				<category><![CDATA[flex]]></category>
		<category><![CDATA[bubbles]]></category>
		<category><![CDATA[cancelable]]></category>
		<category><![CDATA[currenttarget]]></category>
		<category><![CDATA[event]]></category>

		<guid isPermaLink="false">http://guavus.wordpress.com/?p=81</guid>
		<description><![CDATA[Perhaps some of you may not know this, but event-bubbling in Actionscript3.0 is way cool and well worth your attention. So read on. With event-bubbling you can let one Event subsequently call on every ancestor (containers of containers of etc.) of the DisplayObject that originally dispatched the Event, all the way up to the surface [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Perhaps some of you may not know this, but event-bubbling in Actionscript3.0 is way cool and well worth your attention. So read on.</p>
<p>With event-bubbling you can let one Event subsequently call on every ancestor (containers of containers of etc.) of the DisplayObject that originally dispatched the Event, all the way up to the surface (read: Stage), hence the name <em>‘bubbling’</em>.<br />
Perhaps noteworthy is that bubbling for an Event instance is disabled by default, and can only be activated by setting the <em>bubbling</em> parameter in the <a href="http://livedocs.adobe.com/flex/201/langref/flash/events/Event.html#Event()">Event constructor</a>.</p>
<p>Although the documentation doesn’t seem to make it all too apparent, event-bubbling is actually the reason why the Event class has a <em><a href="http://livedocs.adobe.com/flex/201/langref/flash/events/Event.html#currentTarget">currentTarget</a></em> property (as well as a <em><a href="http://livedocs.adobe.com/flex/201/langref/flash/events/Event.html#target">target</a></em> property).<br />
So what is the use of <em>Event.currentTarget</em>? While the <em>target</em> property will always have its value set to the DisplayObject that originally dispatched the Event, the <em>currentTarget</em> property always points to the DisplayObject that the event is currently processing (i.e. bubbling at).</p>
<p>Now, you will probably not always want your Event to bubble all the way up to the Stage of your movie. This is where the <em><a href="http://livedocs.adobe.com/flex/201/langref/flash/events/Event.html#cancelable">cancelable</a></em> property comes into the picture.<br />
Setting the <em>cancelable</em> property contructor-parameter to true allows you to call the<a href="http://livedocs.adobe.com/flex/201/langref/flash/events/Event.html#stopImmediatePropagation()"><em>stopPropagation()</em> and <em>stopImmediatePropagation()</em></a> methods later on. Both methods basically abort the bubbling process.<br />
The difference here is that the latter also aborts execution of other listeners for the same Event-type on the same currentTarget, whereas the former only aborts execution of listeners to subsequent targets.</p>
<p>The following <a title="Example" href="http://www.rubenswieringa.com/blog/wp-content/uploads/2007/flexeventbubbling/source/index.html" target="_blank">example</a> attempts to visualize the concept of event-bubbling in <abbr title="Actionscript3.0">AS3</abbr>.</p>
<p><strong><span style="color:#ccffcc;">Usage:</span></strong><span style="color:#ccffcc;"> Click the big button in the middle to dispatch a bubbling Event, and tick the CheckBoxes to have that Event canceled at a specific parent of the Button.</span></p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fflex.exposedout.net%2F2008%2F09%2F19%2Feventbubbles-eventcancelable-and-eventcurrenttarget%2F&amp;title=event.bubbles%2C%20event.cancelable%2C%20and%20event.currenttarget" title="DZone"><img src="http://flex.exposedout.net/wp-content/plugins/sociable/images/dzone.png" title="DZone" alt="DZone" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fflex.exposedout.net%2F2008%2F09%2F19%2Feventbubbles-eventcancelable-and-eventcurrenttarget%2F&amp;title=event.bubbles%2C%20event.cancelable%2C%20and%20event.currenttarget&amp;bodytext=Perhaps%20some%20of%20you%20may%20not%20know%20this%2C%20but%20event-bubbling%20in%20Actionscript3.0%20is%20way%20cool%20and%20well%20worth%20your%20attention.%20So%20read%20on.%0A%0AWith%20event-bubbling%20you%20can%20let%20one%20Event%20subsequently%20call%20on%20every%20ancestor%20%28containers%20of%20containers%20of%20etc.%29%20of%20t" title="Digg"><img src="http://flex.exposedout.net/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=event.bubbles%2C%20event.cancelable%2C%20and%20event.currenttarget%20-%20http%3A%2F%2Fflex.exposedout.net%2F2008%2F09%2F19%2Feventbubbles-eventcancelable-and-eventcurrenttarget%2F" title="Twitter"><img src="http://flex.exposedout.net/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fflex.exposedout.net%2F2008%2F09%2F19%2Feventbubbles-eventcancelable-and-eventcurrenttarget%2F&amp;title=event.bubbles%2C%20event.cancelable%2C%20and%20event.currenttarget&amp;annotation=Perhaps%20some%20of%20you%20may%20not%20know%20this%2C%20but%20event-bubbling%20in%20Actionscript3.0%20is%20way%20cool%20and%20well%20worth%20your%20attention.%20So%20read%20on.%0A%0AWith%20event-bubbling%20you%20can%20let%20one%20Event%20subsequently%20call%20on%20every%20ancestor%20%28containers%20of%20containers%20of%20etc.%29%20of%20t" title="Google Bookmarks"><img src="http://flex.exposedout.net/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fflex.exposedout.net%2F2008%2F09%2F19%2Feventbubbles-eventcancelable-and-eventcurrenttarget%2F" title="Technorati"><img src="http://flex.exposedout.net/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fflex.exposedout.net%2F2008%2F09%2F19%2Feventbubbles-eventcancelable-and-eventcurrenttarget%2F&amp;title=event.bubbles%2C%20event.cancelable%2C%20and%20event.currenttarget" title="StumbleUpon"><img src="http://flex.exposedout.net/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fflex.exposedout.net%2F2008%2F09%2F19%2Feventbubbles-eventcancelable-and-eventcurrenttarget%2F&amp;t=event.bubbles%2C%20event.cancelable%2C%20and%20event.currenttarget" title="MySpace"><img src="http://flex.exposedout.net/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fflex.exposedout.net%2F2008%2F09%2F19%2Feventbubbles-eventcancelable-and-eventcurrenttarget%2F" title="Sphinn"><img src="http://flex.exposedout.net/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fflex.exposedout.net%2F2008%2F09%2F19%2Feventbubbles-eventcancelable-and-eventcurrenttarget%2F&amp;title=event.bubbles%2C%20event.cancelable%2C%20and%20event.currenttarget&amp;notes=Perhaps%20some%20of%20you%20may%20not%20know%20this%2C%20but%20event-bubbling%20in%20Actionscript3.0%20is%20way%20cool%20and%20well%20worth%20your%20attention.%20So%20read%20on.%0A%0AWith%20event-bubbling%20you%20can%20let%20one%20Event%20subsequently%20call%20on%20every%20ancestor%20%28containers%20of%20containers%20of%20etc.%29%20of%20t" title="del.icio.us"><img src="http://flex.exposedout.net/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fflex.exposedout.net%2F2008%2F09%2F19%2Feventbubbles-eventcancelable-and-eventcurrenttarget%2F&amp;t=event.bubbles%2C%20event.cancelable%2C%20and%20event.currenttarget" title="Facebook"><img src="http://flex.exposedout.net/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fflex.exposedout.net%2F2008%2F09%2F19%2Feventbubbles-eventcancelable-and-eventcurrenttarget%2F&amp;title=event.bubbles%2C%20event.cancelable%2C%20and%20event.currenttarget" title="Reddit"><img src="http://flex.exposedout.net/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fflex.exposedout.net%2F2008%2F09%2F19%2Feventbubbles-eventcancelable-and-eventcurrenttarget%2F&amp;title=event.bubbles%2C%20event.cancelable%2C%20and%20event.currenttarget" title="Mixx"><img src="http://flex.exposedout.net/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://flex.exposedout.net/2008/09/19/eventbubbles-eventcancelable-and-eventcurrenttarget/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Event Propogation</title>
		<link>http://flex.exposedout.net/2008/09/16/event-propogation/</link>
		<comments>http://flex.exposedout.net/2008/09/16/event-propogation/#comments</comments>
		<pubDate>Tue, 16 Sep 2008 23:56:23 +0000</pubDate>
		<dc:creator>Vikram singh</dc:creator>
				<category><![CDATA[flex]]></category>
		<category><![CDATA[component]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[lifecycle]]></category>

		<guid isPermaLink="false">http://guavus.wordpress.com/?p=75</guid>
		<description><![CDATA[There are different kinds of events in the Flex world. An event can be generated from user gesture, return of requests and component lifecycle. Use event is a two step process, (1) You need to write the handler (2) You need to register the handler to the event hook. To register event, there are two [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>There are different kinds of <strong>events </strong>in the Flex world. An event can be generated from user gesture, return of requests and component lifecycle. Use event is a two step process, (1) You need to write the handler (2) You need to register the handler to the event hook. To register event, there are two different ways:</p>
<blockquote><p><strong>Inline MXML way:</strong>&lt;mx<img src="http://flex.exposedout.net/wp-content/plugins/yahoo-messenger-emoticons/emoticons/nerd.gif" style="border:none;background:none;vertical-align:-25%;" alt="nerd" />utton id=”myButton” click=”myhandler(event)”/&gt;</p>
<p><strong>Actionscript way: </strong>myButton.addEventListener(MouseEvent.CLICK, myhandler);</p></blockquote>
<p>The code above does the same job.Â  However, addEventListener provides more advanced control like <strong>event propagation</strong> and <strong>event priority</strong>. Event in Flex can be dispatched implicitly (user clicks on a button, the event is dispatched by the system) and explicitly (you can programmatically trigger an event).</p>
<p><strong>Event propagation </strong>is an important topic for Flex programming. So, I will try to talk about what I have known on this topic here. Feel free to correct me if I am wrong. As I know, event propagation has three phases. They are <em>capturing</em>, <em>at target</em>, and  <em>bubbling</em>. If you have an Application A contains a VBox B that has a Button C. When an user clicks the Button C, it first goes through <strong>“capturing phase”. </strong>In this phase, the event propagation through the topmost parent of C (ie. stage) and continue walk down the display object hierarchy until it reaches the original target (ie. C). The path for capturing phase is stage -&gt; root -&gt; A -&gt; B -&gt; C. When the event reaches C, the <strong>“at target phase”</strong> will be started and it just involves one object (ie. C). After that, the event bubbles up following the reverse path of the capturing phase and walk its way back up to root (C -&gt; B -&gt; A -&gt; root -&gt; stage). This is called <strong>“bubbling phase”</strong>.</p>
<p style="text-align:center;"><img src="http://www.solutionhacker.com/wp-content/uploads/2007/06/fig02.jpg" alt="fig02.jpg" /></p>
<p>As the event makes its way though each phase and each object within those phases, it calls all of the listener functions that were added for that event. This means that clicking on the Button C doesn’t limit the event to C, A and B also receive the event. Actually, they receive the event twice, once in the capturing phase and once in the bubbling phase.</p>
<p>However, by default, listener cannot receive event in capturing phase because the capability is turned off. To enable it, we need to set “true” to the third parameter in “addEventListener”, the “useCapture” parameter. If you don’t do that, listener would just listen to event in the “at target” or “bubbling” phase. However, it is an exclusion setting. Once you set the “useCapture” to true, it will not receive event in other phases. To get around this, you need to use “addEventListener” twice, once with “useCapture” set to false (or omitted) and once with “useCapture” set to true.Â  On the other hand, any listener along the path can <strong>stop </strong>the event propagation.</p>
<p>In the Event object, the “target” attributed is the component where the event originated (ie. C in this example) whereas “currentTarget” attribute is the component that event currently reaches. So, this attribute’s value will be changed along the propagation path. Apart from these two properties, Event object also contains properties like type (String), eventPhase (int), bubbles (boolean), and cancelable (boolean).</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fflex.exposedout.net%2F2008%2F09%2F16%2Fevent-propogation%2F&amp;title=Event%20Propogation" title="DZone"><img src="http://flex.exposedout.net/wp-content/plugins/sociable/images/dzone.png" title="DZone" alt="DZone" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fflex.exposedout.net%2F2008%2F09%2F16%2Fevent-propogation%2F&amp;title=Event%20Propogation&amp;bodytext=There%20are%20different%20kinds%20of%20events%20in%20the%20Flex%20world.%20An%20event%20can%20be%20generated%20from%20user%20gesture%2C%20return%20of%20requests%20and%20component%20lifecycle.%20Use%20event%20is%20a%20two%20step%20process%2C%20%281%29%20You%20need%20to%20write%20the%20handler%20%282%29%20You%20need%20to%20register%20the%20handler%20to" title="Digg"><img src="http://flex.exposedout.net/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Event%20Propogation%20-%20http%3A%2F%2Fflex.exposedout.net%2F2008%2F09%2F16%2Fevent-propogation%2F" title="Twitter"><img src="http://flex.exposedout.net/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fflex.exposedout.net%2F2008%2F09%2F16%2Fevent-propogation%2F&amp;title=Event%20Propogation&amp;annotation=There%20are%20different%20kinds%20of%20events%20in%20the%20Flex%20world.%20An%20event%20can%20be%20generated%20from%20user%20gesture%2C%20return%20of%20requests%20and%20component%20lifecycle.%20Use%20event%20is%20a%20two%20step%20process%2C%20%281%29%20You%20need%20to%20write%20the%20handler%20%282%29%20You%20need%20to%20register%20the%20handler%20to" title="Google Bookmarks"><img src="http://flex.exposedout.net/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fflex.exposedout.net%2F2008%2F09%2F16%2Fevent-propogation%2F" title="Technorati"><img src="http://flex.exposedout.net/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fflex.exposedout.net%2F2008%2F09%2F16%2Fevent-propogation%2F&amp;title=Event%20Propogation" title="StumbleUpon"><img src="http://flex.exposedout.net/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fflex.exposedout.net%2F2008%2F09%2F16%2Fevent-propogation%2F&amp;t=Event%20Propogation" title="MySpace"><img src="http://flex.exposedout.net/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fflex.exposedout.net%2F2008%2F09%2F16%2Fevent-propogation%2F" title="Sphinn"><img src="http://flex.exposedout.net/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fflex.exposedout.net%2F2008%2F09%2F16%2Fevent-propogation%2F&amp;title=Event%20Propogation&amp;notes=There%20are%20different%20kinds%20of%20events%20in%20the%20Flex%20world.%20An%20event%20can%20be%20generated%20from%20user%20gesture%2C%20return%20of%20requests%20and%20component%20lifecycle.%20Use%20event%20is%20a%20two%20step%20process%2C%20%281%29%20You%20need%20to%20write%20the%20handler%20%282%29%20You%20need%20to%20register%20the%20handler%20to" title="del.icio.us"><img src="http://flex.exposedout.net/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fflex.exposedout.net%2F2008%2F09%2F16%2Fevent-propogation%2F&amp;t=Event%20Propogation" title="Facebook"><img src="http://flex.exposedout.net/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fflex.exposedout.net%2F2008%2F09%2F16%2Fevent-propogation%2F&amp;title=Event%20Propogation" title="Reddit"><img src="http://flex.exposedout.net/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fflex.exposedout.net%2F2008%2F09%2F16%2Fevent-propogation%2F&amp;title=Event%20Propogation" title="Mixx"><img src="http://flex.exposedout.net/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://flex.exposedout.net/2008/09/16/event-propogation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
