<?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; currenttarget</title>
	<atom:link href="http://flex.exposedout.net/tag/currenttarget/feed/" rel="self" type="application/rss+xml" />
	<link>http://flex.exposedout.net</link>
	<description>i am an itemrendrer in the making!</description>
	<lastBuildDate>Fri, 13 May 2011 10:05:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.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 [...]


Related posts:<ol><li><a href='http://flex.exposedout.net/2008/09/16/event-propogation/' rel='bookmark' title='Permanent Link: Event Propogation'>Event Propogation</a></li>
<li><a href='http://flex.exposedout.net/2008/09/15/flex-component-lifecycle/' rel='bookmark' title='Permanent Link: Flex Component Lifecycle'>Flex Component Lifecycle</a></li>
<li><a href='http://flex.exposedout.net/2010/03/10/flex-component-lifecycle-and-event-flow-explained/' rel='bookmark' title='Permanent Link: Flex component lifecycle and event flow explained'>Flex component lifecycle and event flow explained</a></li>
</ol>]]></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>


<p>Related posts:<ol><li><a href='http://flex.exposedout.net/2008/09/16/event-propogation/' rel='bookmark' title='Permanent Link: Event Propogation'>Event Propogation</a></li>
<li><a href='http://flex.exposedout.net/2008/09/15/flex-component-lifecycle/' rel='bookmark' title='Permanent Link: Flex Component Lifecycle'>Flex Component Lifecycle</a></li>
<li><a href='http://flex.exposedout.net/2010/03/10/flex-component-lifecycle-and-event-flow-explained/' rel='bookmark' title='Permanent Link: Flex component lifecycle and event flow explained'>Flex component lifecycle and event flow explained</a></li>
</ol></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>
	</channel>
</rss>

