<?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>p0wn.net == Ryan Luce &#187; Actionscript 3.0</title>
	<atom:link href="http://p0wn.net/category/actionscript-30/feed/" rel="self" type="application/rss+xml" />
	<link>http://p0wn.net</link>
	<description>things</description>
	<lastBuildDate>Tue, 29 Nov 2011 02:58:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>custom project templates in flashdevelop 3</title>
		<link>http://p0wn.net/2008/05/01/custom-project-templates-in-flashdevelop-3/</link>
		<comments>http://p0wn.net/2008/05/01/custom-project-templates-in-flashdevelop-3/#comments</comments>
		<pubDate>Thu, 01 May 2008 18:51:20 +0000</pubDate>
		<dc:creator>p0wn</dc:creator>
				<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://p0wn.net/2008/05/01/custom-project-templates-in-flashdevelop-3/</guid>
		<description><![CDATA[I use a folder structure for my projects that has a dev folder for .fla, classes folder for classes(whowouldathought), library folder for all visual assets and fonts etc, and a www folder for all published content. Flashdevelop doesn&#8217;t have a project template that supports this by default, but it is incredibly easy to create one.
All [...]]]></description>
			<content:encoded><![CDATA[<p>I use a folder structure for my projects that has a dev folder for .fla, classes folder for classes(whowouldathought), library folder for all visual assets and fonts etc, and a www folder for all published content. Flashdevelop doesn&#8217;t have a project template that supports this by default, but it is incredibly easy to create one.</p>
<p>All that needs to be done is to navigate to c:program filesFlashDevelopfirstrunTemplatesProjectTemplates copy the project folder you currently use, change the name, go in add/delete whatever folders you want to be made when a new project is, and edit the .as3proj file in notepad++ or similar text editor. It&#8217;s a very straight forward edit, all i changed was default classpath, and now i&#8217;m kicking ass!</p>
]]></content:encoded>
			<wfw:commentRss>http://p0wn.net/2008/05/01/custom-project-templates-in-flashdevelop-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Actionscript 3.0 Scopeless Event Dispatcher</title>
		<link>http://p0wn.net/2007/12/10/actionscript-30-scopeless-event-dispatcher/</link>
		<comments>http://p0wn.net/2007/12/10/actionscript-30-scopeless-event-dispatcher/#comments</comments>
		<pubDate>Mon, 10 Dec 2007 20:06:35 +0000</pubDate>
		<dc:creator>p0wn</dc:creator>
				<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[EventManager]]></category>

		<guid isPermaLink="false">http://p0wn.net/2007/12/10/actionscript-30-scopeless-event-dispatcher/</guid>
		<description><![CDATA[I've had this code around since my as 2.0 devirginizing(awhile ago..ahaha) So I decided to transfer it into AS3. It's a very simple class, but what it does is pretty cool, basically you can have events that aren't tied to specific classes or objects. Basically class A can talk to class D without knowing who [...]]]></description>
			<content:encoded><![CDATA[<p>I've had this code around since my as 2.0 devirginizing(awhile ago..ahaha) So I decided to transfer it into AS3. It's a very simple class, but what it does is pretty cool, basically you can have events that aren't tied to specific classes or objects. Basically class A can talk to class D without knowing who class D is... just knowing it has to send out an event... if that makes sense. While i think the way Events especially in AS3 are great, and i will use them more often than not... its always nice to have something to fall back on when you need 2 or more things to talk without necessarily knowing who they are. Heres my source :</p>
<div class="igBar"><span id="lactionscript-2"><a href="#" onclick="javascript:showPlainTxt('actionscript-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-2">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">package com.<span style="color: #006600;">rLuce</span>.<span style="color: #006600;">utils</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> EventManager <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">/*</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* Event Manager: Ryan Luce</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* Methods:</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* addEventListener : Adds an event to the list</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* dispatchEvent : Calls all functions related to that Event, and passes an object(or Event) if necessary</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">*</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* */</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">private</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">var</span> Events:<span style="color: #0066CC;">Array</span> = <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">//Standard addeventlistener</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">function</span> addEventListener<span style="color: #66cc66;">&#40;</span>eventName:<span style="color: #0066CC;">String</span>, fncRef:<span style="color: #000000; font-weight: bold;">Function</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>Events<span style="color: #66cc66;">&#91;</span>eventName<span style="color: #66cc66;">&#93;</span> != <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Events<span style="color: #66cc66;">&#91;</span>eventName<span style="color: #66cc66;">&#93;</span>.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span>fncRef<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Events<span style="color: #66cc66;">&#91;</span>eventName<span style="color: #66cc66;">&#93;</span> = <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Events<span style="color: #66cc66;">&#91;</span>eventName<span style="color: #66cc66;">&#93;</span>.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span>fncRef<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">function</span> removeEventListener<span style="color: #66cc66;">&#40;</span>eventName:<span style="color: #0066CC;">String</span>, fncRef:<span style="color: #000000; font-weight: bold;">Function</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">//this hasn't been tested i think i need to slice(a, (a + 1)) if my logic is even right</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">//haven't had to get into this and this was a quick port from my as2 class which was a bit different</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> a:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;color:#800000;">0</span>; a &lt;Events<span style="color: #66cc66;">&#91;</span>eventName<span style="color: #66cc66;">&#93;</span>.<span style="color: #0066CC;">length</span>; a++<span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>Events<span style="color: #66cc66;">&#91;</span>eventName<span style="color: #66cc66;">&#93;</span> == fncRef<span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"Removing: "</span> + Events<span style="color: #66cc66;">&#91;</span>eventName<span style="color: #66cc66;">&#93;</span>.<span style="color: #0066CC;">slice</span><span style="color: #66cc66;">&#40;</span>a,a<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">function</span> dispatchEvent<span style="color: #66cc66;">&#40;</span>eventName:<span style="color: #0066CC;">String</span>, obj:*= <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>Events<span style="color: #66cc66;">&#91;</span>eventName<span style="color: #66cc66;">&#93;</span> != <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> a = <span style="color: #cc66cc;color:#800000;">0</span>; a &lt;Events<span style="color: #66cc66;">&#91;</span>eventName<span style="color: #66cc66;">&#93;</span>.<span style="color: #0066CC;">length</span>; a++<span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Events<span style="color: #66cc66;">&#91;</span>eventName<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#91;</span>a<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#40;</span>obj<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Usage for this is pretty simple, just like the normal event dispatcher. I haven't tested this thoroughly yet, and will this coming week... will update it when i have time. I'll post a file up here as well with the class... to make it a bit easier.</p>
<p>Edit: Here you go: (right click save as)<br />
<a href='http://p0wn.net/blog/wp-content/uploads/2007/12/eventmanager.as' title='EventManager.as'>EventManager.as</a></p>
]]></content:encoded>
			<wfw:commentRss>http://p0wn.net/2007/12/10/actionscript-30-scopeless-event-dispatcher/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

