27 Mar 2011

Getting CouchDB / Couchbase Server and Flash to Play Nice Together

Flash-couchdb
I've dabble with NoSQL technology and I've found CouchDB as a very intriguing place to start. Since I mostly code in Flash I wanted to figure out a way of getting Flash to communication with CouchDB.

I was Googling and came across Todd Anderson's (blog) project on GitHub called, "as3couchdb". My only problem is that I prefer to do almost everything exclusively in Flash. I noticed Todd had an AS3 version in his example projects, but that it requires Flex because of the custom metadata at the time of compiling. So you would get an error like this,

"Error: The CouchModel instance [com.custardbelly.couchdb.example.model::ContactDatabase] must be annotated with [DocumentService] metadata tag."

I found a hack-around, so anyone else wanting to use CouchDB and within the Flash IDE can do so (assuming you have CouchDB running locally already - if not, download Couchbase Server here)...

  1. Simply create a new Flash project
  2. Download Todd's as3couchdb and getting the example BasicActionScriptExample Class under the Properties Panel -> Publish -> Class in the Flash IDE
  3. Go to your Publish Settings, and check the SWC box under Publish (make sure you do this, otherwise you will get this metadata tag error: "Error: The CouchModel instance [com.custardbelly.couchdb.example.model::ContactDatabase] must be annotated with [DocumentService] metadata tag." 
  4. The compile your project... the example should publish and work! How about that for getting started quickly?

If you have any questions feel free to leave a comment. I'm using Flash CS5 and Couchbase Server (CouchDB v 1.0.2) on a Mac.


For those interested in how I found this hack-around:


Images used above curteosy of seokchanyun & mondi

8 Oct 2010

Adobe releases AIR for Android

Aironandroidmarket
I've been a part of the Adobe AIR for Android pre-release program for a few months now. For those aren't familiar with it, it allows Flashdevelopers to build native Android apps using ActionScript 3.0. From experience, it is really ease to re-purpose your desktop AIR applications into mobile Android apps!

Check out these great resources to get started:

31 Aug 2010

Flash & Flex Developer Magazine (September 2010)

(download)

Get the next free edition of Flash & Flex Developer Magazine: AIR for AppUp


Here is a sampling of what is inside...

 

  • Intel Atom Developer Program: Million Dollar Development Fund

    Intel recently released a new App Store specifically for Netbook Apps: Intel AppUp (http://www.appup.com/). Included in this program is a partnership with Adobe (Melrose SDK … NOW in Public Beta!), a Million Dollar Developer Program Accelerator, and the Intel Developer Challenge 2010.


  • NET FRUGALITY

    We Flash and Flex developers and for that matter, anyone developing Web 2.0 content have enjoyed a free ride on the bandwidth bandwagon. While fiber optic vendors have scurried to lay the last mile of our super highway, none of us have paid much attention to the weight of our applications. But that is all soon to change. Resolution be damned, we are all being ushered into the wireless era, and like it or not, the game is changing.


  • Introducing Amethyst

    A Visual Studio user who wants to create a rich internet application (RIA) has, up to now, had only one real choice: Microsoft Silverlight. With the launch of Amethyst, that’s all changed. Amethyst puts a powerful suite of Flash Platform design and coding tools right inside Visual Studio.


  • Onyx-VJ development

    Onyx-VJ is an open source video performance tool based on ActionScript 3 language. The project was started by Daniel HAI back in 2003.


  • Engineering Business Focused Facebook, YouTube, and Twitter Apps

    The avenues for delivering innovative products and services to vast groups of clients are unlimited as internet media platforms evolve, become widely used, and are made more accessible.


  • Monetizing Your Web Game Part 2

    Currently there are many choices when it comes to monetizing a web game. It can be daunting to decide which model is best for a developer.


  • Simple Class Generator for ActionScript 3.0

    Flex 4 containers are not close relatives of Flex 3 Containers. If you want to avoid family feuds, you need to take care of the children. In this article, we’ll find out how.


  • Communicating with the browser

    Sometimes Flash just isn’t enough to get the job done. Often times you might need to communicate with code outside the Flash Player, such as JavaScript in an HTML page.


  • Flex and PHP Mobile

    Mobile is big. The web is big. Services are big. It is no secret that in the past several years the API has become king. Simply accessing a web site is not sufficient any more.


  • Amethyst Puts Flash In Visual Studio But can it compete with Silverlight?
     
  • Adobe Flex 4: Training from the Source Volume 1
     

 

Lee Graham's Posterous

Hi! I'm Lee Graham. I'm a eduGeek, as well as an eLearning Developer for Red Hat, Android FANATIC,  &  eduGeek.


Connect with Lee Graham


DISCLAIMER: The information contained on this site are strictly my personal views and doesn't reflect the views of Red Hat.