<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4382065257881406250</id><updated>2012-02-16T19:11:26.272-08:00</updated><category term='flash'/><category term='Signal Command Map'/><category term='Workspace'/><category term='bug'/><category term='debugger'/><category term='RobotLegs'/><category term='locale'/><category term='ActionScript'/><category term='UI'/><category term='Multiple'/><category term='JS'/><category term='Signals'/><category term='demo'/><category term='OS X'/><category term='AS3Signals'/><category term='debug Flash CS3 in FlexBuilder 3'/><category term='Formatter'/><category term='Compiled'/><category term='Flex Builder'/><category term='SignalCommandMap'/><category term='Flex'/><category term='Multiple Instances'/><category term='app'/><category term='CommandMap'/><category term='FlashBuilder4'/><category term='Terminal'/><category term='Events'/><category term='Check'/><category term='Multiple Workspaces'/><category term='HTML5'/><category term='WebStorm'/><category term='debug'/><category term='enum'/><category term='Swiz'/><category term='FlashBuilder'/><category term='Flash Builder'/><category term='Spark'/><category term='jewels'/><category term='tutorial'/><category term='AS3'/><category term='UX'/><category term='Hero'/><category term='OO'/><category term='Flash Builder 4'/><category term='hello world'/><category term='edit'/><category term='Command Map'/><category term='Eclipse'/><category term='Observer Pattern'/><category term='javaScript'/><category term='LocaleID'/><category term='flash cs3'/><category term='FlexBuilder'/><category term='Compile'/><category term='Object Oriented'/><title type='text'>Flex Food</title><subtitle type='html'>Jason Hanson's Blog about Code</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://flexfood.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://flexfood.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Jason Hanson</name><uri>http://www.blogger.com/profile/17630499518940710366</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>27</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4382065257881406250.post-2293565391156739957</id><published>2011-11-12T22:14:00.001-08:00</published><updated>2011-11-13T05:37:48.013-08:00</updated><title type='text'>Objective-C Programming, Chapters 1-11</title><content type='html'>I just wrapped up Chapters 1-11 of the book I am working through named &lt;i&gt;Objective-C Programming. &lt;/i&gt;&amp;nbsp;I am really enjoying the book. &amp;nbsp;The first 11 chapters of the book are all about the language C. &amp;nbsp;I am so excited about several things I get in C. &lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Explicit&amp;nbsp;memory management&lt;/li&gt;&lt;li&gt;Getting memory pointer reference values in code&lt;/li&gt;&lt;li&gt;Bigger numbers&amp;nbsp;&lt;/li&gt;&lt;li&gt;Access to tons of already written C code&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;A few things I am&amp;nbsp;struggling&amp;nbsp;with&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Pointers vs variables&lt;/li&gt;&lt;li&gt;When / how to use &lt;span class="Apple-style-span" style="color: red;"&gt;*&lt;/span&gt;&lt;/li&gt;&lt;li&gt;When / how to&amp;nbsp;deference&amp;nbsp;objects and the heap&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;I am sure I will figure those out as I progress further down the path. &amp;nbsp;The combination of the Stanford U iOS videos, working on my own iOS project, and working through this book it really doing the trick for me. &amp;nbsp;Whenever I feel like I am 'getting it' I go work on my project for a while till I hit a roadblock. &amp;nbsp;Then I am motivated to slug through the documentation page-by-page filling in the gaps.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I think I am going to love this. &amp;nbsp;I know I am going to love knowing more about C.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4382065257881406250-2293565391156739957?l=flexfood.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexfood.blogspot.com/feeds/2293565391156739957/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4382065257881406250&amp;postID=2293565391156739957' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/2293565391156739957'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/2293565391156739957'/><link rel='alternate' type='text/html' href='http://flexfood.blogspot.com/2011/11/objective-c-programming-chapters-1-12.html' title='Objective-C Programming, Chapters 1-11'/><author><name>Jason Hanson</name><uri>http://www.blogger.com/profile/17630499518940710366</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4382065257881406250.post-7491453897022450692</id><published>2011-11-12T20:12:00.001-08:00</published><updated>2011-11-12T20:14:15.033-08:00</updated><title type='text'>More Objective-C and iOS</title><content type='html'>Ok, so I am loving this new book I got on Objective C. &amp;nbsp;It is called Objective-C Programming by Aaron Hillegass by The Big Nerd Ranch. &amp;nbsp;Just what I was looking for. &amp;nbsp;Working through it now; baby steps.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.amazon.com/Objective-C-Programming-Ranch-Guide-Guides/dp/0321706285/ref=ntt_at_ep_dpt_2"&gt;http://www.amazon.com/Objective-C-Programming-Ranch-Guide-Guides/dp/0321706285/ref=ntt_at_ep_dpt_2&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4382065257881406250-7491453897022450692?l=flexfood.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexfood.blogspot.com/feeds/7491453897022450692/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4382065257881406250&amp;postID=7491453897022450692' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/7491453897022450692'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/7491453897022450692'/><link rel='alternate' type='text/html' href='http://flexfood.blogspot.com/2011/11/more-objective-c-and-ios.html' title='More Objective-C and iOS'/><author><name>Jason Hanson</name><uri>http://www.blogger.com/profile/17630499518940710366</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4382065257881406250.post-3399022975051444404</id><published>2011-10-25T06:43:00.000-07:00</published><updated>2011-10-25T06:48:38.234-07:00</updated><title type='text'>Native iOS</title><content type='html'>As many of you know I have been a big fan of the Flash Platform for more then a decade.  I fully embraced and evangelized AIR for Android and AIR for iOS.  It just made sense, and worked. All the being said, once I got into the details of developing for iOS with Flex I found many things lacking, mostly performance, and the workflow.&lt;br /&gt;&lt;br /&gt;I am making the jump and going to learn native iOS development.  Here is where I started:&lt;br /&gt;&lt;br /&gt;Cocoa Fundementals:&amp;nbsp;&lt;a href="http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/CocoaFundamentals/Introduction/Introduction.html#//apple_ref/doc/uid/TP40002974"&gt;http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/CocoaFundamentals/Introduction/Introduction.html#//apple_ref/doc/uid/TP40002974&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I read through most of that, and then took a break to watch this video series: &lt;a href="http://www.stanford.edu/class/cs193p/cgi-bin/drupal/"&gt;http://www.stanford.edu/class/cs193p/cgi-bin/drupal/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I am finding that the Apple world has lots of silly names for things, like Quarts, Darwin, Bonjour, etc.  It is like stepping onto an island where developers have been building their own fairy tale world for the last 20 years.  I am hoping that after I get past the fairy dust I will start to make correlations to other things I know about software development.  &lt;br /&gt;&lt;br /&gt;So far the good news, for me, is that Cocoa development is done in an object-oriented way, and I have pretty good understanding of developing that way.  Also, the notion of MVC seems to be an option for development - may even be prescriptive -  I am fine with that.  I have not yet found / heard about how to do dependency injection, however.&lt;br /&gt;&lt;br /&gt;Back to learning!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4382065257881406250-3399022975051444404?l=flexfood.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexfood.blogspot.com/feeds/3399022975051444404/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4382065257881406250&amp;postID=3399022975051444404' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/3399022975051444404'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/3399022975051444404'/><link rel='alternate' type='text/html' href='http://flexfood.blogspot.com/2011/10/native-ios.html' title='Native iOS'/><author><name>Jason Hanson</name><uri>http://www.blogger.com/profile/17630499518940710366</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4382065257881406250.post-2964355598115602148</id><published>2011-09-25T09:36:00.000-07:00</published><updated>2011-09-25T09:37:31.732-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CommandMap'/><category scheme='http://www.blogger.com/atom/ns#' term='Events'/><category scheme='http://www.blogger.com/atom/ns#' term='Signal Command Map'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='Observer Pattern'/><category scheme='http://www.blogger.com/atom/ns#' term='SignalCommandMap'/><category scheme='http://www.blogger.com/atom/ns#' term='Swiz'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Command Map'/><category scheme='http://www.blogger.com/atom/ns#' term='RobotLegs'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3Signals'/><category scheme='http://www.blogger.com/atom/ns#' term='flash'/><title type='text'>Swiz Extension - SignalCommandMap (Part 3)</title><content type='html'>Unlike me, I have been sticking with writing this Swiz extension.  Often I get distracted by other shiny objects, however, with this project I really see some long term benefits in the from of me writing better code, faster.  That is keeping the light burning for me.&lt;br /&gt;&lt;br /&gt;I have made update to both the example project and the SignalCommandMap.  This update adds the ability to map a Signal class type directly to a Command class type.  No need to make an instance of the Signal you want to map.  Also no need to register the Signal with Swiz.  That is done by the SingalCommandMap class.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Signal to Command Mapping&lt;/b&gt;&lt;script src="https://gist.github.com/1240798.js"&gt; &lt;/script&gt;&lt;br /&gt;&lt;br /&gt;There are two gains that really appreciate the gains in being able to map directly to a Signal class type. &lt;br /&gt;&lt;ul&gt;&lt;li&gt;One - No need to inject the signal into the command map&lt;/li&gt;&lt;li&gt;Two - No need to add the Signal to the list of 'bean' in the Swiz config&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;Example: Swiz Single Command Map (rt-click to view source)&lt;br /&gt;&lt;iframe style="border:medium solid rgb(55,55,55)" height="300" src="http://jasonhanson.com/blog/swiz/signalCommandMapPart3/index.html" width="240"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Here is the Code!&lt;/b&gt;&lt;br /&gt;Link to the Swiz extension (note: dependencies on both Swiz and AS3Signals)&lt;br /&gt;&lt;a href="https://github.com/jayfour000/swiz-extension-SignalCommandMap"&gt;https://github.com/jayfour000/swiz-extension-SignalCommandMap&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Link to a very simple example project (note: dependencies on Swiz, AS3Signals, and swiz-extension-SignalCommandMap)&lt;br /&gt;&lt;a href="https://github.com/jayfour000/swiz-examples-SwizSignalCommandLogin"&gt;https://github.com/jayfour000/swiz-examples-SwizSignalCommandLogin&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Please post back with any questions or comments you have.&lt;br /&gt;&lt;br /&gt;--jason&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4382065257881406250-2964355598115602148?l=flexfood.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexfood.blogspot.com/feeds/2964355598115602148/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4382065257881406250&amp;postID=2964355598115602148' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/2964355598115602148'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/2964355598115602148'/><link rel='alternate' type='text/html' href='http://flexfood.blogspot.com/2011/09/swiz-extension-signalcommandmap-part-3.html' title='Swiz Extension - SignalCommandMap (Part 3)'/><author><name>Jason Hanson</name><uri>http://www.blogger.com/profile/17630499518940710366</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4382065257881406250.post-8050893539052967806</id><published>2011-09-23T20:37:00.000-07:00</published><updated>2011-09-25T09:18:29.423-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CommandMap'/><category scheme='http://www.blogger.com/atom/ns#' term='Events'/><category scheme='http://www.blogger.com/atom/ns#' term='Signal Command Map'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='Observer Pattern'/><category scheme='http://www.blogger.com/atom/ns#' term='SignalCommandMap'/><category scheme='http://www.blogger.com/atom/ns#' term='Swiz'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Command Map'/><category scheme='http://www.blogger.com/atom/ns#' term='RobotLegs'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3Signals'/><category scheme='http://www.blogger.com/atom/ns#' term='flash'/><title type='text'>Swiz Extension - SignalCommandMap (Part 2)</title><content type='html'>Building on the topic in my last blog post I have written a new extension for Swiz. &amp;nbsp;It is based off of &lt;a href="http://joelhooks.com/"&gt;Joel Hooks'&lt;/a&gt;&amp;nbsp;&lt;a href="https://github.com/swiz/swiz-framework/blob/develop/src/org/swizframework/utils/commands/CommandMap.as"&gt;SignalCommandMap&lt;/a&gt; for &lt;a href="http://www.robotlegs.org/"&gt;RobotLegs&lt;/a&gt;, and the &lt;a href="https://github.com/swiz/swiz-framework/blob/develop/src/org/swizframework/utils/commands/CommandMap.as"&gt;CommandMap&lt;/a&gt; already in &lt;a href="http://swizframework.org/"&gt;Swiz&lt;/a&gt;&amp;nbsp;written by &lt;a href="http://www.benclinkinbeard.com/"&gt;Ben Clinkenbeard&lt;/a&gt;. &amp;nbsp;It takes advantage of the &lt;a href="https://github.com/robertpenner/as3-signals"&gt;AS3Signals&lt;/a&gt; project written by &lt;a href="http://robertpenner.com/"&gt;Robert Penner&lt;/a&gt;. &amp;nbsp;It is really not a new idea, just filling a gap in Swiz for those of us who love command maps, but dislike events. &amp;nbsp;I have basically just mashed up two classes written by folks much smarter then I.&lt;br /&gt;&lt;br /&gt;It is a work in progress at this point, but the main functionality is written; and working. &amp;nbsp;I have also have written unit tests to cover about a quarter of the functionality, so far :).&lt;br /&gt;&lt;br /&gt;I was inspired to write this extension for Swiz after&amp;nbsp;struggling&amp;nbsp;with Events on my last project. &amp;nbsp;My workmate &lt;a href="http://www.nimblenogginsoftware.com/"&gt;Jeff Roberts&lt;/a&gt;&amp;nbsp;turned me on to the command map pattern and the CommandMap feature of Swiz. &amp;nbsp;I fell in love with the way commands enforce good encapsulation practices, are easy to test, easy to digest, and easy to refactor. &amp;nbsp;The commands are also transient. &amp;nbsp;That means that they are created, and destroyed, every time the signal that is mapped to the command is dispatched. &amp;nbsp;This removes the possibility for bugs related to state not getting properly reset that sometimes arise when using a state-full controller. &amp;nbsp;It also helps mitigate certain types of race conditions and memory issues, in my opinion.&lt;br /&gt;&lt;br /&gt;One thing I really did &lt;u&gt;not&lt;/u&gt;&amp;nbsp;like about the existing CommandMap in Swiz was that I had to create a new event for about every third command I wrote. &amp;nbsp;I had to add all the properties I wanted to send along as a payload to the command. &amp;nbsp;It was kinda a pain, extra code, and just a another chance to make a typo. &amp;nbsp;I also did not like having to follow the event chain backwards in the stack when &amp;nbsp;when I would hit a runtime exception. &amp;nbsp;Sometimes I would just not be able to tell where the RTE was happening at. &amp;nbsp;My hope is that AS3Signals will solve some of these problems for me :).&lt;br /&gt;&lt;br /&gt;Having written several 2000+ line mega-controllers in my past I found the command map pattern&amp;nbsp;completely&amp;nbsp;refreshing. &amp;nbsp;The command map pattern is&amp;nbsp;especially refreshing&amp;nbsp;after the&amp;nbsp;honeymoon period is past on a project (i.e. nine months into the project when everything needs to change and refactoring takes longer then it would to rewrite the whole damn thing).&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Here is the Code!&lt;/b&gt;&lt;br /&gt;Link to the Swiz extension (note: dependencies on both Swiz and AS3Signals)&lt;br /&gt;&lt;a href="https://github.com/jayfour000/swiz-extension-SignalCommandMap"&gt;https://github.com/jayfour000/swiz-extension-SignalCommandMap&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Link to a very simple example project (note: dependencies on Swiz, AS3Signals, and swiz-extension-SignalCommandMap)&lt;br /&gt;&lt;a href="https://github.com/jayfour000/swiz-examples-SwizSignalCommandLogin"&gt;https://github.com/jayfour000/swiz-examples-SwizSignalCommandLogin&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Please add any&amp;nbsp;criticisms&amp;nbsp;you have to the comments section below.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Example: Swiz Single Command Map (rt-click to view source)&lt;br /&gt;&lt;iframe style="border:medium solid rgb(55,55,55)" height="300" src="http://jasonhanson.com/blog/swiz/signalCommandMap/index.html" width="240"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;--jason&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4382065257881406250-8050893539052967806?l=flexfood.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexfood.blogspot.com/feeds/8050893539052967806/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4382065257881406250&amp;postID=8050893539052967806' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/8050893539052967806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/8050893539052967806'/><link rel='alternate' type='text/html' href='http://flexfood.blogspot.com/2011/09/swiz-extension-signalcommandmap.html' title='Swiz Extension - SignalCommandMap (Part 2)'/><author><name>Jason Hanson</name><uri>http://www.blogger.com/profile/17630499518940710366</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4382065257881406250.post-7502218726210727239</id><published>2011-09-19T21:03:00.000-07:00</published><updated>2011-09-25T09:18:54.499-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='FlashBuilder'/><category scheme='http://www.blogger.com/atom/ns#' term='Swiz'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Signals'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='flash'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3Signals'/><title type='text'>Swiz + AS3Signals = SignalMap (Part 1)</title><content type='html'>&lt;br /&gt;I really like Swiz. &amp;nbsp;It works great with Presentation Models. &amp;nbsp;It generally just gets out of my way. &amp;nbsp;I have been using the Swiz Command Map in lue of Mediating events for my last few projects. &amp;nbsp;It is nice to have the logic broken down in to little single-purpose commands. &amp;nbsp;The Services and PMs communicate to the Commands by dispatching an event on the global event dispatcher. &amp;nbsp;The events are mapped to the commands in the Command Map.&lt;br /&gt;&lt;br /&gt;The last bit of that kinda irks me. &amp;nbsp;I don't like creating tons of events and mapping them to commands. &amp;nbsp;I end up writing much more boiler-plate code then I would like. &amp;nbsp;Creating the new event classes takes time. &amp;nbsp;Writing the code to dispatch the events also takes time and space. &amp;nbsp;It also can create some annoying stack traces when I have to dig back through events.&lt;br /&gt;&lt;br /&gt;In a past life I used callbacks in lieu of the event system in Flash with pretty good success. &amp;nbsp;It was kinda odd at the start, but then I got used to it. &amp;nbsp;I also have been in love with AS3Signals for some time now, but have not used it much on Flex projects, just pure AS3 ones.&lt;br /&gt;&lt;br /&gt;I set out to cut out the .events.* package from my recent standard architecture and replace them with Signals. &amp;nbsp;One of my goals was to not just end up having to create &lt;i&gt;n &lt;/i&gt;number of Signal classes to replace the previous Event classes. &amp;nbsp;I like what I ended up with so far. &amp;nbsp;I dumped the Command Map entirely and replaced it with a Signal Map. &amp;nbsp;I also got rid of all the custom events :).&lt;br /&gt;&lt;br /&gt;The big loss is that I do not get strong typing for the properties I want to send along as the payload from the Service, or PM, to the Command like I did with Events. &amp;nbsp;To be honest, however, I often just had the 2nd or 3rd params of my Events something like data:Object that I would just jam full of whatever data I wanted to send long .. because I was too lazy to make a new event. &amp;nbsp;Maybe not even lazy; it just&amp;nbsp;interrupted&amp;nbsp;my flow.&lt;br /&gt;&lt;br /&gt;Here is a test project I made that follows this pattern. &amp;nbsp;You can see that I am playing around with the most&amp;nbsp;efficient&amp;nbsp;way to&amp;nbsp;declare&amp;nbsp;a Signal.&lt;br /&gt;&lt;br /&gt;EDIT - this was crap. &amp;nbsp;I deleted it and rewrote it.&lt;br /&gt;&lt;strike&gt;&lt;a href="https://github.com/jayfour000/IoC-Swiz-SignalMap/tree/master/src"&gt;https://github.com/jayfour000/IoC-Swiz-SignalMap/tree/master/src&lt;/a&gt;&lt;/strike&gt;&lt;br /&gt;https://github.com/jayfour000/swiz-extension-SignalCommandMap&lt;br /&gt;https://github.com/jayfour000/swiz-examples-SwizSignalCommandLogin&lt;br /&gt;&lt;br /&gt;Let me know what you think. &amp;nbsp;Let me know if you see any issues with scaling, particularly compared to the Swiz Command Map. &lt;br /&gt;&lt;br /&gt;I have heard that the Swiz Command Map creates a new instance of the command each time an event fires. &amp;nbsp;I don't think that AS3Signals can do anything like that, I am also not sure of what impact that will have on memory in a large application if the commands are not garbage collected after they run .. or if I will run into race conditions or state issues. &amp;nbsp;Thought on this?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4382065257881406250-7502218726210727239?l=flexfood.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexfood.blogspot.com/feeds/7502218726210727239/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4382065257881406250&amp;postID=7502218726210727239' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/7502218726210727239'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/7502218726210727239'/><link rel='alternate' type='text/html' href='http://flexfood.blogspot.com/2011/09/swiz-as3signals-signalmap.html' title='Swiz + AS3Signals = SignalMap (Part 1)'/><author><name>Jason Hanson</name><uri>http://www.blogger.com/profile/17630499518940710366</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4382065257881406250.post-3086863351614233773</id><published>2011-02-23T10:04:00.000-08:00</published><updated>2011-02-23T10:10:04.656-08:00</updated><title type='text'>snipt.net</title><content type='html'>I just started using snip.com.  I like it.  I am going to try posting code there for a while and see if it works out.  Posting code in the blog WYSIWYG interface is always so painful.  Check out my first snip!&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://snipt.net/jayfour000/pass-param-vs-ref-class-property"&gt;http://snipt.net/jayfour000/pass-param-vs-ref-class-property&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;script type="text/javascript" src="http://snipt.net/embed/9ef27e2f6974dd93f4121dde93848353"&gt;&lt;/script&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4382065257881406250-3086863351614233773?l=flexfood.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexfood.blogspot.com/feeds/3086863351614233773/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4382065257881406250&amp;postID=3086863351614233773' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/3086863351614233773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/3086863351614233773'/><link rel='alternate' type='text/html' href='http://flexfood.blogspot.com/2011/02/sniptnet.html' title='snipt.net'/><author><name>Jason Hanson</name><uri>http://www.blogger.com/profile/17630499518940710366</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4382065257881406250.post-8150546627969050789</id><published>2010-11-16T07:20:00.001-08:00</published><updated>2010-11-16T07:35:34.308-08:00</updated><title type='text'>Working with enum state values in Spark</title><content type='html'>&lt;span class="Apple-style-span" &gt;As you may know the Spark component do not support state names as constants. You must use a string. To get around issues that using strings as contracts present I have continued to store all my state values in constants. I use a class named StateEnum.as to hold the constants.&lt;br /&gt;&lt;br /&gt;A recent bug related to beta software was causing my Flash Builder to crash when setting a state to a state that did not exist. My bug was that the string name in the tag had a typo and did not match the string in the StateEnum class. In order to catch this I wrote this fancy method to validate the states against the state enum on initialization.&lt;br /&gt;&lt;br /&gt;It still kinda baffles me that I am required to use strings as contracts that cannot be represented as constants ...&lt;br /&gt;&lt;/span&gt;&lt;span class="Apple-style-span" &gt;&lt;blockquote&gt;&lt;br /&gt;// Validate that the states strings are valid&lt;br /&gt;var x:XML = describeType(StateEnum);&lt;br /&gt;var constantList:XMLList = x..constant;&lt;br /&gt;&lt;br /&gt;for each (var s:State in states)&lt;br /&gt;{&lt;br /&gt;var stateFound:Boolean = false;&lt;br /&gt;for each (var constant:XML in constantList)&lt;br /&gt;{&lt;br /&gt;var constantName:String = constant.@name.toString();&lt;br /&gt;var stateString:String = StateEnum[constantName];&lt;br /&gt;if (s.name == stateString)&lt;br /&gt;{&lt;br /&gt;stateFound = true;&lt;br /&gt;break;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if (!stateFound)&lt;br /&gt;{&lt;br /&gt;throw new Error("This class contains a state that does not match a known state enum value.");&lt;br /&gt;}&lt;br /&gt;}&lt;/blockquote&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4382065257881406250-8150546627969050789?l=flexfood.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexfood.blogspot.com/feeds/8150546627969050789/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4382065257881406250&amp;postID=8150546627969050789' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/8150546627969050789'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/8150546627969050789'/><link rel='alternate' type='text/html' href='http://flexfood.blogspot.com/2010/11/working-with-enum-state-values-in-spark.html' title='Working with enum state values in Spark'/><author><name>Jason Hanson</name><uri>http://www.blogger.com/profile/17630499518940710366</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4382065257881406250.post-3269762602774030526</id><published>2010-11-10T10:23:00.000-08:00</published><updated>2010-11-10T10:46:31.650-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Hero'/><category scheme='http://www.blogger.com/atom/ns#' term='Formatter'/><category scheme='http://www.blogger.com/atom/ns#' term='bug'/><category scheme='http://www.blogger.com/atom/ns#' term='LocaleID'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='locale'/><category scheme='http://www.blogger.com/atom/ns#' term='Spark'/><title type='text'>Using Spark Formatters</title><content type='html'>When declaring spark formatters in AS3 code you must set the locale manually.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;var myFormatter:spark.formatters.CurrencyFormatter = new spark.formatters.CurrencyFormatter(); &lt;/div&gt;&lt;div&gt;&lt;b&gt;myFormatter.setStyle("locale", LocaleID.DEFAULT);&lt;/b&gt;&lt;/div&gt;&lt;div&gt;myFormatter.useCurrencySymbol = true;&lt;/div&gt;&lt;div&gt;myFormatter.trailingZeros = true;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you do not do this the formatter will not work!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Note: You can also set the locale style globally with this code:&lt;/div&gt;&lt;div&gt;&lt;div&gt;var myStyleManager: IStyleManager2 = StyleManager.getStyleManager(this.moduleFactory);&lt;/div&gt;&lt;div&gt;myStyleManager.getStyleDeclaration("global").setStyle("locale",LocaleID.DEFAULT);&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;http://opensource.adobe.com/wiki/display/flexsdk/Spark+Formatters&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4382065257881406250-3269762602774030526?l=flexfood.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexfood.blogspot.com/feeds/3269762602774030526/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4382065257881406250&amp;postID=3269762602774030526' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/3269762602774030526'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/3269762602774030526'/><link rel='alternate' type='text/html' href='http://flexfood.blogspot.com/2010/11/using-spark-formatters.html' title='Using Spark Formatters'/><author><name>Jason Hanson</name><uri>http://www.blogger.com/profile/17630499518940710366</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4382065257881406250.post-3532409081070661948</id><published>2010-08-23T08:34:00.001-07:00</published><updated>2010-08-23T11:08:32.061-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JS'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML5'/><category scheme='http://www.blogger.com/atom/ns#' term='jewels'/><category scheme='http://www.blogger.com/atom/ns#' term='javaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='flash'/><category scheme='http://www.blogger.com/atom/ns#' term='WebStorm'/><category scheme='http://www.blogger.com/atom/ns#' term='OO'/><category scheme='http://www.blogger.com/atom/ns#' term='Object Oriented'/><title type='text'>HTML canvas tag and OO javaScript</title><content type='html'>&lt;div&gt;I decided to take the HTML5 canvas tag for a run and see what is possible and how it compares to Flash.  It took a while to learn all the little differences between ActionSctipt3 and javaScript. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I read the book &lt;a href="http://www.amazon.com/Object-Oriented-JavaScript-high-quality-applications-libraries/dp/1847194141/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1282586171&amp;amp;sr=8-1"&gt;Object-Oriented JavaScript by Stoyan Stefanov&lt;/a&gt; along the way. It is a really great book!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Some of the really difficult AS3 to JS hurtles for me were:&lt;/div&gt;&lt;div&gt;* No strong types&lt;/div&gt;&lt;div&gt;* No class primitives&lt;/div&gt;&lt;div&gt;* No animation renderer&lt;/div&gt;&lt;div&gt;* No build in mouse events for children on the canvas&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I used the &lt;a href="http://www.jetbrains.com/webstorm/"&gt;WebStorm IDE&lt;/a&gt; by the folks that make IntelliJ and I really really love it.  It is the first integrated debugging experience I have had with javaScript and it was very helpful and comforting.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For a practice project I took a 'jewels' game that I had written in AS3 can converted the core engine from AS3 to javaScript.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The really cool thing about HTML5 / JS / canvas is that most all mobile webkit browsers will play it.  This app works on Android phones, iPad, iPhone, and all the HTML5 desktop browsers :).  The animation is really choppy on low-CPU phones, however.  I am think there is a long way for me to go in learning to optimize animation.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Overall there are many similarities.  I think that HTML5 has a long way to go before it can match the performance of Flash, at least for games.  There are not many 'gimmies' with the canvas tag.  I will never take the timeline render approach in Flash Player for granted again! ;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here is the link to the project:&lt;/div&gt;&lt;div&gt;&lt;a href="http://jasonhanson.com/jewels/"&gt;http://jasonhanson.com/jewels/&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;Here are the slides from a presentation I gave to ActionScript3 developers on the similarities / differences between developing for HTML5 canvas vs Flash&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;iframe src="https://docs.google.com/present/embed?id=dfgdz4vn_51hddvqmc6" frameborder="0" width="410" height="342"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4382065257881406250-3532409081070661948?l=flexfood.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexfood.blogspot.com/feeds/3532409081070661948/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4382065257881406250&amp;postID=3532409081070661948' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/3532409081070661948'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/3532409081070661948'/><link rel='alternate' type='text/html' href='http://flexfood.blogspot.com/2010/08/html-tag-and-oo-javascript.html' title='HTML canvas tag and OO javaScript'/><author><name>Jason Hanson</name><uri>http://www.blogger.com/profile/17630499518940710366</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4382065257881406250.post-1234694737444874901</id><published>2010-05-17T12:21:00.000-07:00</published><updated>2010-05-17T12:25:44.452-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='enum'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash Builder 4'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash Builder'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='flash'/><title type='text'>Enum in AS3</title><content type='html'>Enum.as&lt;br /&gt;&lt;script src='http://pastie.org/964263.js'&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;ButtonTypeEnum.as&lt;br /&gt;&lt;script src='http://pastie.org/964269.js'&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;Usage:&lt;br /&gt;&lt;script src='http://pastie.org/964278.js'&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4382065257881406250-1234694737444874901?l=flexfood.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexfood.blogspot.com/feeds/1234694737444874901/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4382065257881406250&amp;postID=1234694737444874901' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/1234694737444874901'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/1234694737444874901'/><link rel='alternate' type='text/html' href='http://flexfood.blogspot.com/2010/05/enum-in-as3.html' title='Enum in AS3'/><author><name>Jason Hanson</name><uri>http://www.blogger.com/profile/17630499518940710366</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4382065257881406250.post-3716002245914439142</id><published>2010-05-17T11:43:00.001-07:00</published><updated>2010-05-17T12:08:42.962-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='enum'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex Builder'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash Builder 4'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash Builder'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><title type='text'>Reason for Enum in AS3</title><content type='html'>If you are reading this you probably already know that there is no enum type in AS3.  I find it useful to use the concept (and name) of enum in my code to help with contracts that otherwise would be string based.  Here is an example when an enum would be helpful.&lt;br /&gt;&lt;script src='http://pastie.org/964226.js'&gt;&lt;/script&gt;&lt;br /&gt;Some of you may see the bug here.  The implementor code is sending a bad string name.  "fullScreen" instead of "fullscreen".  This could be solved with constants, however you would still have a string based contract.  Instead I recommend using an enum pattern that would allow you to do this:&lt;br /&gt;&lt;script src='http://pastie.org/964232.js'&gt;&lt;/script&gt;&lt;br /&gt;In this second case you can see that the chance for making a typo mistake on "fullScreen" is gone since makeWindow requires a WindowTypeEnum type.&lt;br /&gt;&lt;br /&gt;In the next post I will go into how to write a Enum for AS3&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4382065257881406250-3716002245914439142?l=flexfood.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexfood.blogspot.com/feeds/3716002245914439142/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4382065257881406250&amp;postID=3716002245914439142' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/3716002245914439142'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/3716002245914439142'/><link rel='alternate' type='text/html' href='http://flexfood.blogspot.com/2010/05/reason-for-enum-in-as3.html' title='Reason for Enum in AS3'/><author><name>Jason Hanson</name><uri>http://www.blogger.com/profile/17630499518940710366</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4382065257881406250.post-2787088644659063772</id><published>2010-04-29T06:46:00.001-07:00</published><updated>2010-04-29T07:17:09.370-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='UX'/><category scheme='http://www.blogger.com/atom/ns#' term='UI'/><category scheme='http://www.blogger.com/atom/ns#' term='flash'/><title type='text'>UX - Form Follow Function, but what form?</title><content type='html'>I recently read an article titled "Developers, UX is not UI, learn that and stop trivializing!" http://www.uxpassion.com/2010/04/ux-not-ui-learn-stop-trivializing/ and was stuck by a few things.&lt;br /&gt;&lt;br /&gt;UX as a part of software development has a hard road.  I related to the mention in this article about developer-centric cultures.  When it is hard to get even your close workmates on-board with giving value to UX it can be a very hard sell to get product stake holders to assign value to it.  The good news is that once most people I have interacted with learn what UX is and see data that supports it's value then the light bulb often turns on :).&lt;br /&gt;&lt;br /&gt;When I was in a college sculpture class my instructor regularly enforced the notion of Form Follow Function to his students.  Something that really was punctuated by a movie I watched recently called Objectified (http://www.objectifiedfilm.com/objectified-trailer/).&lt;br /&gt;&lt;br /&gt;For many years in software development there was a "Form Follows Function" rule of sorts, but it was more like "Form Follows whatever I can get this programing language to put out and compile / compress down to something we can deliver to our users", or rather, "Form Follows Technology".&lt;br /&gt;&lt;br /&gt;"Form Follows Technology"&lt;br /&gt;It is my firm belief that presently the rule of "Form Follows Technology" can largely be tossed out.  Software, hardware, and the delivery mechanism has grown up enough that nearly anything is possible. IMO the user interface can now cater to the user, and not the technology.  True, we are still largely limited to a fixed size, single texture, uniformly flat surface - however, that is an acceptable constraint for the moment.&lt;br /&gt;&lt;br /&gt;What this means is that there are very few arguments left against "Form Follows Human Function" in software development now.  Building for the functional aspects of the human users.  The way the human brain functions and the way a human body interacts with a flat surface with images on it are the *Function* of "Form Follow Function" of software development now.&lt;br /&gt;&lt;br /&gt;There really is no certain point in time when this became possible, and technically it was possible all along - just difficult.  I guess what I am getting at is that with software tools like Photoshop, Illustrator, and Fireworks, and technologies like Flash the list of reasons not to have development driven by the possible functions of the humans that use the software is getting shorter.&lt;br /&gt;&lt;br /&gt;It can still be a hard fight, especially if on your project the final decisions rest on individuals who "trivialize" user experience.  The success of good UX will, in the end, prevail.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4382065257881406250-2787088644659063772?l=flexfood.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexfood.blogspot.com/feeds/2787088644659063772/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4382065257881406250&amp;postID=2787088644659063772' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/2787088644659063772'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/2787088644659063772'/><link rel='alternate' type='text/html' href='http://flexfood.blogspot.com/2010/04/ux-form-follow-function-but-what-form.html' title='UX - Form Follow Function, but what form?'/><author><name>Jason Hanson</name><uri>http://www.blogger.com/profile/17630499518940710366</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4382065257881406250.post-1185497925855875124</id><published>2010-04-21T06:17:00.000-07:00</published><updated>2010-04-21T06:55:05.336-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Multiple Instances'/><category scheme='http://www.blogger.com/atom/ns#' term='app'/><category scheme='http://www.blogger.com/atom/ns#' term='OS X'/><category scheme='http://www.blogger.com/atom/ns#' term='Multiple'/><category scheme='http://www.blogger.com/atom/ns#' term='Multiple Workspaces'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex Builder'/><category scheme='http://www.blogger.com/atom/ns#' term='Workspace'/><category scheme='http://www.blogger.com/atom/ns#' term='FlashBuilder4'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='Terminal'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash Builder 4'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash Builder'/><title type='text'>Open Multiple Instances of Flash Builder 4 on OS X</title><content type='html'>&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;When I develop on a PC I have 2-3 instances of Eclipse or Flash Builder open at the same time.  I do this because I use workspaces to organize my projects.  On PC it is as simple as double-clicking the application icon multiple times.  On OS X it is a bit of a pain.  For some reason I don't understand opening the application multiple times just brings a single instance of the application to the foreground.  It is totally odd, but there is a work around. &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;I found some instructions about adding &amp;amp; to the end of a command line to open the application, however I failed to get Adobe Flash Builder 4 to open when I tried it.  I needed to get inside the ".app" wrapper of the application to send the &amp;amp; command to the proper executable.  Here are the steps.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Open Terminal (Applications/Utilities/Terminal)&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Notice that the default location is your user folder, not the root of the drive.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;pre class="prettyprint"&gt;computername: ~userName$&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;You want to go up a few levels from here.  Type:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;pre class="prettyprint"&gt;cd ../../&lt;/pre&gt; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Press return&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Check your location. Type:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;pre class="prettyprint"&gt;ls&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Press return&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;You should see Applications in the list that is printed out in the terminal window along with other directories including Users.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Now navigate to your Flash Builder install.  Type (with quotes):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;pre class="prettyprint"&gt;cd "Applications/Adobe Flash Builder 4"&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Press return&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Now we need to crack open the application folder and get into the executables.  Type (with quotes - notice the ".app"):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;pre class="prettyprint"&gt;cd "Adobe Flash Builder 4.app/Contents/MacOS"&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Press return&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Now to send a command to open a second copy of Adobe Flash Builder 4.  Type:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;pre class="prettyprint"&gt;./"Adobe Flash Builder 4" &amp;amp;&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Press return&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;That should do it.  You will be prompted to choose a new workspace.  Just pick the workspace you want to use and you are all set.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Post back if you have an issues.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Thanks to this post for pointing me in the right direction on this:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://stackoverflow.com/questions/118243/open-multiple-eclipse-workspaces-on-the-mac"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;http://stackoverflow.com/questions/118243/open-multiple-eclipse-workspaces-on-the-mac&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4382065257881406250-1185497925855875124?l=flexfood.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexfood.blogspot.com/feeds/1185497925855875124/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4382065257881406250&amp;postID=1185497925855875124' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/1185497925855875124'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/1185497925855875124'/><link rel='alternate' type='text/html' href='http://flexfood.blogspot.com/2010/04/open-multiple-instances-of-flash.html' title='Open Multiple Instances of Flash Builder 4 on OS X'/><author><name>Jason Hanson</name><uri>http://www.blogger.com/profile/17630499518940710366</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4382065257881406250.post-68928905153340503</id><published>2010-03-12T06:10:00.001-08:00</published><updated>2010-03-12T06:22:37.359-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Compile'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='FlexBuilder'/><category scheme='http://www.blogger.com/atom/ns#' term='FlashBuilder4'/><category scheme='http://www.blogger.com/atom/ns#' term='Check'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='Compiled'/><category scheme='http://www.blogger.com/atom/ns#' term='flash'/><title type='text'>Compile check ALL my AS3 Code</title><content type='html'>I often hear from folks that they wish that ALL the ActionScript code they write would get compile checked.  I agree and structure my projects so that all of my code is compile checked.  The example below is for Flash Builder 4 beta 2, but the steps are similar in Flex Builder 2 and Flex Builder 3.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1) File --&gt; New --&gt; Flex Library Project (or Alt+Shift+N)&lt;/div&gt;&lt;div&gt;Don't worry, you don't need to be building a Flex project, the Flex Library Project type works if you main application class is pure ActionScript&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2) Add ActionScript classes as .as or .mxml classes to the src directory in the new project you just made.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;3) Ensure that the classes are being compiled into the library by doing this:&lt;/div&gt;&lt;div&gt;  a. Click on the project name in the Package Explorer&lt;/div&gt;&lt;div&gt;  b. File --&gt; Properties (or Alt+Enter)&lt;/div&gt;&lt;div&gt;  c. Click Flex Library Build Path&lt;/div&gt;&lt;div&gt;  d. Click Classes tab&lt;/div&gt;&lt;div&gt;  e. Make sure that the classes you want compiled are included (check mark 'src')&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;4) Ensure your code is being compiled by checking the bin directory for a .swc file&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;5) Now you can include this library in any other project you make (steps below)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;6) Make a new Flex Project&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;7) Select the new Flex Project you just made and link the library you made in the previous steps&lt;/div&gt;&lt;div&gt;  a. Click on the project name in the Package Explorer&lt;/div&gt;&lt;div&gt;  b. File --&gt; Properties (or Alt+Enter)&lt;/div&gt;&lt;div&gt;  c. Click Flex Library&lt;/div&gt;&lt;div&gt;  d. Click the Library Path tab (if it is not already selected)&lt;/div&gt;&lt;div&gt;  e. Click Add Project&lt;/div&gt;&lt;div&gt;  f.  Add the Flex Library Project you made in the previous steps&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Good Luck&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4382065257881406250-68928905153340503?l=flexfood.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexfood.blogspot.com/feeds/68928905153340503/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4382065257881406250&amp;postID=68928905153340503' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/68928905153340503'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/68928905153340503'/><link rel='alternate' type='text/html' href='http://flexfood.blogspot.com/2010/03/compile-check-all-my-as3-code.html' title='Compile check ALL my AS3 Code'/><author><name>Jason Hanson</name><uri>http://www.blogger.com/profile/17630499518940710366</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4382065257881406250.post-4449966478967222700</id><published>2010-03-02T09:24:00.000-08:00</published><updated>2010-03-02T10:00:11.912-08:00</updated><title type='text'>CS5 Features I am Looking Forward To</title><content type='html'>&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;1) New text options in Flash Professional&lt;br /&gt;&lt;br /&gt;2) New Flash Builder project type for Flash Professional&lt;br /&gt;&lt;br /&gt;3) Save FLA file as plain text (XFL) format. &lt;br /&gt;&lt;br /&gt;4) Edit plain text of a XFL and reopen in Flash Professional&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;5) Flash Catalyst - In context editing of objects in Illustrator CS5&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4382065257881406250-4449966478967222700?l=flexfood.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexfood.blogspot.com/feeds/4449966478967222700/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4382065257881406250&amp;postID=4449966478967222700' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/4449966478967222700'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/4449966478967222700'/><link rel='alternate' type='text/html' href='http://flexfood.blogspot.com/2010/03/cs5-features-i-am-looking-forward-to.html' title='CS5 Features I am Looking Forward To'/><author><name>Jason Hanson</name><uri>http://www.blogger.com/profile/17630499518940710366</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4382065257881406250.post-9027862501520865225</id><published>2010-02-26T06:38:00.001-08:00</published><updated>2010-02-26T06:52:27.526-08:00</updated><title type='text'>Monkey Patching AnyChart</title><content type='html'>&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;First, I need to say that I have enjoyed my time working with AnyChart.  It is a good pure AS3 charting component set.  That being said, there was a feature I wanted to use that was not supported.  AnyChart has the notion of 'markers'.  Markers are little icons that you can attach to your charts.  Markers can be one of a dozen or so defined shapes.  You can also use an external image that will get loaded at runtime for the marker.&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;What I needed was a stand alone SWF file that did not load in assets at runtime.  I was able to accomplish this via a Monkey Patch.  It took a bunch of poking and prodding to find the right spot to do it.  If you are in a pinch and just need this to work I have included my code below.  The idea is to convert your DisplayObject that you want to use for a Marker into an object that can be sent to loader.loadBytes.  I did this by making a new BitmapData and drawing my object into it, then get the byteArray by doing PNGEncoder.PNGEncode().  And finally, send that to the loader.loadBytes.  The COMPLETE handler in AnyChart will handle the rest.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;1) In your project make a new package &lt;pre&gt;com.anychart.resources&lt;/pre&gt;&lt;br /&gt;2) Make a new Class&lt;pre&gt;ImageEntry.as&lt;/pre&gt;&lt;br /&gt;3) Add this code: &lt;pre class="prettyprint"&gt;package com.anychart.resources&lt;br /&gt;{&lt;br /&gt;import flash.display.*;&lt;br /&gt;import flash.net.getClassByAlias;&lt;br /&gt;import com.anychart.controls.legend.IconSettings;&lt;br /&gt;import flash.utils.ByteArray;&lt;br /&gt;import flash.geom.Rectangle;&lt;br /&gt;import com.anychart.encoders.PNGEncoder;&lt;br /&gt;import com.mimio.core.view.component.DotButton;&lt;br /&gt;&lt;br /&gt;final class ImageEntry extends ResourceEntry&lt;br /&gt;{&lt;br /&gt; private var loader:Loader;&lt;br /&gt;&lt;br /&gt; function ImageEntry()&lt;br /&gt; {&lt;br /&gt;  this.loader = new Loader();&lt;br /&gt;  this.initListeners(this.loader.contentLoaderInfo);&lt;br /&gt;  return;&lt;br /&gt; } // end function&lt;br /&gt;&lt;br /&gt; override public function stopLoading():void&lt;br /&gt; {&lt;br /&gt;  if (this.isLoading)&lt;br /&gt;  {&lt;br /&gt;   this.loader.close();&lt;br /&gt;   this.isLoading = false;&lt;br /&gt;  }&lt;br /&gt;  return;&lt;br /&gt; } // end function&lt;br /&gt;&lt;br /&gt; override protected function setData(event:ResourceEntryEvent):void&lt;br /&gt; {&lt;br /&gt;  event.data = Bitmap(this.loader.content).bitmapData.clone();&lt;br /&gt;  this.loader.unload();&lt;br /&gt;  this.loader = null;&lt;br /&gt;  return;&lt;br /&gt;&lt;br /&gt; } // end function&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; // TOTAL HACK HERE TO OVERRIDE THE IMAGE URL LOADING&lt;br /&gt; override protected function execLoading():void&lt;br /&gt; {&lt;br /&gt;  var dotButton:DotButton;&lt;br /&gt;&lt;br /&gt;  var requestString:String = this.request.url;&lt;br /&gt;  requestString = requestString.replace("./", "");&lt;br /&gt;&lt;br /&gt;  switch (requestString)&lt;br /&gt;  {&lt;br /&gt;   case "A_Marker":&lt;br /&gt;    dotButton = new DotButton(0, 0, "red", "A");&lt;br /&gt;    break;&lt;br /&gt;   case "B_Marker":&lt;br /&gt;    dotButton = new DotButton(0, 0, "orange", "B");&lt;br /&gt;    break;&lt;br /&gt;   case "C_Marker":&lt;br /&gt;    dotButton = new DotButton(0, 0, "yellow", "C");&lt;br /&gt;    break;&lt;br /&gt;   case "D_Marker":&lt;br /&gt;    dotButton = new DotButton(0, 0, "green", "D");&lt;br /&gt;    break;&lt;br /&gt;   case "E_Marker":&lt;br /&gt;    dotButton = new DotButton(0, 0, "blue", "E");&lt;br /&gt;    break;&lt;br /&gt;   case "XMARK_Marker":&lt;br /&gt;    dotButton = new DotButton(0, 0, "green", "XMARK");&lt;br /&gt;    break;&lt;br /&gt;   case "CHECKMARK_Marker":&lt;br /&gt;    dotButton = new DotButton(0, 0, "red", "CHECKMARK");&lt;br /&gt;    break;&lt;br /&gt;   case "DEFAULT_Marker":&lt;br /&gt;    dotButton = new DotButton(0, 0, "grey", "?");&lt;br /&gt;    break;&lt;br /&gt;   default:&lt;br /&gt;    dotButton = new DotButton(0, 0, "grey", "?");&lt;br /&gt;    break;&lt;br /&gt;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  var bmd:BitmapData = new BitmapData(23, 23);&lt;br /&gt;  bmd.draw(dotButton);&lt;br /&gt;  var bytes:ByteArray = PNGEncoder.PNGencode(bmd);&lt;br /&gt;  this.loader.loadBytes(bytes);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  return;&lt;br /&gt;&lt;br /&gt; } // end function&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4382065257881406250-9027862501520865225?l=flexfood.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexfood.blogspot.com/feeds/9027862501520865225/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4382065257881406250&amp;postID=9027862501520865225' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/9027862501520865225'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/9027862501520865225'/><link rel='alternate' type='text/html' href='http://flexfood.blogspot.com/2010/02/monkey-patching-anychart.html' title='Monkey Patching AnyChart'/><author><name>Jason Hanson</name><uri>http://www.blogger.com/profile/17630499518940710366</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4382065257881406250.post-583173149361805985</id><published>2008-05-27T09:05:00.000-07:00</published><updated>2008-05-27T09:18:49.880-07:00</updated><title type='text'>System Path Variable for mxmlc Compiler</title><content type='html'>Recently I was using the mxmlc compiler from the command line.  Typing the full path &lt;br /&gt;to the mxmlc executable was cumbersome.  I followed the directions from this link &lt;a href="http://windowsitpro.com/article/articleid/48074/how-can-i-add-a-new-folder-to-my-system-path.html"&gt;http://windowsitpro.com/article/articleid/48074/how-can-i-add-a-new-folder-to-my-system-path.html&lt;/a&gt; to add new system path. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1. Start the System Control Panel applet (Start - Settings - Control Panel - System).&lt;br /&gt;&lt;br /&gt;2. Select the Advanced tab.&lt;br /&gt;&lt;br /&gt;3. Click the Environment Variables button.&lt;br /&gt;&lt;br /&gt;4. Under System Variables, select Path, then click Edit.&lt;br /&gt;&lt;br /&gt;5. You'll see a list of folders.  Here is what mine looks like: &lt;pre class="prettyprint"&gt;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;&lt;br /&gt;C:\Program Files\QuickTime\QTSystem\&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;6. Add in the location of your mxmlc compiler.  &lt;br /&gt;&lt;pre class="prettyprint"&gt;%SystemRoot%\system32;%SystemRoot%;&lt;br /&gt;%SystemRoot%\System32\Wbem;C:\Program Files\QuickTime\QTSystem\;&lt;br /&gt;C:\Program Files\Adobe\Flex Builder 3\sdks\3.0.0\bin&lt;/pre&gt;Click OK.&lt;br /&gt;&lt;br /&gt;7. You'll need to restart the processes (e.g., command prompt) that use the system path to see the added folders. &lt;br /&gt;&lt;br /&gt;Now you can call call the mxmlc compiler from any directory.  Test it out by trying this:&lt;br /&gt;1. START --&gt; RUN -- type cmd --&gt; OK&lt;br /&gt;2. type mxmlc -help&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4382065257881406250-583173149361805985?l=flexfood.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexfood.blogspot.com/feeds/583173149361805985/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4382065257881406250&amp;postID=583173149361805985' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/583173149361805985'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/583173149361805985'/><link rel='alternate' type='text/html' href='http://flexfood.blogspot.com/2008/05/system-path-variable-for-mxmlc-compiler.html' title='System Path Variable for mxmlc Compiler'/><author><name>Jason Hanson</name><uri>http://www.blogger.com/profile/17630499518940710366</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4382065257881406250.post-5771622241187992553</id><published>2008-05-20T07:10:00.000-07:00</published><updated>2008-05-20T07:13:21.526-07:00</updated><title type='text'>Flex for Designers</title><content type='html'>Here are some helpful links for designers looking to make skins for Flex.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Article about making skins for Flex in CS3&lt;br /&gt;&lt;a href="http://www.adobe.com/devnet/flex/articles/skins_styles_04.html"&gt;http://www.adobe.com/devnet/flex/articles/skins_styles_04.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Flex Skin Design Extensions &amp; Flex Component Kit for Flash CS3 (need adobe id to log in)&lt;br /&gt;&lt;a href="http://www.adobe.com/cfusion/entitlement/index.cfm?e=flex%5Fskins"&gt;http://www.adobe.com/cfusion/entitlement/index.cfm?e=flex%5Fskins&lt;/a&gt;&lt;br /&gt;Download this checkout the ReadMe.txt&lt;br /&gt;&lt;br /&gt;Flex 3 style explorer (for generating CSS for Flex components)&lt;br /&gt;&lt;a href="http://examples.adobe.com/flex3/consulting/styleexplorer/Flex3StyleExplorer.html#"&gt;http://examples.adobe.com/flex3/consulting/styleexplorer/Flex3StyleExplorer.html#&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Flex 3 component explorer (see example of the Flex component set)&lt;br /&gt;&lt;a href="http://examples.adobe.com/flex3/componentexplorer/explorer.html"&gt;http://examples.adobe.com/flex3/componentexplorer/explorer.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4382065257881406250-5771622241187992553?l=flexfood.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexfood.blogspot.com/feeds/5771622241187992553/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4382065257881406250&amp;postID=5771622241187992553' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/5771622241187992553'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/5771622241187992553'/><link rel='alternate' type='text/html' href='http://flexfood.blogspot.com/2008/05/flex-for-designers.html' title='Flex for Designers'/><author><name>Jason Hanson</name><uri>http://www.blogger.com/profile/17630499518940710366</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4382065257881406250.post-3486950107739927457</id><published>2008-05-16T11:14:00.001-07:00</published><updated>2008-05-19T09:32:39.424-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='debugger'/><category scheme='http://www.blogger.com/atom/ns#' term='debug Flash CS3 in FlexBuilder 3'/><category scheme='http://www.blogger.com/atom/ns#' term='hello world'/><category scheme='http://www.blogger.com/atom/ns#' term='edit'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex Builder'/><category scheme='http://www.blogger.com/atom/ns#' term='FlexBuilder'/><category scheme='http://www.blogger.com/atom/ns#' term='debug'/><category scheme='http://www.blogger.com/atom/ns#' term='demo'/><category scheme='http://www.blogger.com/atom/ns#' term='tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='flash'/><category scheme='http://www.blogger.com/atom/ns#' term='flash cs3'/><title type='text'>Using FlexBuilder 3 to debug &amp; edit Flash CS3 projects</title><content type='html'>Recently I was working on a project that due to a requirement had to be compiled in Flash CS3.  Having spent the last few years exclusively using FlexBuilder I was shocked at the HORRIBLE AS3 editor and debugger in Flash CS3.  I quickly tried to figure out how to edit and debug from FlexBuilder 3.  I got some help along the way, and wanted to share the process.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step 1: (FB3) Create a new ActionScript project in Flex Builder 3 and give it a name.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://i162.photobucket.com/albums/t253/jayfour000/new_as3_project.gif" alt="Photobucket" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="http://i162.photobucket.com/albums/t253/jayfour000/name_as3_project.gif" border="0" alt="Photobucket"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step 2: (Flash CS3) Make a new Flash CS3 project, save it in the SAME DIRECTORY as the AS3 project.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://i162.photobucket.com/albums/t253/jayfour000/new_cs3_project.gif" border="0" alt="Photobucket"&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="http://i162.photobucket.com/albums/t253/jayfour000/name_cs3_project.gif" border="0" alt="Photobucket"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step 3: (Flash CS3) Open up File --&gt; Publish Settings in your Flash CS3 project and select "Permit debugging".&lt;br /&gt;&lt;br /&gt;&lt;img src="http://i162.photobucket.com/albums/t253/jayfour000/permit_debuging.gif" border="0" alt="Photobucket"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step 4: (Flash CS3) Click on the Settings button and enter the name of your main AS3 class.  If your main AS3 class is not in the same directory as the FLA then add the directory as a Classplath.  Click the green check mark to validate the class location.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://i162.photobucket.com/albums/t253/jayfour000/document_class.gif" border="0" alt="Photobucket"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step 5: (FB3) Write a bit of code and put in a break point.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://i162.photobucket.com/albums/t253/jayfour000/write_code.gif" border="0" alt="Photobucket"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step 6: (Flash CS3) Compile a debug version of the SWF.  The breakpoint you entered in FB3 will be compiled into the SWF.  After it compiles and opens in the Flash CS3 debugger just close it.  The SWF should have been compiled into the root of your FB3 project.  I had to quit FB3 and reopen it for the SWF to show up.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://i162.photobucket.com/albums/t253/jayfour000/debug_movie.gif" border="0" alt="Photobucket"&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="http://i162.photobucket.com/albums/t253/jayfour000/swf_in_fb_project.gif" border="0" alt="Photobucket"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step 7: (FB3) Make a new debugging profile that points directly to the Flash CS3 complied SWF (NOT THE FB3 SWF in the bin directory).&lt;br /&gt;&lt;br /&gt;&lt;img src="http://i162.photobucket.com/albums/t253/jayfour000/new_debug_profile.gif" border="0" alt="Photobucket"&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="http://i162.photobucket.com/albums/t253/jayfour000/new_debug_profile_2.gif" border="0" alt="Photobucket"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step 8: (FB3) Debug with your new profile.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://i162.photobucket.com/albums/t253/jayfour000/debug_it.gif" border="0" alt="Photobucket"&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="http://i162.photobucket.com/albums/t253/jayfour000/debug_working.gif" border="0" alt="Photobucket"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If the debugger times-out and does not connect you may need to configure the debugger setting in your Flash Player.  Do this by rt-clicking on the SWF and selecting Debugger.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://i162.photobucket.com/albums/t253/jayfour000/flash_debugger.gif" border="0" alt="Photobucket"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This workflow allows for you to use the code hinting and debugger in FlexBuilder 3 even when compiling in Flash CS3.  Let me know if you run into any problems.&lt;br /&gt;&lt;br /&gt;TROUBLE SHOOTING&lt;br /&gt;&lt;br /&gt;Tip 1: Marcus Williford sent me a note letting me know that Tomcat uses port 9999 by default.  This is the same port that Flex Builder uses to debug.  You need to disabled Tomcat's usage of this port to make debugging work.&lt;br /&gt;&lt;br /&gt;Tip 2: Your Flash player may need special permission to allow local files to access remote sites.  You need to set that up here: &lt;a href="http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;--&gt; Edit locations ... --&gt; Add location ... --&gt; Browse for files (add your SWF file to the list from the Browse dialog)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4382065257881406250-3486950107739927457?l=flexfood.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexfood.blogspot.com/feeds/3486950107739927457/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4382065257881406250&amp;postID=3486950107739927457' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/3486950107739927457'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/3486950107739927457'/><link rel='alternate' type='text/html' href='http://flexfood.blogspot.com/2008/05/using-flexbuilder-3-to-debug-edit-flash.html' title='Using FlexBuilder 3 to debug &amp; edit Flash CS3 projects'/><author><name>Jason Hanson</name><uri>http://www.blogger.com/profile/17630499518940710366</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4382065257881406250.post-7982846186538970742</id><published>2008-05-12T13:58:00.000-07:00</published><updated>2008-05-12T14:01:29.796-07:00</updated><title type='text'>ADC Desktop</title><content type='html'>I just ran across Adobe Developer Connection today.  I installed it (AIR app) and I was happy with what I saw.  I think it might be my new 'home base' for Flex development reading.  It has a RSS reader, and a component browser built in.  Kinda tight.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&amp;extid=1427019"&gt;http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&amp;extid=1427019&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4382065257881406250-7982846186538970742?l=flexfood.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexfood.blogspot.com/feeds/7982846186538970742/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4382065257881406250&amp;postID=7982846186538970742' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/7982846186538970742'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/7982846186538970742'/><link rel='alternate' type='text/html' href='http://flexfood.blogspot.com/2008/05/adc-desktop.html' title='ADC Desktop'/><author><name>Jason Hanson</name><uri>http://www.blogger.com/profile/17630499518940710366</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4382065257881406250.post-6072761911111186765</id><published>2008-04-29T10:15:00.001-07:00</published><updated>2008-04-29T10:22:07.875-07:00</updated><title type='text'>pretty code highlighting for actionscript</title><content type='html'>So I found a way to make the code I post look a bit nicer.  Here is what I am using:&lt;br /&gt;&lt;br /&gt;http://google-code-prettify.googlecode.com/svn/trunk/README.html&lt;br /&gt;&lt;br /&gt;You can use the URLs directly from google source control if you don't have a web server to host them.&lt;br /&gt;&lt;br /&gt;http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.css&lt;br /&gt;http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.js&lt;br /&gt;&lt;br /&gt;&lt;pre class="prettyprint"&gt;// Hello World&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4382065257881406250-6072761911111186765?l=flexfood.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexfood.blogspot.com/feeds/6072761911111186765/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4382065257881406250&amp;postID=6072761911111186765' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/6072761911111186765'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/6072761911111186765'/><link rel='alternate' type='text/html' href='http://flexfood.blogspot.com/2008/04/pretty-code-highlighting-for.html' title='pretty code highlighting for actionscript'/><author><name>Jason Hanson</name><uri>http://www.blogger.com/profile/17630499518940710366</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4382065257881406250.post-201011558415320675</id><published>2008-04-29T09:27:00.001-07:00</published><updated>2008-04-29T10:36:51.514-07:00</updated><title type='text'>Specify a default value for ENUM?</title><content type='html'>So I have this problem.  I cannot seem to specify a default value for a function parameter when it is typed to a custom Enum class.  Check out my simple AS3 test code below.  All attempts I made to set the default caused an error.  Any ideas on a fix?&lt;br /&gt;&lt;br /&gt;My google search led me to this bug, but I am not sure if it is related.&lt;br /&gt;&lt;a href="http://bugs.adobe.com/jira/browse/SDK-12236"&gt;http://bugs.adobe.com/jira/browse/SDK-12236&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;EnumTest.as&lt;pre class="prettyprint"&gt;package {&lt;br /&gt;   import flash.display.Sprite;&lt;br /&gt; &lt;br /&gt;   import src.enum.YesNoEnum;&lt;br /&gt;&lt;br /&gt;   public class EnumTest extends Sprite&lt;br /&gt;   {&lt;br /&gt;        private var paramDefault:YesNoEnum = YesNoEnum.YES;&lt;br /&gt;      &lt;br /&gt;        public function EnumTest()&lt;br /&gt;        {&lt;br /&gt;             testEnumDefault(YesNoEnum.NO);&lt;br /&gt;        }&lt;br /&gt;      &lt;br /&gt;        /**&lt;br /&gt;         * Compile error:&lt;br /&gt;         * 1047: Parameter initializer unknown or is not a compile-time constant.&lt;br /&gt;         */&lt;br /&gt;        //private function testEnumDefault(type:YesNoEnum = YesNoEnum.YES):void&lt;br /&gt;      &lt;br /&gt;        /**&lt;br /&gt;         * Compile error:&lt;br /&gt;         * 1047: Parameter initializer unknown or is not a compile-time constant.&lt;br /&gt;         */&lt;br /&gt;        //private function testEnumDefault(type:YesNoEnum = paramDefault):void&lt;br /&gt;      &lt;br /&gt;      &lt;br /&gt;        /**&lt;br /&gt;         * Runtime error:&lt;br /&gt;         * VerifyError: Error #1102: Illegal default value for type YesNoEnum.&lt;br /&gt;         *&lt;br /&gt;         * at global$init()&lt;br /&gt;        */&lt;br /&gt;        //private function testEnumDefault(type:YesNoEnum = "yes"):void&lt;br /&gt;      &lt;br /&gt;      &lt;br /&gt;      &lt;br /&gt;        private function testEnumDefault(type:YesNoEnum):void&lt;br /&gt;        {&lt;br /&gt;             trace(type.toString());&lt;br /&gt;        }&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;src.enum.YesNoEnum.as&lt;br /&gt;&lt;pre class="prettyprint"&gt;package src.enum&lt;br /&gt;{&lt;br /&gt;   public final class YesNoEnum&lt;br /&gt;   {&lt;br /&gt;        public static const YES:YesNoEnum = new YesNoEnum("yes");&lt;br /&gt;        public static const NO:YesNoEnum = new YesNoEnum("no");&lt;br /&gt;      &lt;br /&gt;        private var _value:String;&lt;br /&gt;      &lt;br /&gt;        public function YesNoEnum(value:String)&lt;br /&gt;        {&lt;br /&gt;             _value = value;&lt;br /&gt;        }&lt;br /&gt;      &lt;br /&gt;        public function toString():String&lt;br /&gt;        {&lt;br /&gt;             return _value;&lt;br /&gt;        }&lt;br /&gt;      &lt;br /&gt;        public static function fromSring(value:String):YesNoEnum&lt;br /&gt;        {&lt;br /&gt;             switch(value)&lt;br /&gt;             {&lt;br /&gt;                  case "yes":&lt;br /&gt;                       return YesNoEnum.YES;&lt;br /&gt;                       break;&lt;br /&gt;                  case "no":&lt;br /&gt;                       return YesNoEnum.NO;&lt;br /&gt;                       break;&lt;br /&gt;                  default:&lt;br /&gt;                       return null;&lt;br /&gt;             }&lt;br /&gt;           &lt;br /&gt;        }&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4382065257881406250-201011558415320675?l=flexfood.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexfood.blogspot.com/feeds/201011558415320675/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4382065257881406250&amp;postID=201011558415320675' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/201011558415320675'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/201011558415320675'/><link rel='alternate' type='text/html' href='http://flexfood.blogspot.com/2008/04/package-src_29.html' title='Specify a default value for ENUM?'/><author><name>Jason Hanson</name><uri>http://www.blogger.com/profile/17630499518940710366</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4382065257881406250.post-2697587892652019794</id><published>2008-04-24T08:35:00.000-07:00</published><updated>2008-04-24T08:36:10.964-07:00</updated><title type='text'>SWF Encrypt 5.0 Beta Available - ActionScript 3 Encryption</title><content type='html'>&lt;a href="http://www.amayeta.com/company/news/?action=detail&amp;amp;id=6"&gt;http://www.amayeta.com/company/news/?action=detail&amp;amp;id=6&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I have used this software in the past for AS2.  I have been waiting to see if they would come up with a solution for AS3.  It took them a while, but there is a beta out now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4382065257881406250-2697587892652019794?l=flexfood.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexfood.blogspot.com/feeds/2697587892652019794/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4382065257881406250&amp;postID=2697587892652019794' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/2697587892652019794'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/2697587892652019794'/><link rel='alternate' type='text/html' href='http://flexfood.blogspot.com/2008/04/swf-encrypt-50-beta-available.html' title='SWF Encrypt 5.0 Beta Available - ActionScript 3 Encryption'/><author><name>Jason Hanson</name><uri>http://www.blogger.com/profile/17630499518940710366</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4382065257881406250.post-4412117175837363577</id><published>2008-04-18T11:56:00.000-07:00</published><updated>2008-04-18T12:14:29.403-07:00</updated><title type='text'>Flex coding standards docs</title><content type='html'>&lt;span style="font-family:verdana;"&gt;I was a big fan of the old AS2 Best Practices docs (&lt;a href="http://www.adobe.com/devnet/flash/articles/as_bestpractices.html"&gt;http://www.adobe.com/devnet/flash/articles/as_bestpractices.html&lt;/a&gt;) &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;I am glad that Adobe has release standards for AS3/ Flex as well&lt;/span&gt;&lt;br /&gt;&lt;a style="font-family: verdana;" href="http://opensource.adobe.com/wiki/display/flexsdk/Coding+Conventions"&gt;http://opensource.adobe.com/wiki/display/flexsdk/Coding+Conventions&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Whenever I read a document like this (yes I read the whole boring thing), I am always hoping that the the recommended specs match the way I like to code.  While I agree that everyone has their own approach to writing code, I also see the value in standard practices.  I like the code that I write to be a precise example to other devs of the recommended best practices way to code (whether it is Adobe's best practices, my own, or a company I am working for)&lt;br /&gt;&lt;br /&gt;I was surprised to see a few things in this doc.&lt;br /&gt;&lt;br /&gt;1. curly braces formatting&lt;br /&gt;&lt;/span&gt;&lt;p style="font-family: verdana;"&gt;&lt;em&gt;&lt;pre&gt;&lt;br /&gt;if (flag)&lt;br /&gt;   doThing1();&lt;br /&gt;else&lt;br /&gt;   doThing2();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;if (flag)&lt;br /&gt;{&lt;br /&gt;   doThing1();&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;   doThing2();&lt;br /&gt;   doThing3();&lt;br /&gt;}&lt;/pre&gt;&lt;/em&gt;&lt;/p&gt;&lt;p style="font-family: verdana;"&gt;&lt;br /&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;&lt;p style="font-family: arial;"&gt;&lt;em&gt;2.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;&lt;span style="font-family:verdana;"&gt;&lt;blockquote&gt;Event handlers should be named by concatenating “Handler” to the type of the event: mouseDownHandler().&lt;br /&gt;&lt;br /&gt;If the handler is for events dispatched by a subcomponent (i.e., not this), prefix the handler name with the subcomponent name and an underscore: textInput_focusInHandler().&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4382065257881406250-4412117175837363577?l=flexfood.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexfood.blogspot.com/feeds/4412117175837363577/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4382065257881406250&amp;postID=4412117175837363577' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/4412117175837363577'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/4412117175837363577'/><link rel='alternate' type='text/html' href='http://flexfood.blogspot.com/2008/04/flex-coding-standards-docs.html' title='Flex coding standards docs'/><author><name>Jason Hanson</name><uri>http://www.blogger.com/profile/17630499518940710366</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4382065257881406250.post-5892205517497347810</id><published>2008-04-17T15:05:00.000-07:00</published><updated>2008-04-17T15:14:29.130-07:00</updated><title type='text'>Flex 3 Style Explorer | Flex 3 Component Explorer</title><content type='html'>&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:arial;"&gt;Two of my favorite tools have been updated for Flex 3.  These are very handy tools to use while building Flex apps.&lt;br /&gt;&lt;br /&gt;Great app for designing styles for Flex components&lt;br /&gt;&lt;/span&gt;&lt;a href="http://examples.adobe.com/flex3/consulting/styleexplorer/Flex3StyleExplorer.html"&gt;&lt;span style="font-family:arial;"&gt;http://examples.adobe.com/flex3/consulting/styleexplorer/Flex3StyleExplorer.html&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Great app for picking out what components are right the your project&lt;/span&gt;&lt;br /&gt;&lt;a href="http://examples.adobe.com/flex3/componentexplorer/explorer.html"&gt;&lt;span style="font-family:arial;"&gt;http://examples.adobe.com/flex3/componentexplorer/expl&lt;/span&gt;&lt;/a&gt;&lt;a href="http://examples.adobe.com/flex3/componentexplorer/explorer.html" tabindex="10" onclick="return false;"&gt;&lt;span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:100%;"&gt;&lt;a href="http://examples.adobe.com/flex3/componentexplorer/explorer.html"&gt;&lt;span style="font-family:arial;"&gt;orer.html&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4382065257881406250-5892205517497347810?l=flexfood.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexfood.blogspot.com/feeds/5892205517497347810/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4382065257881406250&amp;postID=5892205517497347810' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/5892205517497347810'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/5892205517497347810'/><link rel='alternate' type='text/html' href='http://flexfood.blogspot.com/2008/04/flex-3-style-explorer-flex-3-component.html' title='Flex 3 Style Explorer | Flex 3 Component Explorer'/><author><name>Jason Hanson</name><uri>http://www.blogger.com/profile/17630499518940710366</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4382065257881406250.post-5227112600049635202</id><published>2008-04-17T10:40:00.000-07:00</published><updated>2008-04-29T10:34:35.253-07:00</updated><title type='text'>JSON in Flex 3</title><content type='html'>&lt;span style="font-family:arial;"&gt;I recently was researching consuming JSON feeds in Flex 3 for an upcoming project.  I have not used JSON in the past, and all I really knew about it was that AJAX developers liked the format.&lt;br /&gt;&lt;br /&gt;I ran across this great tutorial on Mike Chambers site from a while back, and it really helped me out.&lt;br /&gt;&lt;a href="http://www.mikechambers.com/blog/2006/03/28/tutorial-using-json-with-flex-2-and-actionscript-3/"&gt;http://www.mikechambers.com/blog/2006/03/28/tutorial-using-json-with-flex-2-and-actionscript-3/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here is basically what I did. &lt;br /&gt;&lt;br /&gt;Get the corelib from google code&lt;br /&gt;&lt;a href="http://code.google.com/p/as3corelib/"&gt;http://code.google.com/p/as3corelib/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here is the JSON feed I was working with in my &lt;span style="font-family: arial;"&gt;tests.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;a style="font-family: arial;" href="http://www.flickr.com/services/feeds/photos_public.gne?tags=flex&amp;amp;format=json" rel="nofollow"&gt;http://www.flickr.com/services/feeds/photos_public.gne?tags=flex&amp;amp;format=json&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;Here is the code to consume the HTTP request&lt;br /&gt;&lt;/span&gt;&lt;pre class="prettyprint"&gt;private var _service:HTTPService;&lt;br /&gt;_service = new HTTPService();&lt;br /&gt;_service.method = "GET";&lt;br /&gt;_service.resultFormat = "text";&lt;br /&gt;_service.requestTimeout = 50000&lt;br /&gt;_service.url = "&lt;a href="http://www.flickr.com/services/feeds/photos_public.gne?tags=flex&amp;amp;format=json" rel="nofollow"&gt;http://www.flickr.com/services/feeds/photos_public.gne&lt;/a&gt;";&lt;br /&gt;&lt;br /&gt;var objParameters:Object = new Object();&lt;br /&gt;objParameters.format = "json";&lt;br /&gt;objParameters.tags = "flex";&lt;br /&gt;_service.send(objParameters);&lt;/pre&gt;&lt;span style="font-family: arial;"&gt;&lt;br /&gt;Here is the code to parse the return.  Notice how I need to rip off the start of the string that is returned from Flickr.&lt;/span&gt;&lt;br /&gt;&lt;pre class="prettyprint"&gt;var photoArr:Array = [];&lt;br /&gt;var rawData:String = String(result.result);&lt;br /&gt;rawData = rawData.split("jsonFlickrFeed(").join("");&lt;br /&gt;var obj:Object = JSON.decode(rawData);&lt;br /&gt;photoArr = (obj.items as Array);&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4382065257881406250-5227112600049635202?l=flexfood.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexfood.blogspot.com/feeds/5227112600049635202/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4382065257881406250&amp;postID=5227112600049635202' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/5227112600049635202'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4382065257881406250/posts/default/5227112600049635202'/><link rel='alternate' type='text/html' href='http://flexfood.blogspot.com/2008/04/json-in-flex-3.html' title='JSON in Flex 3'/><author><name>Jason Hanson</name><uri>http://www.blogger.com/profile/17630499518940710366</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry></feed>
