Looking at the world of media: from music to RIA.

VivMedia Code Library: Version 0.03 released

July 19th, 2008 Posted in ActionScript, Distribution, Flash Player, Flex Development, Rich Internet Applications, Self Reference, web 2.0, web integration | Comments

rune_flash.gifI pushed a new version of the library yesterday to Google Code. This is a relatively small release, which was not really my intention for version 0.03. Originally, I was planning on adding the first of a series of really powerful features but due to unit testing the new Queue (48 new tests), this kind of slowed down progress. Oh, that and a TON of client deadlines. Anyway, there are two updates in this version: The Queue and new source code licensing.

I read a great analysis article by Grant Skinner, talking about the different Open Source licenses and how they can affect you and your client. I originally licensed the code library under the Mozilla Public License (MPL) due to its popularity, its freedom to allow developers to build on top of the code base for any purpose (free or for charge) and only requires code modification submission if the developer changed the original code in the library. My goal with VivMedia is to help developers build great applications, and the last thing I wanted to do is limit them, yet I do want to encourage people to submit changes and updates. That is why I went with MPL at first.

The issue with MPL (as Grant points out) is that when you use MPL code there are certain steps you need to take to release your project. In most cases this is not a big deal and it very rarely impacts the project but it may cause some developers or their clients a bit of grief. In all honesty, I just want to create a library that myself and others can use without having to jump through hoops with our clients. This lead me to change all the code license to MIT, which is very permissive of all forms of development. All you need to do is keep the MIT license headers in the source. You don’t have to submit changes (all thought I would be very happy if you did) and you don’t have to jump through any other legal hoops when deploying. So, if you are using the library already, update to the new version and know that the door is now wide open and you don’t have to fret about how you or your clients release the work.

The other addition to this version is the new Queue data structure. The Queue allows you to add and remove items is in a linear fashion. You can define the Queue as either Last in First Out (LIFO) or First in First Out (FIFO). What that means is when you add() item A and item B to the Queue and then call next(), the item returned is dependent if the queue is set to LIFO or FIFO. A LIFO Queue returns item B, since it was the last item added. A FIFO Queue returns item A since it was the first item added. As always, a full tutorial will be posted soon on how to use the Queue in your code.

The Queue is a building block for a lot of new functionality that I am starting to plan out. There will probably be variations of the Queue going forward too. For example a version that is designed to help solve Asynchronous issues in a Synchronous fashion, without you having to write a lot of logic around the actions. Right now, its all about what time permits… and as I said in the last post, vacation is nearly here! So, update/download the library, check out the ASDocs in the source (I always update them for each release) and let me know what you all think.

Posting slowing down for a bit…

July 14th, 2008 Posted in General Media / Stuff, Self Reference | Comments

Hi All, its been a while since I wrote a “fireside chat” post and this is a good as time as any. Some of you may have noticed my posting has slowed down a bit over the last month or so. This is due to a ton of client work and paying work always takes precedent over blogging, sorry peeps. The good news is I have a lot of client work, the bad new is I have a lot of client work. On top of that, I am currently in a frantic push to get things wrapped up before I head out for a nice long vacation.

Hopefully, when I get back and settled in I will have a few more cycles to sit down and write, although looking at my calender and what is planned this may be tough. There are some big plans for this fall and I can’t wait to start talking about them but for now its heads down and work, work, work.

VivMedia Code: Selection Controller

July 3rd, 2008 Posted in ActionScript, Flash Player, Flex Development, Rich Internet Applications | Comments

rune_flash.gifWith the previous release of version 0.02 of the code base I added a new class called the SelectionController that enables you to treat items that implement the ISelectable interface as a selection group. As promised, this is the tutorial/indepth examples of the SelectionController and how to use it within your applications.

Read the rest of this entry »

Adobe kuler Desktop Sneak Peek

July 1st, 2008 Posted in Adobe APIs, Flash Player, Rich Internet Applications, kuler, web 2.0, web integration | Comments

Adobe kuler IconA new version of Adobe kuler desktop is now here and ready for you download! Recently, I have been providing Flash and AIR development for the wonderful people in Adobe’s Emerging Creative Technologies (ECT) team and I wanted to share some of the cool things that have gone into the new kuler release. In case you don’t know, Adobe kuler Desktop is an Adobe AIR based application that allows users to access both community and custom created themes from the Adobe kuler website. Back in March, I blogged about the latest version of the kuler website and the initial launch of the AIR version. Pop over here if you want to read a bit more about kuler or continue on to learn about what’s new in kuler Desktop…

Read the rest of this entry »

Adobe Edge Article: Coding Standards

June 14th, 2008 Posted in ActionScript, Flex Development, General Media / Stuff, Rich Internet Applications, Self Reference, web 2.0, web integration | Comments

Adobe EdgeA few months ago I was asked to write an article for the Adobe Edge Newsletter on a topic of my choosing. After spending a bit of time thinking about what moved me at the moment, I decided to sit down and write about the need for RIA and web app developers to invest time into research, development and adoption of code standards. This week, the article “Coding standards: What are they and why should you use them?” went live and I want to share the link with everyone.

One of the challenges of writing an article like this is first defining your audience and then determining how to cover the topic in the alloted text. The Edge sets a word count guideline and this limits how deep I could or in this case could not go. Personally, I fully support the word count guide because this both focuses the topic and generates more digestible articles. Yet, on a topic as broad and as deep as this one I had to focus more on an introductory guide to coding standards and adoption.

The second challenge is determining your audience. My goal was to create an article that worked for both readers who have never heard of coding standards, and readers that have been using them for years. I always try to create a broad stripe across my reader base because I want to inform as many people as possible. This thought process was kind of beaten into me during my years as a Technical Support rep and team-lead at Macromedia. There is nothing like having to write Tech-notes and email support to teach you how to write to a broad audience.

The main point I wanted to get across with this article is that coding standards are actually much more then just code formating. Code formatting, or code conventions, really focus on how you name variables, methods, classes, etc. Yet, this is just the tip of the coding standards iceberg. One of the least discussed aspects of coding standards is the adoption and implementation practice of code design patterns. As developers, we need to better understand how adoption of patterns, frameworks and micro-architectures help structure our code. Not only do they provided rapid development but they also help guide us into a more structured development process.

As RIA and web application development expands we are seeing a demand for much more complex and scalable applications. Scalability is not just about user load but includes further expansion of features and performance over time. More and more developers are being asked to create applications that have a lifespan longer then just a few months. Some people may gaffe at that comment, but if you look at a lot of “rich” applications up to this point, most have been for marketing campaigns and advertising. The nature of these kinds of projects do not focus on lifespan and version updates. Their focus is on making them work in a short time to meet the marketing deadline and then get them out the door.

With the trend of Web 2.0 (which I hate as a term), the web world is quickly being pushed into the long standing Desktop Software model. This is forcing a lot of us to re-evaluate how we design and develop our online enabled applications. This is a scary yet wonderful time in our industry as we are rapidly adopting and developing new ways of web application design and construction. Due to this push I feel its time to help expose more of us to coding standards. My article is more a call to arms then a definitive guide to coding standards implementation. If you are interested, take a read and add your thoughts to the comments…

VivMedia Code Library: Version 0.02 Released

June 6th, 2008 Posted in ActionScript, Flash Player, Flex Development, Rich Internet Applications | Comments

rune_flash.gifIts been a busy few weeks for me (with work and personal projects) but I am happy to say that version 0.02 of the VivMedia library is now available. This update includes a fully automated Unit Test suite for all the code except the Local Connection Manager. Trying to automate the LCM is going to be coding feat in itself, so right now it is being tested the old fashioned way a.k.a. by hand. There are a few minor updates to the existing code such as streamlining how the HashTable clones the internal Array and some other minor updates to support automated testing. As usual the code is fully ASDoced and generated docs are available with the ZIP download.

The big change is this version is the addition of the new SelectionController and ISelectable interface. The SelectionController is a manager that allows you to group any number of items that implement the ISelectable interface and then treat them as a Radio Group or multi-selectable group. With the controller you assign items to groups and then you can use the controller to select and deselect the items.

A great example of this code is how I handle image highlighting in the Photoslider. Each of my image thumbnails implement ISelectable and then when a user clicks a thumb it calls the SelectionController.selectItem() and passes itself as an argument. The SelectionController then sets selected on all the thumbnails in the group, setting true for the passed in item and false for the rest. I plan on doing a full tutorial in the near future so keep an eye out for it. Enjoy!

Was Amazon.com hacked? [update: probably not]

June 5th, 2008 Posted in General Media / Stuff, web integration | Comments

Amazon LogoUpdate: After further scrutiny it looks like the DNS whois was read wrong by us and we all jumped to conclusions. The response back was any domain with Amazon.com in the name. If you look at the last one then you can see all is on the up and up. So it probably is just a bad update… we shall see what is mentioned later.


Today’s big news in the tech industry was Amazon.com’s US outage. If you haven’t heard about it Amazon.com US, went down at 10:27am PST on June 6th:

An Amazon spokesperson said this afternoon, “Amazon’s systems are very complex and on rare occasions, despite our best efforts they may experience problems. We work to minimize any disruption and to get the site back as quickly as possible.”
Amazon’s Web Site Goes Down: An ‘Unplanned Event’ on New York Times Bits by Brad Stone

But what is the real cause of this? Some sys admin friends of mine where trying to shop at Amazon when it went down. Being what they are they took a peek under the hood and it looks like the DNS was hacked. When a whois was run on Amazon.com this is what was returned at 11:20am PST:

$ whois amazon.com

Whois Server Version 2.0

Domain names in the .com and .net domains can now be registered with many different competing registrars. Go to http://www.internic.net for detailed information.

Server Name: AMAZON.COM.ZZZZZ.GET.LAID.AT.WWW.SWINGINGCOMMUNITY.COM
IP Address: 69.41.185.219
Registrar: INNERWISE, INC. D/B/A ITSYOURDOMAIN.COM
Whois Server: whois.itsyourdomain.com
Referral URL: http://www.itsyourdomain.com

Server Name: AMAZON.COM.MORE.INFO.AT.WWW.BEYONDWHOIS.COM
IP Address: 203.36.226.2
Registrar: TUCOWS INC.
Whois Server: whois.tucows.com
Referral URL: http://domainhelp.opensrs.net

Server Name: AMAZON.COM.IS.N0T.AS.1337.AS.WWW.GULLI.COM
IP Address: 80.190.192.24
Registrar: EPAG DOMAINSERVICES GMBH
Whois Server: whois.enterprice.net
Referral URL: http://www.enterprice.net

Domain Name: AMAZON.COM
Registrar: NETWORK SOLUTIONS, LLC.
Whois Server: whois.networksolutions.com
Referral URL: http://www.networksolutions.com
Name Server: UDNS1.ULTRADNS.NET
Name Server: UDNS2.ULTRADNS.NET
Status: clientDeleteProhibited
Status: clientTransferProhibited
Status: clientUpdateProhibited
Updated Date: 28-mar-2008
Creation Date: 01-nov-1994
Expiration Date: 31-oct-2017

Last update of whois database: Fri, 06 Jun 2008 14:15:03 EDT

This just reeks of the same thing that happened to Comcast. If you read the full article at Wired, the hack sounds exactly the same. It will be interesting to see what Amazon has to say once the dust settles…

The Extendable Singleton Pattern

June 5th, 2008 Posted in ActionScript, Flex Development, Rich Internet Applications | Comments

rune_flash.gifThe Singleton pattern is one of my favorite little patterns that can be used in any language that provides static typed properties/methods. There are many different uses of the Singleton and just as many ways to implement them within code. In this post I am going to first introduce the basic Singleton pattern, explore how it is most often defined in ActionScript (including tips on protecting the Singleton instance), then talk about how to create an extendable Singleton and why on earth you would want to. If you already know the principles of Singletons, skip ahead to the second section of this post “Defining Singletons in ActionScript”.

Read the rest of this entry »

VivMedia Code: the HashTable

May 29th, 2008 Posted in ActionScript, Flash Player, Flex Development, Rich Internet Applications | Comments

rune_flash.gifOne of my favorite, and until recently, most used classes in Flex was the ArrayCollection. The ArrayCollection is a powerful data-structure that acts similarly to an Array but provides an extended API that provide shortcuts to data access. A few of the more used accessors are contains(), which tells you if the item is in the ArrayCollection and getItemIndex() which tells you where the item is in the ArrayCollection.

The ArrayCollection is much more then this too. It also has the ability to tie directly into FlexData services and then dynamically page the data into the ArrayCollection instance as data is requested. The ArrayCollection is also the complex data structure that is generated by the HTTPService (when parse to Object is set) if you have more then one child node in an XML structure. If you haven’t used it yet, the ArrayCollection is a very powerful data-structure.

Of course, with this robustness comes limitations. First off, its Flex only. This means that if you are used to Flex development but find yourself on an AS3 only project, you can’t use the ArrayCollection. Another big one is performance. As you begin filling the ArrayCollection up, queries into the data structure start to slow down, and I mean significantly slow down. If you have hundreds of objects in the ArrayCollection, the performance for lookup and access are way slower then just looping over an array and finding it the old fashioned way. A more minor issue is when trying to manipulate data dynamically you start having to write some pretty ugly code such as to prevent null reference errors:

// remove the item if it exists
if(myCollection.contains(objectNeeded))
{
	myCollection.removedItemAt(myCollection.getItemIndex(objectNeeded));
}

Its not that bad, but as you get more and more complex accessing structures you start longing for the simplicity of an Array. This is where the HashTable came into the picture. I wanted something that performs like an Array, yet has the API data accessors that can simplify development. Yet, there was one more thing that I wanted, the ability to map key’s to values like in an object or Dictionary but still maintain Array like access.

From this need came the HashTable. In the past I had built multiple solutions similar to the HashTable but they typically where one-offs that lived in the code the functionality was needed. I never got around to formalizing it into a proper data-structure. I finally got the chance and built it from the ground up for my Photoslider app. So, let’s talk about the HashTable…

Read the rest of this entry »

VivMedia Code: The EventBroker

May 26th, 2008 Posted in ActionScript, Flex Development, Rich Internet Applications | Comments

rune_flash.gifThe EventBroker, in the Vivisecting Media Library, is an Flash Event routing utility that can be used in any ActionScript 3.0 or a Flex Project. The code was developed to be SDK independent so that it does not rely on any Flex classes. The EventBroker is designed to solve the challenge of passing Events to objects that may not be aware of the dispatching item or are not within the parent/child hierarchy of the Event bubble system. In this post I will discuss the Flash Event Model, what limitations are part of the Event Model, how the EventBroker resolves these issues and considerations when using the EventBroker.

Read the rest of this entry »