My Adobe AIR diary

Welcome
Welcome to my Adobe AIR diary which I want to use to put code snippets, examples and questions that I come across while I look at Adobe's AIR environment. Which will only last until my 30 day eval copy of AIR (Flex3) dev environment is valid :-)

Update - Adobe released the Beta2 of AIR on 1 Oct - so I will install the update and carry on.

The main reason for creating this is my frustration at trying to search for example code that explains the solution to coding queries that I come across. This could be due to the fact that I am looking in the wrong place (which is usually the case), or just the fact that there is no article that explains exactly what I am looking for.

for example.
I was trying to find out how to do a drag and drop using AIR with a graphical image so I could display it in the app. Loads of "design theory" on how to go about it and a few examples (most using custom code or libraries?). So I created an example app just just allowed a simple drag and drop of an image onto an AIR app which then displayed the dropped image.

The easiest way to share this, if anyone else comes across similar problems is to generate a quick simple solution and let interested people download it.

NB: I don't warrant any of the code that is available here , it is all created so that it just answers my queries in the simplest possible way and I thought it would be good to share it.

Simple Drag and Drop

Simple drag and drop example

This is a straight forward article on coding up a drag and drop application in AIR, along with the actual application that can be downloaded (with source).

This is a beta 1 example that may not work with the beta 2 runtime as it looks like changes have been made to the native drag and drop libaries - i will test and update when I can.

The example is very simple and has commenting in the source code on what is being done.

Overview
The steps required for this drag and drop example are:

There is a lot of stuff missing, such as checking filetypes, handling more that one file etc, etc. But the the code here is just an example of getting drag and drop working so it has been kept as simple as possible.

The attached files that can be downloaded are as follows

To run and install the AIR application you will need the appropriate runtime. see http://labs.adobe.com/downloads/air.html for more details.

Simple Flash Movie Player

Just a quick entry, I created a simple flash movie player the other day that can be embedded into an HTML page and play flash movies.

The embed code is simple

<embed src="mplayer.swf" type="application/x-shockwave-flash" id="mplayer" height="320" width="240" flashvars="vf=/videos/mymovie.flv" ></embed>

The height and width can be changed to suit and the player will re-size itself, the movie to play is specified with the flashvar vf.

The player is attached to this article as a zip file.