<?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: AS3 Custom Event for Passing Unlimited Parameters</title>
	<atom:link href="http://www.xllusion.net/ed/2008/01/21/as3-custom-event-for-passing-unlimited-parameters/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.xllusion.net/ed/2008/01/21/as3-custom-event-for-passing-unlimited-parameters/</link>
	<description>Flash, Actionscript, Javascript, PHP and more?</description>
	<lastBuildDate>Thu, 21 Jan 2010 21:10:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Ed</title>
		<link>http://www.xllusion.net/ed/2008/01/21/as3-custom-event-for-passing-unlimited-parameters/comment-page-1/#comment-1982</link>
		<dc:creator>Ed</dc:creator>
		<pubDate>Thu, 29 Oct 2009 10:20:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.xllusion.net/ed/2008/01/20/as3-custom-event-for-passing-unlimited-parameters/#comment-1982</guid>
		<description>You need to pass the variable one after another like:
dispatchEvent(new CustomEvent(”EVENT_NAME”, false, false, &quot;hello&quot;, &quot;world&quot;));</description>
		<content:encoded><![CDATA[<p>You need to pass the variable one after another like:<br />
dispatchEvent(new CustomEvent(”EVENT_NAME”, false, false, &#8220;hello&#8221;, &#8220;world&#8221;));</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie Adams</title>
		<link>http://www.xllusion.net/ed/2008/01/21/as3-custom-event-for-passing-unlimited-parameters/comment-page-1/#comment-1980</link>
		<dc:creator>Eddie Adams</dc:creator>
		<pubDate>Wed, 28 Oct 2009 20:44:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.xllusion.net/ed/2008/01/20/as3-custom-event-for-passing-unlimited-parameters/#comment-1980</guid>
		<description>// Import class
	import flash.events.Event;
	
	// EventType
	public class CustomEvent extends Event
	{
		// Properties
  		public var params:Array;
		
  		// Constructor
  		public function CustomEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, ... p:*)
		{
   			super(type, bubbles, cancelable);
   			params = p;
   		}
		
		// Override clone
		override public function clone():Event
		{
			return new CustomEvent(type, bubbles, cancelable, params);
		}
		
	}

			// CustomEvent
			addEventListener(Event.ENTER_FRAME, enterFrameHandler);
			addEventListener(&quot;EVENT_NAME&quot;, customEventHandler);

			function enterFrameHandler(e:Event):void
			{
				var params:Array = new Array(&quot;hello&quot;, &quot;world&quot;);
				dispatchEvent(new CustomEvent(&quot;EVENT_NAME&quot;, false, false, params));
			}
			
			function customEventHandler(e:CustomEvent):void
			{
				trace(e.params[0] + &quot; &quot; + e.params[1]);
			}


Why is it tracing:
hello,world undefined

insteand of:
hello world</description>
		<content:encoded><![CDATA[<p>// Import class<br />
	import flash.events.Event;</p>
<p>	// EventType<br />
	public class CustomEvent extends Event<br />
	{<br />
		// Properties<br />
  		public var params:Array;</p>
<p>  		// Constructor<br />
  		public function CustomEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, &#8230; p:*)<br />
		{<br />
   			super(type, bubbles, cancelable);<br />
   			params = p;<br />
   		}</p>
<p>		// Override clone<br />
		override public function clone():Event<br />
		{<br />
			return new CustomEvent(type, bubbles, cancelable, params);<br />
		}</p>
<p>	}</p>
<p>			// CustomEvent<br />
			addEventListener(Event.ENTER_FRAME, enterFrameHandler);<br />
			addEventListener(&#8220;EVENT_NAME&#8221;, customEventHandler);</p>
<p>			function enterFrameHandler(e:Event):void<br />
			{<br />
				var params:Array = new Array(&#8220;hello&#8221;, &#8220;world&#8221;);<br />
				dispatchEvent(new CustomEvent(&#8220;EVENT_NAME&#8221;, false, false, params));<br />
			}</p>
<p>			function customEventHandler(e:CustomEvent):void<br />
			{<br />
				trace(e.params[0] + &#8221; &#8221; + e.params[1]);<br />
			}</p>
<p>Why is it tracing:<br />
hello,world undefined</p>
<p>insteand of:<br />
hello world</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason King</title>
		<link>http://www.xllusion.net/ed/2008/01/21/as3-custom-event-for-passing-unlimited-parameters/comment-page-1/#comment-1968</link>
		<dc:creator>Jason King</dc:creator>
		<pubDate>Thu, 08 Oct 2009 20:34:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.xllusion.net/ed/2008/01/20/as3-custom-event-for-passing-unlimited-parameters/#comment-1968</guid>
		<description>This method inspired me to create an alternate method defined here... http://www.actionscript.org/forums/showthread.php3?p=930835&amp;posted=1#post930835</description>
		<content:encoded><![CDATA[<p>This method inspired me to create an alternate method defined here&#8230; <a href="http://www.actionscript.org/forums/showthread.php3?p=930835&amp;posted=1#post930835" rel="nofollow">http://www.actionscript.org/forums/showthread.php3?p=930835&amp;posted=1#post930835</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: karsten</title>
		<link>http://www.xllusion.net/ed/2008/01/21/as3-custom-event-for-passing-unlimited-parameters/comment-page-1/#comment-1960</link>
		<dc:creator>karsten</dc:creator>
		<pubDate>Fri, 11 Sep 2009 10:49:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.xllusion.net/ed/2008/01/20/as3-custom-event-for-passing-unlimited-parameters/#comment-1960</guid>
		<description>VERY useful bit of code! LOVE it!
Thx3000!</description>
		<content:encoded><![CDATA[<p>VERY useful bit of code! LOVE it!<br />
Thx3000!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy</title>
		<link>http://www.xllusion.net/ed/2008/01/21/as3-custom-event-for-passing-unlimited-parameters/comment-page-1/#comment-1926</link>
		<dc:creator>Andy</dc:creator>
		<pubDate>Mon, 20 Jul 2009 01:40:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.xllusion.net/ed/2008/01/20/as3-custom-event-for-passing-unlimited-parameters/#comment-1926</guid>
		<description>If you want to pass parameters with an ENTER_FRAME or TIMER event, you could dispatch a new &#039;CustomEvent&#039; event from the ENTER_FRAME or TIMER event handler, which can contain extra parameters. For example:

addEventListener(Event.ENTER_FRAME, enterFrameHandler);
addEventListener(&quot;EVENT_NAME&quot;, customEventHandler);

function enterFrameHandler(e:Event):void{
	dispatchEvent( new CustomEvent(&quot;EVENT_NAME&quot;, false, false, this.currentFrame) );
}
function customEventHandler(e:CustomEvent):void {
	trace(e.params[0]);
}

You&#039;re basically listening for the ENTER_FRAME event, then dispatching another custom event, and listening again for that. You can use the new event to pass on values from the original ENTER_FRAME event as well as new custom parameters.</description>
		<content:encoded><![CDATA[<p>If you want to pass parameters with an ENTER_FRAME or TIMER event, you could dispatch a new &#8216;CustomEvent&#8217; event from the ENTER_FRAME or TIMER event handler, which can contain extra parameters. For example:</p>
<p>addEventListener(Event.ENTER_FRAME, enterFrameHandler);<br />
addEventListener(&#8220;EVENT_NAME&#8221;, customEventHandler);</p>
<p>function enterFrameHandler(e:Event):void{<br />
	dispatchEvent( new CustomEvent(&#8220;EVENT_NAME&#8221;, false, false, this.currentFrame) );<br />
}<br />
function customEventHandler(e:CustomEvent):void {<br />
	trace(e.params[0]);<br />
}</p>
<p>You&#8217;re basically listening for the ENTER_FRAME event, then dispatching another custom event, and listening again for that. You can use the new event to pass on values from the original ENTER_FRAME event as well as new custom parameters.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ed</title>
		<link>http://www.xllusion.net/ed/2008/01/21/as3-custom-event-for-passing-unlimited-parameters/comment-page-1/#comment-1862</link>
		<dc:creator>Ed</dc:creator>
		<pubDate>Fri, 01 May 2009 20:46:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.xllusion.net/ed/2008/01/20/as3-custom-event-for-passing-unlimited-parameters/#comment-1862</guid>
		<description>You can&#039;t pass parameters using Event.ENTER_FRAME but you can create variables dynamically from movie clips since they are dynamic class, e.g- mc.some_parameter = &quot;Something&quot;. So you can get them in event handler like event.currentTarget.some_parameter...</description>
		<content:encoded><![CDATA[<p>You can&#8217;t pass parameters using Event.ENTER_FRAME but you can create variables dynamically from movie clips since they are dynamic class, e.g- mc.some_parameter = &#8220;Something&#8221;. So you can get them in event handler like event.currentTarget.some_parameter&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
