<?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>lukesh &#187; adobe</title>
	<atom:link href="http://lukesh.com/blog/tag/adobe/feed/" rel="self" type="application/rss+xml" />
	<link>http://lukesh.com/blog</link>
	<description>interactive</description>
	<lastBuildDate>Mon, 17 May 2010 21:52:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Hotwire: Quick and dirty event wireups in AS3</title>
		<link>http://lukesh.com/blog/2010/02/hotwire-quick-and-dirty-event-wireups-in-as3/</link>
		<comments>http://lukesh.com/blog/2010/02/hotwire-quick-and-dirty-event-wireups-in-as3/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 10:39:08 +0000</pubDate>
		<dc:creator>lukesh</dc:creator>
				<category><![CDATA[Flash Platform]]></category>
		<category><![CDATA[Technology and Science]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://lukesh.com/blog/?p=127</guid>
		<description><![CDATA[Recently, I was tasked with building a quick AS3 project outside of our normal Flex framework projects. It was refreshing to just write a plain and simple AS3 project outside of the team environment where I could explore a few things without impacting the team by breaking our current project standards. One thing I&#8217;ve been [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I was tasked with building a quick AS3 project outside of our normal Flex framework projects. It was refreshing to just write a plain and simple AS3 project outside of the team environment where I could explore a few things without impacting the team by breaking our current project standards. One thing I&#8217;ve been wanting to explore is Penner&#8217;s <a href="http://github.com/robertpenner/as3-signals" target="_blank">Signals</a> project, but after looking at it, I decided that: 1. it was still too heavy for my project, 2. I didn&#8217;t see a way to listen to events that Flash dispatched&#8211;mouse events, stage events, etc. I&#8217;ve been using a derivative of <a href="http://code.google.com/p/k2xl/source/browse/trunk/as3classes/src/util/k2xl/EventManager.as" target="_blank">EventManager</a> for a while, and it&#8217;s excellent, but I wanted to explore a different strategy for managing events, so I ended up writing <a href="http://github.com/lukesh/hotwire" target="_blank">Hotwire</a>.</p>
<p>Some goals I wanted to achieve were:</p>
<ol>
<li>As little code as possible to wire up and unwire events.</li>
<li>Lean more toward convention over configuration.</li>
<li>Easy to see which events were being listened for (remotely like the delegate concept in Objective-C)</li>
<li>It&#8217;s not a goal, but I didn&#8217;t care about proper use of accessors (one drawback of Hotwire)</li>
</ol>
<p>The source for Hotwire is 62 lines long, so you could probably <a href="http://github.com/lukesh/hotwire" target="_blank">clone it</a> and analyze it quicker than I can describe it, but I&#8217;ll outline a few use cases anyway.</p>
<h2>Usage 1: As Simple As Possible</h2>
<p>This is as basic as it gets. You store a reference to an instance of Hotwire, which sets up at least a Event.REMOVE listener, then you call unwire(), which removes all the event listeners setup by the wire() call.</p>
<p>By default, Hotwire attempts to register the event with a listener with the prefix &#8220;handle&#8221; then a properly-cased version of the event name. Therefore, since Event.ENTER_FRAME is the string &#8220;enterFrame&#8221;, the listener that Hotwire will wire up is &#8220;handleEnterFrame&#8221;.</p>
<p><a href="http://lukesh.com/blog/wp-content/uploads/2010/02/Screen-shot-2010-02-23-at-5.03.30-AM.png"><img class="alignnone size-full wp-image-130" title="Hotwire Simple Demo" src="http://lukesh.com/blog/wp-content/uploads/2010/02/Screen-shot-2010-02-23-at-5.03.30-AM.png" alt="" width="577" height="421" /></a></p>
<h2>Usage 2: Listening to Other Dispatchers</h2>
<p>In the Hotwire constructor, the first argument is the dispatcher, and is the only required argument. The second argument is the handler, and if it is not specified or null, Hotwire will consider the handler and the dispatcher the same object. In my projects, I used custom bubbled events a-plenty for child display objects, and never specified a different handler from my dispatcher until I needed to handle Stage events, which don&#8217;t bubble. (I haven&#8217;t run across another instance where I couldn&#8217;t simply use bubbled events the way I wanted to, but I&#8217;m sure I will.)</p>
<p><a href="http://lukesh.com/blog/wp-content/uploads/2010/02/Screen-shot-2010-02-23-at-5.17.48-AM.png"><img class="alignnone size-full wp-image-131" title="Hotwire Stage Listener" src="http://lukesh.com/blog/wp-content/uploads/2010/02/Screen-shot-2010-02-23-at-5.17.48-AM.png" alt="" width="497" height="644" /></a></p>
<h2>Usage 3: If you don&#8217;t like &#8220;handle&#8221;</h2>
<p>Personally, I like the word &#8220;handle&#8221; as my handler prefix. I can type handle+Ctrl+Space and get a list of all my handlers, and it&#8217;s descriptive. I know that many people like to use &#8220;on&#8221; however. If you want to change your prefix for one instance, it&#8217;s the third argument in the constructor, as you may have noticed in the example above. If you <em>hate</em> &#8220;handle&#8221; just change the source code. It&#8217;s 62 lines. Don&#8217;t hate.</p>
<p><a href="http://lukesh.com/blog/wp-content/uploads/2010/02/Screen-shot-2010-02-23-at-5.22.38-AM.png"><img class="alignnone size-full wp-image-134" title="Hotwire Using On" src="http://lukesh.com/blog/wp-content/uploads/2010/02/Screen-shot-2010-02-23-at-5.22.38-AM.png" alt="" width="412" height="390" /></a></p>
<h2>Finally</h2>
<p>So that&#8217;s it. I think Hotwire might be useful if you wanted to wire / unwire groups of events easily also, just by creating separate instances of Hotwire. (Although, I might argue your class is getting too complicated?)</p>
<p>There are some cons to Hotwire that may make your architecture blood boil (for some reason I&#8217;ve been much less OCD about all this, so I&#8217;m just letting it roll and enjoying the short time of non-obsession):</p>
<ol>
<li>Public handlers.<strong> </strong>Yeah, if you make private or protected handlers, the instance of Hotwire can&#8217;t wire them up. Well, hey. It&#8217;s a mixin-y class. Put some Baileys in your latté and discuss architecture with me when I come back to my senses.</li>
<li>Handler names derived from constants. This could be pretty bad if you are wiring up to Event.ENTER_FRAME which is currently &#8220;enterFrame&#8221; but Adobe decides to change to &#8220;zomgAppleSucks&#8221;. Yes, this might be a problem. In the remote chance this happens, <em>:%s/handleEnterFrame/handleZomgAppleSucks/g</em> and go back to your latté.</li>
</ol>
<p>If you find it useful, let me know. If you have improvements, <a href="http://github.com/lukesh/hotwire" target="_blank">fork it</a>. If you think it&#8217;s horrible and want to throw your latté at me, please do, I love constructive criticism and alternative perspectives. I&#8217;ll just passively-aggressively unfollow you on <a href="http://twitter.com/lukesh" target="_blank">Twitter</a>.</p>
<p>If you still aren&#8217;t clear on how to get Hotwire, even though I linked to it like <span style="text-decoration: line-through;">a million</span> 3 times, it&#8217;s hosted on <a href="http://github.com/lukesh/hotwire" target="_blank">GitHub, and you can get it here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://lukesh.com/blog/2010/02/hotwire-quick-and-dirty-event-wireups-in-as3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>In defense of AS3</title>
		<link>http://lukesh.com/blog/2008/07/in-defense-of-as3/</link>
		<comments>http://lukesh.com/blog/2008/07/in-defense-of-as3/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 19:41:04 +0000</pubDate>
		<dc:creator>lukesh</dc:creator>
				<category><![CDATA[Design and Creativity]]></category>
		<category><![CDATA[Flash Platform]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[philosophy]]></category>

		<guid isPermaLink="false">http://lukesh.wordpress.com/?p=41</guid>
		<description><![CDATA[As someone who has worked with Flash since FutureSplash was acquired by Macromedia, and as someone with both a design / animation and programming background, I agree with Adobe&#8217;s decision to go with a more structured implementation of ActionScript in Flash with AS3. I believe it is a strategic move to position Flash as a [...]]]></description>
			<content:encoded><![CDATA[<div class="comment-content">
<p>As someone who has worked with Flash since FutureSplash was acquired by Macromedia, and as someone with both a design / animation and programming background, I agree with Adobe&#8217;s decision to go with a more structured implementation of ActionScript in Flash with AS3. I believe it is a strategic move to position Flash as a viable platform for true RIA development.</p>
<p>There&#8217;s no reason that a toolkit couldn&#8217;t be written that abstracts the API to provide some of the functionality mentioned in the article. It would streamline development for designers / animators, yet maintain the architectural integrity of AS3.</p>
<p>It&#8217;s undeniable that the new VM is harder, better, faster, stronger. The level of complexity of the API needed to increase to provide access to the host of new features&#8211;not only for the contemporary version of Flash, but also to elegantly scale for the future.</p>
<p>Consider even the nomenclature of the AS2 display object hierarchy. &#8220;MovieClip&#8221;? Think about how someone from a development background (not Flash) would approach the idea of an interface comprised of &#8220;MovieClips.&#8221; They&#8217;re not interested in frame-based animation. They don&#8217;t want to play a movie. They want to draw vector graphics on the screen. So they create a &#8220;MovieClip&#8221;? I think Adobe has done a fantastic job of maintaining cohesiveness between a logically engineered AS3 API and the legacy AS2 API that anyone who has evolved as a designer / developer with Flash would be familiar with.</p>
<p>I believe that AS3 allows a developer to logically approach Flash as a UI platform with some amazing capabilities. I think AS3 alone may prove to be a challenge to a designer without any programming background, but this is not unmitigable with a well-written toolkit for designers. Maybe that&#8217;s the core of what I&#8217;m saying&#8211;that you can go one way but not the other. You can abstract an API to make it easier for a designer to use, but you can&#8217;t go the other way and take an abstracted API and make it more powerful for developers.</p>
<p>Specifically related to Charge #6&#8211;that&#8217;s definitely biting the hand that feeds you. SOME errors are better than NO errors. I think it was incredibly cumbersome to code to AS2 for the example that was cited in the article. I agree with the verdict NOT GUILTY.</p>
<p>I would also like to say that I concur with the other, arguably non-AS3, issues mentioned in the article, specifically &#8220;Failure to Unload,&#8221; which has caused me much grief in the past.</p>
<p>My intent is not to come off as a pretentious &#8220;real Flash developer&#8221; to all you &#8220;plebeian designers&#8221; or something, nor is it to slam Colin, whom I hold in very high regard, but I hope that this provides some counter-rationale.</p>
<div class="comment-content">
<p>Ok, I re-read <a href="http://www.insideria.com/2008/07/the-charges-against-actionscri.html" target="_blank">the article</a>, and I have to concede that perhaps my previous comment was slightly a knee-jerk reaction. As a Flash platform evangelist, I really appreciated the architectural changes in AS3 vs AS2. By the time I got to the bottom and read the previous comments, I forgot that Colin&#8217;s &#8220;What Should ___ Do?&#8221; commentary was really well thought through and addressed both the concerns of the designer and developer.</p>
<p>&#8220;But despite all the talk of GPU blitting, pixel shading, and ligatures, a non-negligible percentage of the Flash community is rightfully asking: is Adobe still committed to the simple, agile authoring practices on which Flash was founded? It&#8217;s a rational enough concern. After all, Flash built its success on &#8216;ease of use.&#8217;&#8221;</p>
<p>I think it is a valid concern, but &#8220;ease of use&#8221; is relative versus the audience, purpose, and power of what is being evaluated. I agree that Flash should be easy to use, but that does not mean what it did 10 years ago.</p>
<p>&#8220;Or maybe the time has come for someone to make an entirely new application for building simple Flash websites and animations. Such a tool could even be written in ActionScript, and deployed as an AIR app.&#8221;</p>
<p>I wonder when the convergence between Desktop, AIR (runtimes), Browser, Flash Player will happen. I feel like the industry is so confused with levels of abstraction, we&#8217;re writing browsers for various OS&#8217;s, that render HTML documents, which contain Flash players, that render RIA&#8217;s, or animations or whatever, which can also be deployed in an AIR runtime, which can contain a browser, etc&#8230; Forgive my rant, but I just don&#8217;t see things working like this sustainably for very long. Ultimately, it will come down to a contiguous platform that will allow left-to-right-brained people to interact and produce content in a continuum of connected devices. The moment we have immediate high-bandwidth connectivity everywhere is the moment the game entirely changes, and it&#8217;s almost here. But I digress&#8230;</p></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://lukesh.com/blog/2008/07/in-defense-of-as3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Policy file changes for Flash Player 9.0.124.0 strict security</title>
		<link>http://lukesh.com/blog/2008/06/policy-file-changes-for-flash-player-901240-strict-security/</link>
		<comments>http://lukesh.com/blog/2008/06/policy-file-changes-for-flash-player-901240-strict-security/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 21:26:34 +0000</pubDate>
		<dc:creator>lukesh</dc:creator>
				<category><![CDATA[Flash Platform]]></category>
		<category><![CDATA[Technology and Science]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[services]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://lukesh.wordpress.com/?p=37</guid>
		<description><![CDATA[Adobe has enhanced the security policy in Flash Player 9.0.115 and 9.0.124 that may cause some issues if you&#8217;re interacting with Web Services. Typically when I start a Flex project, I just throw a simple, open crossdomain.xml file on the root of the service site (or elsewhere) and go to town (which is poor practice to [...]]]></description>
			<content:encoded><![CDATA[<p>Adobe has <a href="http://www.adobe.com/devnet/flashplayer/articles/flash_player9_security_update.html" target="_blank">enhanced the security policy</a> in Flash Player 9.0.115 and 9.0.124 that may cause some issues if you&#8217;re interacting with Web Services. Typically when I start a Flex project, I just throw a simple, open crossdomain.xml file on the root of the service site (<a href="http://livedocs.adobe.com/flex/201/langref/flash/system/Security.html#loadPolicyFile()" target="_blank">or elsewhere</a>) and go to town (which is <a href="http://shiflett.org/blog/2006/sep/the-dangers-of-cross-domain-ajax-with-flash" target="_blank">poor</a> <a href="http://www.hardened-php.net/library/poking_new_holes_with_flash_crossdomain_policy_files.html" target="_blank">practice</a> <a href="http://www.petefreitag.com/item/595.cfm" target="_blank">to leave</a> when you deploy). </p>
<p>The &#8220;come and get it&#8221; policy file typically looks like this:</p>
<pre>&lt;?xml version="1.0"?&gt;
&lt;!DOCTYPE cross-domain-policy SYSTEM
"http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd"&gt;
&lt;cross-domain-policy&gt;
    &lt;allow-access-from domain="*" /&gt;
&lt;/cross-domain-policy&gt;</pre>
<p> </p>
<p>However, we noticed that an intranet project we&#8217;ve deployed stopped working on certain computers, throwing the following error:</p>
<pre>[RPC Fault faultString="<span class="searchTerm">Security</span> <span class="searchTerm">error</span> <span class="searchTerm">accessing</span> <span class="searchTerm">url</span>" faultCode="Channel.Security.Error" 
faultDetail="Unable to load WSDL. If currently online, please verify the URI and/or format
of the WSDL (***YOUR WSDL ENDPOINT HERE***)"]
      at mx.rpc.wsdl::WSDLLoader/mx.rpc.wsdl:WSDLLoader::faultHandler()
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.rpc::AbstractInvoker/<a rel="nofollow" href="http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent(" target="_blank">http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent(</a>)
      at mx.rpc::AbstractInvoker/<a rel="nofollow" href="http://www.adobe.com/2006/flex/mx/internal::faultHandler(" target="_blank">http://www.adobe.com/2006/flex/mx/internal::faultHandler(</a>)
      at mx.rpc::Responder/fault()
      at mx.rpc::AsyncRequest/fault()
      at ::DirectHTTPMessageResponder/securityErrorHandler()
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at flash.net::URLLoader/flash.net:URLLoader::redirectEvent()</pre>
<p> </p>
<p>When you check out the <a href="http://www.adobe.com/xml/schemas/PolicyFile.xsd" target="_blank">XSD for policy files</a>, you&#8217;ll notice that (among other things) they&#8217;ve added a &#8220;allow-http-request-headers-from&#8221; element. So the new &#8220;come and get it&#8221; policy file looks like this:</p>
<pre>&lt;?xml version="1.0"?&gt;
&lt;!DOCTYPE cross-domain-policy SYSTEM
"http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd"&gt;
&lt;cross-domain-policy&gt;
    &lt;allow-access-from domain="*" to-ports="*" /&gt;
    &lt;allow-http-request-headers-from domain="*" headers="SOAPAction"/&gt;
&lt;/cross-domain-policy&gt;</pre>
<p> </p>
<p>This should allow you to consume your services from basically anywhere. Remember to lock your stuff down when you deploy.</p>
]]></content:encoded>
			<wfw:commentRss>http://lukesh.com/blog/2008/06/policy-file-changes-for-flash-player-901240-strict-security/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Funny little bug in Flash E4X</title>
		<link>http://lukesh.com/blog/2008/05/funny-little-bug-in-flash-e4x/</link>
		<comments>http://lukesh.com/blog/2008/05/funny-little-bug-in-flash-e4x/#comments</comments>
		<pubDate>Fri, 30 May 2008 17:44:11 +0000</pubDate>
		<dc:creator>lukesh</dc:creator>
				<category><![CDATA[Flash Platform]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[e4x]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://lukesh.wordpress.com/?p=30</guid>
		<description><![CDATA[This works (outputs ID&#8217;s): new Array(); var attributes:XMLList = _data.Attributes..AttributeDescriptor; for each(var attribute:XML in attributes) { trace(attribute.@ID); } This doesn&#8217;t (outputs nulls): var attributes:XMLList = _data.Attributes..AttributeDescriptor; for each(var attribute:XML in attributes) { trace(attribute.@ID); } Any questions? Update: Kudos to Larry (developmentastic.com) for beating his head against this brick wall on the Winestore project.]]></description>
			<content:encoded><![CDATA[<p>This works (outputs ID&#8217;s):</p>
<pre>
new Array();
var attributes:XMLList = _data.Attributes..AttributeDescriptor;
for each(var attribute:XML in attributes)
{
	trace(attribute.@ID);
}
</pre>
<p>This doesn&#8217;t (outputs nulls):</p>
<pre>
var attributes:XMLList = _data.Attributes..AttributeDescriptor;
for each(var attribute:XML in attributes)
{
	trace(attribute.@ID);
}
</pre>
<p>Any questions?</p>
<p>Update: Kudos to Larry (<a href="http://developmentastic.com/">developmentastic.com</a>) for beating his head against this brick wall on the Winestore project.</p>
]]></content:encoded>
			<wfw:commentRss>http://lukesh.com/blog/2008/05/funny-little-bug-in-flash-e4x/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
