6 Adobe AIR ActionScript APIs explored, first up File System Access

Adobe AIR ActionScript APITed Patrick recently visited San Diego and gave a presentation for the upcoming release of Flex Builder 3.0 and AIR 1.0. One thing that
stood out was the slideshow that Ted used during his presentation. One important screen that jumped out at me was the Adobe AIR Application Stack. The 6 Adobe AIR APIs in this diagram seemed like they would make a good blog series. Here are the APIs from the slide:

  • File System Access
  • Network Detection
  • Notifications
  • Application Update
  • Drag and Drop
  • Local Database

The first code example is for File System Access. The next code example will be Network Detection.

Here is the source code that is used to open and read a .txt file with Adobe AIR. Note: this is a simple example created using the “Developing AIR Applications with Adobe Flex 3″ online manual. This manual is a GREAT resource and I highly recommend using it.

Adobe AIR: File System Access
Example Code:


<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"
  layout="absolute"
  creationComplete="init();">
  <mx:Script>
    <![CDATA[

      private var file : File;
      private var fileStream : FileStream;
      private var fileContents : String;
      private const ISO_CS : String = "iso-8859-1";

      private function init() : void
      {
        file = new File();
        file = File.applicationDirectory.resolvePath("file.txt");
        fileStream = new FileStream();
        fileStream.addEventListener( Event.COMPLETE, fileComplete );
        fileStream.openAsync( file, FileMode.READ );
      }
      private function fileComplete( event : Event ):void
      {
        fileContents = fileStream.readMultiByte( fileStream.bytesAvailable, ISO_CS );
        trace( "fileContents="+fileContents );
      }
    ]]>
  </mx:Script>
</mx:WindowedApplication>

42 tech items for Flex Developers to research, study and watch in 2008

Adobe AIR, Adobe Flex, Adobe Thermo, Adobe Astro

2007 was an AWESOME year for Flex and AIR. 2008 should continue this trend. Here are several different technologies and other items I plan on monitoring going into 2008. Some of these are bleeding edge, others are fundamentals which we’ve been studying for years.

“I’m sure that Flex skills will be one of the hottest skills to have in 2008.” - Yakov Fain

ActionScript 3.0
Essential ActionScript 3.0
Personally I plan on digging into the nitty-gritty details of the language. This includes refining knowledge of Errors, Events, Exceptions, Interfaces, Bitmap API, Display API and Namespaces to name a few. I’ll be reading Essential ActionScript 3.0 to do so.

Adobe AIR
http://labs.adobe.com/technologies/air/
The first full release of AIR should be coming in 2008. With the rapid growth and massive interest already I cannot even speculate what 08 will bring for this exciting, young technology.

Adobe Astro
http://labs.adobe.com/wiki/index.php/Astro
“The next major release of Flash Player, codename “Astro,” was first previewed at Adobe MAX 2007. The preview highlighted a few of the new capabilities the Flash Player team is working on for Astro: advanced text layout, simple 3D effects, and custom filters, blend modes and effects.”

Adobe BlazeDS
http://labs.adobe.com/technologies/blazeds/
http://livedocs.adobe.com/labs/blazeds/html/index.html
“BlazeDS is the server-based Java remoting and web messaging technology that enables developers to easily connect to back-end distributed data and push data in real-time to Adobe® Flexâ„¢ and Adobe AIRâ„¢ applications for more responsive rich Internet application (RIA) experiences.”

API’s
http://programmableweb.com/apis/directory/1?sort=date
I always keep an eye on this area of Programmable Web for new ideas for applications and mashups.

ASDoc
Using ASDoc
“ASDoc is a command-line tool that you can use to create API language reference documentation as HTML pages from the classes in your Flex application. The Adobe Flex team uses the ASDoc tool to generate the Adobe Flex 2 Language Reference.”

Brain-computer interface
http://en.wikipedia.org/wiki/Brain-computer_interfaces
http://www.techrivet.com/2007/07/23/NeuroSkyMovingBeyondConceptBCI.aspx
“brain-computer interface (BCI), sometimes called a direct neural interface or a brain-machine interface, is a direct communication pathway between a human or animal brain (or brain cell culture) and an external device.” The WII in Flash was cool, let’s see one of these plugged into the Flash Platform!!!

Cairngorm
http://labs.adobe.com/wiki/index.php/Cairngorm
http://www.cairngormdocs.org/
“The Cairngorm Microarchitecture is a lightweight yet prescriptive framework for rich Internet application (RIA) development.”

Cloud Computing
http://tnerd.com/2007/10/14/cloud-computing-the-next-big-thing-is-cloud/
Cloud_computing_wp_final_8Oct.pdf
“is a computing paradigm shift where computing is moved away from personal computers or an individual server to a “cloud” of computers. Users of the cloud only need to be concerned with the computing service being asked for, as the underlying details of how it’s achieved are hidden”

Design Patterns
http://www.javacamp.org/designPattern/
http://www.exciton.cs.rice.edu/JAvaResources/DesignPatterns/default.htm
ActionScript 3.0 Design Patterns: Object Oriented Programming Techniques
“In software engineering, a design pattern is a general repeatable 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”

E4X
http://www.adobe.com/devnet/flex/articles/training_e4x.html
http://www.ecma-international.org/publications/standards/Ecma-357.htm
E4X: A new approach to XML processing
http://www.w3schools.com/e4x/default.asp
“E4X offers a natural, fluent set of language constructs for manipulating XML. In contrast to traditional XML-parsing APIs, XML with E4X performs like a native data type of the language. E4X streamlines the development of applications that manipulate XML by drastically reducing the amount of code needed.”

EcmaScript 4.0
http://www.ecmascript.org/
http://www.ecmascript.org/es4/spec/evolutionary-programming-tutorial.pdf
Microsoft trying to derail ECMAScript 4?
“ECMA-262 Edition 4 is the next-generation version of ECMAScript being developed currently by the ECMA TG1 working group.” This space is heating up, keep a watch on this one I have a feeling this is going to shape the future of the web in major ways.

Flash Media Server
http://www.adobe.com/products/flashmediaserver
“an enterprise-grade data and media server from Adobe Systems Inc. This server works together with the Flash Player runtime to create media driven, multiuser RIA’s.”

Flex 3 & Flex 4
http://labs.adobe.com/technologies/flex/
Keep an eye on Adobe Labs. Flex 3 will be coming out in 2008 and who knows we may even see at least some more talk about or get to provide additional input on the future of Flex.

Flex Custom Components
http://www.adobe.com/devnet/flex/articles/creating_components.html
Flex Component Kit Alpha for Flex 2.0.1
http://www.adobe.com/devnet/flash/articles/creating_as3_components.html
I think creating custom components for Flex is going to increase in demand in 2008.

Flex Performance and Memory Profiling
Performance and Memory Profiling
“Memory profiling lets you look at objects being created, take snapshots and compare them. Performance profiling allows snapshots for looking at cumulative and internal time.”

Flex Persistent Framework Caching
http://weblogs.macromedia.com/jd/archives/2007/08/player_update_p.cfm

Flex Refactoring
http://labs.adobe.com/technologies/flex/videos/refactoringdemo/

Flex Skinning
http://www.adobe.com/devnet/flex/articles/flex_skins.html
http://www.scalenine.com/resources.html
“If you want to redesign the appearance of the Flex components more radically, you can do so by creating a new set of skins for the Flex components that completely replace the built-in Halo Aeon theme.”

Hibernate
http://www.hibernate.org/
“Hibernate is a powerful, high performance object/relational persistence and query service. Hibernate lets you develop persistent classes following object-oriented idiom - including association, inheritance, polymorphism, composition, and collections.”

Hydra / Adobe Image Foundation
http://labs.adobe.com/wiki/index.php/AIF_Toolkit
“The Adobe Image Foundation (AIF) Toolkit preview release includes a high-performance graphics programming language that Adobe is developing for image processing, codenamed Hydra, and an application to create, compile and preview Hydra filters and effects.”

Java 7
https://jdk7.dev.java.net/
http://today.java.net/pub/a/today/2007/08/09/looking-ahead-to-java-7.html

Java 6
http://www.sun.com/training/catalog/courses/WJB-110A.xml
http://www.sun.com/training/catalog/courses/SL-275-SE6.xml
http://www.sun.com/training/catalog/courses/CX-310-065.xml
Here are a few links with training recommended for Java certification. Might be something to think about for the future.

JavaFX
http://www.sun.com/software/javafx/index.jsp
“The JavaFX product family delivers the ability to create interactive content, applications and services from the desktop to mobile devices to the living room.”

Microformats
http://microformats.org/
“Designed for humans first and machines second, microformats are a set of simple, open data formats built upon existing and widely adopted standards.” Microformats are being used in conjunction with Adobe AIR.

Occasionally Connected Apps
Monitoring network connectivity
One of the draws to using Adobe AIR is the ability to monitor network connectivity. This is one area I want to work with and research a bit more in 2008.

OOP
http://www.friendsofed.com/book.html?isbn=1590598458
http://www.adobe.com/devnet/actionscript/articles/oop_as3.html
“Object-oriented programming (OOP) is a programming paradigm that uses “objects” and their interactions to design applications and computer programs. It is based on several techniques, including encapsulation, modularity, polymorphism, and inheritance. It was not commonly used in mainstream software application development until the early 1990s. Many modern programming languages now support OOP.”

Papervision 2.0
http://blog.papervision3d.org/
http://papervision3d.googlecode.com/svn/trunk
http://blog.zupko.info/?p=76
“Features: Faster! ShadeMaterials, Shaders, ASCollada (animation support), Frustrum Culling, Multiple Viewports, Render to Scene and more. More features expected soon.”

Prisim
http://labs.mozilla.com/2007/10/prism/
“Unlike Adobe AIR and Microsoft Silverlight, we’re not building a proprietary platform to replace the web. We think the web is a powerful and open platform for this sort of innovation, so our goal is to identify and facilitate the development of enhancements that bring the advantages of desktop apps to the web platform.”

Refactoring
http://www.refactoring.com/
“Refactoring is a disciplined technique for restructuring an existing body of code, altering its internal structure without changing its external behavior. Its heart is a series of small behavior preserving transformations. Each transformation (called a ‘refactoring’) does little, but a sequence of transformations can produce a significant restructuring.”

Spring
http://www.springframework.org/
http://www.theserverside.com/tt/articles/article.tss?l=IntrotoSpring25
“The Spring Framework is probably best known for offering features required to effectively create complex business applications outside of the programming models that historically have been dominant in the industry. Next to that it is also credited for introducing previously unfamiliar functionalities into today’s mainstream development practices, even beyond the Java platform.”

SQLite
http://www.sqlite.org/
http://sqlitebrowser.sourceforge.net/
“SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine.” This is used in google gears and Adobe AIR. Firefox also uses SQLite.

Struts
http://struts.apache.org/
“An open source framework for building Servlet/JSP based web applications based on the Model-View-Controller (MVC) design paradigm.”

Subversion
http://subversion.tigris.org/
http://svnbook.red-bean.com/
http://svnbook.red-bean.com/en/1.4/svn-book.pdf
“Subversion (SVN) is a version control system initiated in 2000 by CollabNet Inc. It allows users to keep track of changes made to any type of electronic data, typically source code, web pages or design documents.”

Surface Computing
http://www.microsoft.com/surface/
“Surface computing is the use of a specialized computer GUI in which traditional GUI elements are replaced by intuitive, everyday objects. Instead of a keyboard and mouse, the user interacts directly with a touch-sensitive screen, replicating the familiar hands-on experience of everyday object manipulation.”

Swing
Java Swing By Marc Loy
http://java.sun.com/docs/books/tutorial/uiswing/
“Swing is a widget toolkit for Java. It is part of Sun Microsystems’ Java Foundation Classes (JFC) — an API for providing a graphical user interface (GUI) for Java programs. Swing includes GUI widgets such as text boxes, buttons, split-panes, and tables.”

Thermo
http://labs.adobe.com/wiki/index.php/Thermo
“Thermo” is an upcoming Adobe product that makes it easy for designers to create rich Internet application UIs. Thermo allows designers to build on familiar workflows to visually create working applications that easily flow into production and development.

Technological singularity
http://en.wikipedia.org/wiki/Technological_singularity
“There is no clear definition, but usually the Singularity is meant as a future time when societal, scientific and economic change is so fast we cannot even imagine what will happen from our present perspective, and when humanity will become posthumanity.”

TouchLib
http://www.whitenoiseaudio.com/touchlib/
“Touchlib is our library for creating multi-touch interaction surfaces. It handles tracking blobs of infrared light for you and sends your programs multitouch events, such as ‘finger down’, ‘finger moved’, and ‘finger released’. It includes a configuration app and a few demos to get you started. It interaces with most major types of webcams and video capture devices”

UML
http://www.uml.org
http://en.wikipedia.org/wiki/Unified_Modeling_Language
“In the field of software engineering, the Unified Modeling Language (UML) is a standardized specification language for object modeling. UML is a general-purpose modeling language that includes a graphical notation used to create an abstract model of a system, referred to as a UML model.”

Unit Testing
http://code.google.com/p/as3flexunitlib/
http://www.adobe.com/devnet/flex/articles/unit_testing.html
“Unit testing is a procedure used to validate that individual units of source code are working properly. A unit is the smallest testable part of an application. In procedural programming a unit may be an individual program, function, procedure, etc., while in object-oriented programming, the smallest unit is a method; which may belong to a base/super class, abstract class or derived/child class.”

WebKit
http://webkit.org/
http://webkit.org/blog/
“WebKit is an open source web browser engine.” This is the browser used within Adobe AIR.

Software Development Podcasts: Design Patterns, Unit Testing, Architecture, Refactoring

Software Architecture Podcast

Here are a number of podcasts regarding software development. All of these topics are valid for Flex development. Enjoy!

Refactoring Pt. 2
http://media.libsyn.com/media/seradio/seradio-episode55-refactoring_pt2.mp3

Design By Contract
http://media.libsyn.com/media/seradio/seradio-episode51-designByContract.mp3

Architecture Patterns (Architecture Pt. 4)
http://media.libsyn.com/media/seradio/seradio-episode41-architecture_pt4.mp3

Refactoring Pt. 1
http://media.libsyn.com/media/seradio/seradio-episode46-refactoring_pt1.mp3

Dynamic Languages for Static Minds
http://media.libsyn.com/media/seradio/seradio-episode49-dynamicLanguages.mp3

Architecture Pt.3
http://media.libsyn.com/media/seradio/seradio-episode30-architecture_pt3.mp3

Architecture Pt. 2
http://media.libsyn.com/media/seradio/seradio-episode25-architecture_pt2.mp3

Development Processes Pt.1
http://media.libsyn.com/media/seradio/seradio-episode24-developmentProcesses_pt1.mp3

Architecture Pt. 1
http://media.libsyn.com/media/seradio/seradio-episode23-architecture_pt1.mp3

Service Oriented Architecture Pt.1
http://media.libsyn.com/media/seradio/seradio-episode27-soa_pt1.mp3

Error Handling

http://media.libsyn.com/media/seradio/seradio-episode7-errorhandling.mp3

Scripting Languages
http://media.libsyn.com/media/seradio/seradio-episode4-scriptingLanguages.mp3

Dependencies
http://media.libsyn.com/media/seradio/seradio-episode2-dependencies.mp3

Patterns
http://media.libsyn.com/media/seradio/seradio-episode1-patterns.mp3

Design Patterns
http://media.libsyn.com/media/ais/AiS2_copy_1.mp3

Web Services
http://media.libsyn.com/media/ais/AiS5.mp3

Unit Testing
http://media.libsyn.com/media/ais/AiS8.mp3

Advanced Unit Testing Techniques
http://media.libsyn.com/media/ais/AiS9.mp3

Database Normalization
http://media.libsyn.com/media/ais/AiS12.mp3

Abstraction
http://ais.libsyn.com/index.php?post_id=187077#

Engineering Processes
http://ais.libsyn.com/index.php?post_id=196868#

Refactoring
http://media.libsyn.com/media/ais/AiS24.mp3

Scalable Enterprise Applications
http://media.libsyn.com/media/ais/AiS35.mp3

Adobe Flex Hourly Billing Rates (via HotGigs)

The Adobe Flex job market has been doing very well over the past 10 months or so. See the chart below for some aggregated calculations from hotgigs.com for hourly Flex rates. I am not sure where they are getting these numbers but this does seem to be inline with what’s going on in the industry. They don’t have anything for AIR and I do wonder what that would be. Any thoughts on the matter? Do you think these figures are accurate?

Adobe Flex hourly bill rates

I’ve also been having some discussions on twitter regarding fixed bid vs. hourly billing. Any thoughts on that?

Source: HotGigs.com

Working with 3D Layers in Photoshop by: Dolores Joya

Compositing images in Photoshop just got more exiting with the release of Photoshop CS3 Extended. “Extended” indicates a special version of Photoshop with added features such as 3D and Video layer support in Photoshop documents. In this tutorial, we are going to concentrate on the 3D layer feature now offered in Adobe’s CS3 product suite.

Read full story here.

ActionScript 3.0 UML and Code Generation Tools

ActionScript 3.0 Code Generation and UMLIf you are interested in generating UML and/or AS3 code you might want to take a look at the following tools. The price tags range from $0 to $239.

Cairngen - Free
http://www.ericfeminella.com/blog/cairngen
This tool provides AS3 code generation for Cairngorm based Flex projects. You’ll need to have Ant installed and know how to run and modify Ant scripts so there is a barrier of entry here. It would be great if Cairngen had a GUI.

VASGen - Free
http://selfmummy.com/vasgen
There are a few issues with VASGen, like no package name support, but the AS3 code generation is pretty good. This tool is definitely worth checking out, especially considering the price. If you aren’t planning on using Cairngorm and you want a free tool this might be the solution.

UMLet - Free
http://www.umlet.com
This app can be set up as a Flex/Eclipse plug in. Pretty cool, no code generation from what I could tell though.

Enterprise Architect - $239-$135
http://www.sparxsystems.com.au/products/ea.html
At one point I had a trial copy of EA that was generating AS3, if memory serves me it did take a few hours of changing settings and research to get the code gen working though. Unfortunately the current price tag is out of my reach so no further information is available.

Visual Paradigm - $70-$59
http://www.visual-paradigm.com/product/vpuml/personaledition.jsp
Visual Paradigm claims AS3 generation but I’ve seen some concerns, and have my own (that doesn’t look like AS3 to me, notice the lack of a package?).

Looping a Flex 3 Sequence Effect Animation with MXML

Here is a cool tip from Programming Flex 2. This code is from a Flex 3 project. I believe the syntax is the same for both versions of Flex. Notice that the repeatCount attribute in the Sequence component definition is set to 0. This will repeat the Effect until you call the end() method on the Effect. In addition the repeatDelay attribute can also be used to specify a pause between the cycles of the loop. This is a pretty simple example but illustrates the concept.

View example:
http://seantheflashguy.com/flex/Flex3EffectsExample/Flex3EffectsExample.html

Here is the code:
http://seantheflashguy.com/flex/Flex3EffectsExample/srcview/index.html

kannopy AIR Application Development and Consulting

kannopy.com - AIR Application Development and ConsultingAnnouncing “kannopy - AIR Application Development and Consulting”. This exciting new company will focus on application development using the Adobe Integrated Runtime. kannopy should be officially open for business sometime in early 2008. In addition to pure AIR app dev kannopy will also offer high end experience and UI design for Flex and AIR applications. kannopy will be looking into specializing in Adobe Thermo when it becomes publicly available.

Please get in touch regarding your AIR application development and/or user interface/experience design needs.

Understanding Gradients in a Web 2.0 World

Dolores Joya How To Simulate Material, Light & Dimension in Flash with Just Gradients

“How To Simulate Material, Light & Dimension in Flash with Just Gradients” by: Dolores Joya. This article is an artists inside perspective into the world of vector gradients applied to user interface design. Dolores has been involved with traditional art for a number of years. Here is your chance to learn some of the principals behind gradients from an artist. With the “shiny” surface currently glossing over the web this is critical knowledge. There are too many companion downloads to count in this article. Everything from glossy gradients applied to UI’s with the FLA, to Flash Color Set .clr files.

Flex ActionScript 3.0 Odeo API Example with Live typing reflection

Delving deeper into the ActionScript 3.0 API research I present the Odeo API Example. Full source available. Use of TileList with drop-in ItemRenderer. Parallels for animation and the search text field has a real time “web 2.0″ reflection. A little bit of Flash CS3 to Flex communication going on here too.

This application should probably be broken down in terms of architecture. Refactoring this to PureMVC or Cairngorm would be a fun project. Perhaps after the remaining API examples have been completed.

http://www.seantheflashguy.com/flex/OdeoBasicExample/