04Jan Now=new Year(2010)
As the new decade begins, millions of people reflect on their situation and ponder how to proceed into the future. In many ways, 2009 was a game changer for the multimedia industry. We have seen Unity and the Unreal engine open to their doors to free indie developer licensing. This illustrates that corporations are realizing that even a great multimedia software infrastructure can be shoved aside for lesser alternatives that however have the strong community around its platform.
We have seen also a greater focus on one language compiling to multiple platforms. Adobe is pushing for Flash to compile natively to the iPhone and pushing the Flash player to all other mobile devices. Unity also aims for compiling to PC, Mac, and iPhone with little changes needed to the source. Microsoft continues to push XNA that has the boon of both PC and XBOX360 support. Of course, haXe continues to gain in popularity as it is a single language that translates into other platforms (Flash, PHP, Neko, and C++ SDL).
Over at Bill Sander’s blog AS3 Design Patterns, he talks about his journey into design patterns and that his New Year resolution is “Improve nailing down relationships between classes in design patterns.” This year I have expanded my knowledge of design patterns in areas that I do not normally require in my everyday work, but just learning their existence has given me the enlightenment of not just how the design pattern works but ‘why’ it exists and what would happen to a system built without it.
My personal development New Year’s resolution is: “Learning to prototype quickly while keeping modular using loose coupling.” Being able to produce a skeleton of a system quickly helps to a keep the momentum of a project going and to isolate design flaws. However, rapid development can cause a system to be become stagnate and locked into a certain implementation. However, wise programming decisions like using the acquaintance relationship between classes and employing design patterns like strategy or template will make my prototypes open enough to evolve into the final product without infrastructure rewrites.
Update: While technically the new decade starts in 2011, I find the debate mute as people will refer to this era as the “2010’s“.
15Oct Adobe MAX09 Aftermath

Overall, what we learned at Adobe Max this year was really nothing different than what we already knew months ago almost. Granted, finding out that Flash CS5 can export iPhone apps (perhaps they bundle the player and the flash file together?) was pretty neat- it was not really unexpected. Every cell phone will be getting Flash player soon (including the iPhone with the special export) which will really help increase the hold that Flash Player has on the market. However, there really wasn’t anything other than this announced that was worth getting excited over in my humble opinion. AIR 2.0 is coming out soon, but it’s roster of new features is rather lackluster for a new revision number- it should have been a patch number I believe.
On the flip side, the speakers and show setup were truly aweful. Speakers droned on as if they never bothered writing an outline for themselves, and I felt many ‘novelties’ of the show were tacky (like the canned video of the iPhone app doing the wheel-of-fortune company picker). Even the jokes the speakers used to lighten the content fell so flat that it was as if they were in lue of another joke. Don’t get me wrong, I am definately an Adobe fan boy- I just felt that they put almost no effort into their presentation. Anyone else feel the same way?
27Jul haXe 2.04 – Surprises and Yawns
Over the weekend, we finally had a new release of haXe made available, bringing the current version up to 2.04. The new version mostly is for resolving a slew of obscure bugs; however it also introduces early C++ translation support which is definitely something to keep an eye on. Now we just have to wait till Flash Develop supports the C++ language additions. For the people who have not looked into this language, it worth your time to at least check out as it’s one of the few mature mutliplatform languages available today.
Update: Nicolas Cannasse has a simple example of a C++ compile on his blog.
Changes 2009-07-26: 2.04
- flash9 : fixed get_full_path error with -D fdb
- js : fixed Array.remove on IE
- flash8 : removed extra empty AS3 tag (causing some issue with F8 loadMovie)
- improved speed of Bytes unserializing (no need for BytesBuffer)
- flash9 : bugfix, Null<Typedef> was generating dynamic code
- flash9 : added error message in flash.Vector if used without flash 10
- flash9 : fixed some “never” property access issues
- all : added “never” property access support for all platforms
- js : small syntax fix with value-blocks
- js : fixed Type.enumEq with null values
- js/flash8 : use &0xFF in haxe.io.Bytes.set
- flash9 : fixed switch on Null<Int> verify error
- flash9 : fixes related to UInt type + error when using Int/UInt comparison
- as3 : improved Vector support, inline flash.Lib.as
- as3 : bugfix with skip_constructor
- as3 : added Enum.__constructs__ (allow Type.getEnumConstructs)
- as3 : make all constructor parameters optional (allow Type.createEmptyInstance)
- as3 : bugfix with property access inside setter (stack overflow)
- all : Enum is now Enum<T>
- all : added Type.createEnumIndex
- all : forbid same name for static+instance field (not supported on several platforms)
- all : renamed haxe.Http.request to “requestUrl”
- all : renamed neko.zip.Compress/Uncompress.run to “execute”
- spod : fix very rare issue with relations and transactions
- compiler : added TClosure – optimize closure creation and ease code generation
- cpp : added CPP platform
- all : added ‘using’ syntax
- neko : added ‘domains’ optional param to ThreadRemotingServer to answer policy-file-request
- php : fixed php.db.Mysql so that getResult is consistent with Neko behavior
- php : fixed __toString for anonymouse objects
- php : fixed bug in overridden dynamic functions
- php : fixed round to be consistent with other platforms
- php : fixed bug concatenating two dynamic variables
- php : php.Lib.rethrow now works as expected
- flash9 : fixed bug with SWC output and recursive types
- flash8 : fixed inversed arguments in __new__
- neko : added neko.net.Socket.setFastSend
- php: fixed String.charCodeAt
- php: minor optimization (removed foreach from std code)
- php: implemented haxe.Stack
- php: changed exception handler to use haXe call stack
- php: changed special vars to use the » prefix instead of __
- php: fixed use of reserved keywords for var names
- php: List iterator is now class based (faster)
- php: fixed behavior of class variables having assigned functions
- php: fixed php.db.Manager (was uncorrectly removing superclass fields)
- php: added support for native Iterator and IteratorAggregate interfaces
- all : added –display classes and –display keywords
- all : fixed issue with optional parameters in inline functions
- all : allow implementing interfaces with inline methods
- all : enable inlining for getter/setter/iterator/resolve/using
15Jun FlashMVC 2.0 Released!

I am very pleased to announce a major update to FlashMVC to version 2.0 with its OWN website at www.flashmvc.com! This version is a complete rewrite of the original version with better attention to scalability and framework usage. Since this is a dramatic upgrade, I have changed the package name to com.jadbox.flashmvc2. This version scales much higher allowing actions to relay complex messages to the view and built-in code hinting system for the view to execute an action. This is done by a new class called SuperAction. Let me start with the basics:
- action classes – these are normal classes (do not need to extent any classes) that perform an action
- SuperEvent – this class acts like a model for a specific action class, as a constructor proxy for the action class. and as an event for once the action completes.
- SuperModel – This class holds references to SuperActions which, in turn, hold references to SuperEvents and your action classes.
- SuperAction – This class is a controller proxy between your view and the action that it needs to perform. It allows the user to dispatch a SuperEvent that gets used as a model/constructor for your action class.
Benefits from version 1.0:
- The action has its own model/view (SuperEvent) to inform the view
- The SuperModel has fewer global variables as actions have their own dedicated models
- The model (SuperEvent) also mocks the constructor of the action class for code hinting
- Using the framework with Flash is the same exact flow you would use with Flex (or Flash Builder)
- Much more readable code for applications made with the framework.
- ActionHelper removed in place of SuperEvent
- If an action doesn’t require a unique SuperModel, you can use the base class SuperEvent or make a SuperEvent that covers multiple action classes (less recommended).
Example running an action:
Example reading an action:
function onComplete(event:SuperLogin) { if(event.isInvalidEmail) trace("email was invalid") };
Head over to www.flashmvc.com and check it out!
05May What’s New, Doc?


I have had some people asking me what I have been scheming lately which in honest hasn’t been much. The weather here in Michigan has been finally nice for a change so I have been spending most of my free time cycling. However, I did go out last weekend and finally bought the fabulous Gang of Four book Design Patterns to add to my library. I know enough C++, JAVA, and Smalltalk to decipher the examples and apply it to whatever language I might be using these days (which has been lots of AS3, haXe, C#, and Unity3D). I also decided to join the tablet bandwagon and added a Wacom Bamboo to my collection in hopes that it will inspire me to work on my art portfolio that I have been neglecting. The surface really feels (and sounds) like you are drawing on paper!
In the next coming weeks I will be working on FlashMVC to do some cleanup and perhaps add more examples to the repository.
Lastly, I have been experimenting on AI development with local unit world data deresolution and querying. Such a system I am building will allow NPCs to explore large environments while meta tagging locations of interests for latter lookups. Usually this isn’t as complicated as the process I am developing, but I have to design something that is agile and performs well in the Flash player environment. I will blog more about this soon most likely.
O, and thank you to the people who came to my lecture on design patterns last week! I hope everyone was able to walk away with some practical knowledge to apply to their own projects. There is a good chance that I might continue this lecture in the future to dive deeper into a variety of AS3-applicable development pattens. The video camera we had in the room had some issues (we lost the second half of the lecture), but I hope to get the recording compressed and posted here soon.
27Apr Detroit Design Patterns Lecture pt. 2
This Thursday, April 30th, I will be continuing my lecture on Actionscript design patterns and principles at the Detroit Adobe User’s Group meetup. See the first lecture post here for directions and time information. This week I will be covering different mainstream design patterns in detail and if we have time give a brief overview of popular MVC frameworks that help accelerate application development. However, I do believe that teaching patterns and frameworks without knowing good object oriented principles is fruitless so I will also continue this topic discussion into the next portion of the lecture.
The conference is free to attend, and anyone from beginners to experts are welcome to join!
07Apr FlashMVC Update: addResultListeners
I have just finished up making another addition to my framework FlashMVC. The update effectively removes the need to use ActionBinder as I will indicate below. ActionBinder was a neat utility, but ultimately I wanted solution that was just as simplistic but could be usable for both Flash and Flex. I couldn’t find any easy solutions until I thought about retrofitting addEventListener with an alternate form to allow callback functions to fire for specific commands on the SuperModel. Hence, I have added these three new methods to SuperModel:
.addResultListeners(actionName:String, onSuccess:Function, onFail:Function)
.addStatusListeners(actionName:String, enabled:Function, disabled:Function)
.addHasActionListeners(actionName:String, added:Function, removed:Function)
Now in your view, you can do something like this in your view:
app.addResultListeners(MySuperApplication.Login, onSuccess, onFail);
// SuperModel.perform(name of the action, optional onComplete function, ...Rest for the parameters of the action class)
app.perform(MySuperApplication.Login, null, "test@invalidemail@.com");
function onSuccess(result:*):void {
trace("Login was successful");
}
function onFail(result:*):void {
if(result==MySuperApplication.RESULT_INVALID_EMAIL)
trace("invalid email used");
}
Aside from this addition, I added in some safeguards like throwing an error if a command tries to call ActionHelper.complete() more than once as well as some other fixes. ActionBinder is still useful in the Flex world as it can help increase readability in some cases, but SuperModel now has most of the nice features built into it.
Please let me know if you have any comments! I am still working on adding in the replay feature to the framework which hopefully I will have done soon.
27Mar Further Reading on Design Patterns
As a followup on my Wednesday lecture on design patterns, I wanted to post some informative resources for learning more about design patterns outside the next lecture on the topic. Also, I wanted to say thanks for everyone who showed up to hear me rant about code structure (not the most exciting topic in the world mind you)!
Design Pattern Definition
In software engineering, a design pattern is a general reusable solution to a commonly occurring problem in software design. A design pattern is not a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that can be used in many different situations. Object-oriented design patterns typically show relationships and interactions between classes or objects, without specifying the final application classes or objects that are involved.
- read more at WikiPedia
MVC Definition (the most common principle of Design Patterns)

“Model–View–Controller (MVC) is an architectural pattern used in software engineering. Successful use of the pattern isolates business logic from user interface considerations, resulting in an application where it is easier to modify either the visual appearance of the application or the underlying business rules without affecting the other. In MVC, the model represents the information (the data) of the application; the view corresponds to elements of the user interface such as text, checkbox items, and so forth; and the controller manages the communication of data and the business rules used to manipulate the data to and from the model.”
- read more at WikiPedia
Books:
- Gang of Four’s original Design Patterns
- Advanced ActionScript 3 with Design Patterns (highly recommended)
- ActionScript 3.0 Design Patterns: Object Oriented Programming Techniques
AS3 Design Pattern Informational Websites:
- www.as3dp.com – ActionScript 3 Design Pattern Blog (Principles Category)
- ntt.cc posts on of porting GoF design patterns to AS3
Flash Design Pattern Frameworks:
(for now, it’s best to avoid these until you understand the fundamentals of MVC)
Good Design Priniciples:
- ALWAYS type your variables (not really design principle but I too often see people doing this still)
- An object/MovieClip should contain the actions that it performs (as oppose to objects outside the class forcing it to perform actions)
- A class should never be able to “break” if the user sets a property or calls a function on it when they are not suppose to. Keep preventive logic in the class that’s doing the work.
- A good chosen design pattern for a problem will not take any longer to implement than not using it with spaghetti code.
Feel free to leave comments or email me about any further questions you have about Design Patterns or where to find additional materials on it. Have a great weekend everyone!
25Mar Detroit Design Pattern Seminar

On Thursday 3/26/2009, I will be giving an open seminar on design patterns for the Detroit Adobe User Group. I should have blogged about this much earlier but my free time has been spread thin of late unfortunately. It will be hosted at ePrize starting at 7:00pm and ending about 9:00pm. I will be covering just some introductory topics of good programming practices with AS3 while diving into some design pattern concepts. There is also a good chance that I will do a more advanced seminar on design patterns in the near future at the user group meetings. This conference will be free to the public so please leave a comment or shoot me an email for directions or more information.
-[ Jonathan_Dunlap::email="jonathan AT jadbox.com" ]-

