<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc = "http://purl.org/dc/elements/1.1/" xmlns="http://purl.org/rss/1.0/">
	<channel rdf:about="http://livedocs.adobe.com/">
	<title>LiveDocs Comments - flash - 9.0 - main - 00000021.html</title>	
		<link>http://livedocs.adobe.com/</link>
		<description>Macromedia LiveDocs - online documentation with user feedback.</description>
		<copyright>Copyright 2009, Macromedia, Inc.</copyright>
		<dc:date>2009-11-26T04:50:38</dc:date>
		<dc:language>en-us</dc:language>
		<items>
			<rdf:Seq>
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/main/00000021.html#86552" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/main/00000021.html#86296" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/main/00000021.html#86172" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/main/00000021.html#85737" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/main/00000021.html#85608" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/main/00000021.html#79774" />
			</rdf:Seq>
		</items>
	</channel>
	
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/main/00000021.html#86552">
		<title>flash/9.0/main/00000021.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/main/00000021.html#86552</link>
		<description>In this example &quot;eventObject&quot; is the name of the parameter that is passed to the event handler function, eventResponse. When creating an event handler, you must define a parameter of the expected class. So if your handler is going to be used to handle mouse clicks, you would make the parameter of type MouseEvent. The MouseEvent object has properties that give you information about the mouse event, such as where the click occurred, whether any modifier keys were down at the time, etc. &lt;br&gt;&lt;br&gt;When an event, such as a mouse click, occurs within an event dispatching object, such as eventSource in the example, the object checks an internal list of registered functions for that event and calls each one in turn. The event dispatcher separates the list of functions to call based on the event type, which is the first parameter of the addEventListener() function.&lt;br&gt;&lt;br&gt;So to use a more concrete example, if you have a clickable object (let's call it clickableObject), then you listen for and handle a mouse click event with the following code:&lt;br&gt;&lt;br&gt;clickableObject.addEventListener( MouseEvent.CLICK, onClickFunction );&lt;br&gt;&lt;br&gt;function onClickFunction( mouseEventObject:MouseEvent ):void{&lt;br&gt;    trace( &quot;Click offset = &quot; + mouseEventObject.localX + &quot;, &quot; + mouseEventObject.localY );&lt;br&gt;}&lt;br&gt;&lt;br&gt;The onClickFunction() traces the location of the click in relation to the clicked object using the mouseEventObject parameter.&lt;br&gt;&lt;br&gt;To sum up the answer to your second question, EventType.EVENT_NAME is used in the addEventListener() function to tell the event dispatcher object (eventSource) that you want it to call your function when an event of that kind occurs. The listenr function must declare a parameter of the correct event class because that is the class of object that the dispatcher will pass to your function.&lt;br&gt;&lt;br&gt;Note, EventType.EVENT_NAME is really just a string constant. For example, MouseEvent.CLICK equals &quot;click&quot;. It is better to use the EventType.EVENT_NAME form, though, because then the compiler can tell you that you misspelled the name. If you called addEventlistener with &quot;clllck&quot;, no error would occur, but your function would never be called since there is no such thing as a &quot;clllck&quot; event.</description>
		<dc:creator>Joe ... Ward</dc:creator>
		<dc:type>1 1</dc:type>
		<dc:date>2008-08-08T10:12:53</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/main/00000021.html#86296">
		<title>flash/9.0/main/00000021.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/main/00000021.html#86296</link>
		<description>Problem: confusing&lt;br /&gt;&lt;br /&gt;original: &quot;Which object is the one the event is going to happen to?&quot;&lt;br /&gt;consider: &quot;Which object is the event going to happen to?&quot;</description>
		<dc:creator>Todays Past</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2008-07-31T10:28:20</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/main/00000021.html#86172">
		<title>flash/9.0/main/00000021.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/main/00000021.html#86172</link>
		<description>I am confused. can u plz tell me that what is d role of  &quot;eventObject &quot; in the above script..&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;and y we r using d &quot;EventType.EVENT_NAME&quot; in the addEventListener as we have already written whle declaring d function...&lt;br /&gt; &lt;br /&gt;I m looking for ur reply&lt;br /&gt;&lt;br /&gt;thanks&lt;br /&gt;Gausim</description>
		<dc:creator>gausim</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2008-07-28T11:08:36</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/main/00000021.html#85737">
		<title>flash/9.0/main/00000021.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/main/00000021.html#85737</link>
		<description>A writer has rewritten this section of the page as follows; we will update the next rev of the docs accordingly. Thanks for your feedback.&lt;br&gt;&lt;br&gt;When you're creating a function for event handling, you must choose the name for the function (named eventResponse in this case). You must also specify one parameter (named eventObject in this example). Specifying a function parameter is like declaring a variable, so you also have to indicate the data type of the parameter. (In this example, the parameter's data type is EventType.) Each type of event that you want to listen to has an ActionScript class associated with it. The data type you specify for the function parameter is always the associated class of the specific event you want to respond to. For example, a click event (triggered when the user clicks on an item with the mouse) is associated with the MouseEvent class. To write a listener function for a click event, you define the listener function with a parameter with the data type MouseEvent.</description>
		<dc:creator>brsnyder117</dc:creator>
		<dc:type>1 1</dc:type>
		<dc:date>2008-07-14T14:13:17</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/main/00000021.html#85608">
		<title>flash/9.0/main/00000021.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/main/00000021.html#85608</link>
		<description>This is very confusing, even to those with other programming knowledge. This sentence makes no sense to me:&lt;br /&gt;&lt;br /&gt;&quot;There is an ActionScript class defined for each event, and the data type you specify for the function parameter is always the class associated with the particular event you want to respond to.&quot;</description>
		<dc:creator></dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2008-07-10T01:59:36</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/main/00000021.html#79774">
		<title>flash/9.0/main/00000021.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/main/00000021.html#79774</link>
		<description>There is a quick-start guide that appears to take text from this page here:&lt;br /&gt;http://www.adobe.com/devnet/flash/quickstart/event_handling_as3/&lt;br /&gt;&lt;br /&gt;Interestingly, THAT code refers to 'eventTarget' rather than 'eventSource.'&lt;br /&gt;&lt;br /&gt;Neither that description nor this one describes clearly the role of the parameter EventType.EVENT_NAME.  Does that name mean that of all events triggered by eventSource, we only want to run the eventResponse function when some other parameter somewhere matches a constant defined in the class EventType with the name EVENT_NAME?&lt;br /&gt;&lt;br /&gt;It would be helpful to know more about that first parameter.</description>
		<dc:creator>sneakyimp</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2008-01-21T22:02:41</dc:date>
	</item>
	</rdf:RDF>

