<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Tutorial Actionscript 3 &#8211; create link button, listeners, addEventListener, events handlers</title>
	<atom:link href="http://as3.miguelmoraleda.com/2009/03/08/tutorial-actionscript-3-create-link-button-addeventlistener-events-handlers/feed/" rel="self" type="application/rss+xml" />
	<link>http://as3.miguelmoraleda.com/2009/03/08/tutorial-actionscript-3-create-link-button-addeventlistener-events-handlers/</link>
	<description>Unity3D &#38; Actionscript examples, resources, source code, etc</description>
	<lastBuildDate>Fri, 23 Apr 2010 09:02:18 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: miguelMoraleda</title>
		<link>http://as3.miguelmoraleda.com/2009/03/08/tutorial-actionscript-3-create-link-button-addeventlistener-events-handlers/comment-page-1/#comment-632</link>
		<dc:creator>miguelMoraleda</dc:creator>
		<pubDate>Mon, 08 Feb 2010 16:25:40 +0000</pubDate>
		<guid isPermaLink="false">http://as3.miguelmoraleda.com/?p=52#comment-632</guid>
		<description>Hi Aaron,

To use listener within a class is the same as procedural functions. Here I will write a basic example

&lt;pre lang=&quot;Actionscript&quot;&gt;
package
{
    import flash.display.*;
    import flash.events.*;

    public class ExampleListener extends Sprite
    {
        private var _clip:Sprite;

        public function ExampleListener()
        {
            super();
            createClip();
            _clip.addEventListener(MouseEvent.CLICK, clipClicked);
        }
        private function clipClicked(event:MouseEvent)
        {
            trace(&quot;Clip Clicked&quot;);
        }
        private function createClip()
        {
            //create some draw in the clip and add it to the stage
        }
    }
}
&lt;/pre&gt;

I hope this answer your question :)</description>
		<content:encoded><![CDATA[<p>Hi Aaron,</p>
<p>To use listener within a class is the same as procedural functions. Here I will write a basic example</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">package
<span style="color: #66cc66;">&#123;</span>
    <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #66cc66;">*</span>;
    <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #66cc66;">*</span>;
&nbsp;
    <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> ExampleListener <span style="color: #0066CC;">extends</span> Sprite
    <span style="color: #66cc66;">&#123;</span>
        <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _clip:Sprite;
&nbsp;
        <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> ExampleListener<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
        <span style="color: #66cc66;">&#123;</span>
            <span style="color: #0066CC;">super</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
            createClip<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
            _clip.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">CLICK</span>, clipClicked<span style="color: #66cc66;">&#41;</span>;
        <span style="color: #66cc66;">&#125;</span>
        <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> clipClicked<span style="color: #66cc66;">&#40;</span>event:MouseEvent<span style="color: #66cc66;">&#41;</span>
        <span style="color: #66cc66;">&#123;</span>
            <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Clip Clicked&quot;</span><span style="color: #66cc66;">&#41;</span>;
        <span style="color: #66cc66;">&#125;</span>
        <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> createClip<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
        <span style="color: #66cc66;">&#123;</span>
            <span style="color: #808080; font-style: italic;">//create some draw in the clip and add it to the stage</span>
        <span style="color: #66cc66;">&#125;</span>
    <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>I hope this answer your question <img src='http://as3.miguelmoraleda.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron</title>
		<link>http://as3.miguelmoraleda.com/2009/03/08/tutorial-actionscript-3-create-link-button-addeventlistener-events-handlers/comment-page-1/#comment-630</link>
		<dc:creator>Aaron</dc:creator>
		<pubDate>Mon, 08 Feb 2010 16:14:32 +0000</pubDate>
		<guid isPermaLink="false">http://as3.miguelmoraleda.com/?p=52#comment-630</guid>
		<description>Will you show an example where the listener calls a method within a class, instead of just a procedural function?</description>
		<content:encoded><![CDATA[<p>Will you show an example where the listener calls a method within a class, instead of just a procedural function?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: uyanga</title>
		<link>http://as3.miguelmoraleda.com/2009/03/08/tutorial-actionscript-3-create-link-button-addeventlistener-events-handlers/comment-page-1/#comment-531</link>
		<dc:creator>uyanga</dc:creator>
		<pubDate>Mon, 25 Jan 2010 06:55:02 +0000</pubDate>
		<guid isPermaLink="false">http://as3.miguelmoraleda.com/?p=52#comment-531</guid>
		<description>great thanks</description>
		<content:encoded><![CDATA[<p>great thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: miguelMoraleda</title>
		<link>http://as3.miguelmoraleda.com/2009/03/08/tutorial-actionscript-3-create-link-button-addeventlistener-events-handlers/comment-page-1/#comment-474</link>
		<dc:creator>miguelMoraleda</dc:creator>
		<pubDate>Fri, 01 Jan 2010 05:14:08 +0000</pubDate>
		<guid isPermaLink="false">http://as3.miguelmoraleda.com/?p=52#comment-474</guid>
		<description>vlost: You are missing the events package. 

import flash.events.* 

Actually, import flash.events.MouseEvent is enough :)

Happy new year!!</description>
		<content:encoded><![CDATA[<p>vlost: You are missing the events package. </p>
<p>import flash.events.* </p>
<p>Actually, import flash.events.MouseEvent is enough <img src='http://as3.miguelmoraleda.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Happy new year!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vlost</title>
		<link>http://as3.miguelmoraleda.com/2009/03/08/tutorial-actionscript-3-create-link-button-addeventlistener-events-handlers/comment-page-1/#comment-473</link>
		<dc:creator>vlost</dc:creator>
		<pubDate>Thu, 31 Dec 2009 22:23:31 +0000</pubDate>
		<guid isPermaLink="false">http://as3.miguelmoraleda.com/?p=52#comment-473</guid>
		<description>I get a:

1120: Access of undefined property MouseEvent.

Am I not including some thing?

package {
	import flash.display.*;
	import flash.text.*;
	
	public class HelloDan extends MovieClip {</description>
		<content:encoded><![CDATA[<p>I get a:</p>
<p>1120: Access of undefined property MouseEvent.</p>
<p>Am I not including some thing?</p>
<p>package {<br />
	import flash.display.*;<br />
	import flash.text.*;</p>
<p>	public class HelloDan extends MovieClip {</p>
]]></content:encoded>
	</item>
</channel>
</rss>
