2008-08-25

Download Flex Builder 3 plugin

If you have been searching for the link to download the Flex Builder 3 plugin... then search no more, here is a little hint:
  1. Goto the FB 3 download page
  2. Click the last link at the bottom of the page!

Ottawa Flex Camp recap

The Ottawa Flex Camp was a blast. I saw my old partner in crime Stacy Young who now works at those same Adobe offices in Ottawa and another old college of mine from Optimal Payments. So it was nice to see old friends again, but also a couple of the presentations were interesting as well. One of them was related to a Flex app talking to a USB port using sockets via a local Java app. Also learning that there is a AS3 library for working with MySQL database was an eye opener! That library is hosted here, but I do not recommend using this in a production environment as there would be serious security concerns. Good for prototype apps I suppose.

Definitly would go again, kudos to the Adobe folks for entertaining 150 people for 5 hours :) Can't wait for the next one!

Flex Builder Enterprise plug in

Just came across this, the Enterprise IDE Plugin, this morning. Although I haven't tried it yet I wanted to pass it around and let people try it out. It has features that the community has been asking about, Java-AS code generation, Cairngorm integration and more. Definitely worth a look see. I will take a look at it and post some feedback when I get a chance.

2008-08-09

Ottawa Flex Camp

Forgot to mention this a while back, but a Flex Camp is being held at Adobe's Ottawa offices this upcoming August 21st. You can sign up via this website. So for those in Ottawa or in close proximity, like me (in Montreal), try to be there, should be fun!

2008-08-04

Download a file from a server with AIR

Been working allot in AIR lately and I just got to the point of adding a feature where a user can download a file from the server. Initially I thought the following simple code would do it:

var req:URLRequest = new URLRequest( "http://localhost:8080/orion/pdfdown" );
req.method = URLRequestMethod.POST;
var f:File = new File();
f.download( req, "bla.pdf" );

However running the application with that causes the following error to be thrown: Error #2044: Unhandled IOErrorEvent:. text=Error #2038: File I/O Error. I really don't understand and after some searching I couldn't find the answer, so I decided to post on Flexcoders, and thanks to Ryan Gravener for posting the solution. In AIR you should use the URLStream class to download files from the server. Like so:

var req:URLRequest = new URLRequest(url);
stream = new URLStream();
stream.addEventListener(Event.COMPLETE, writeAirFile);
stream.load(req);

private function writeAirFile(evt:Event):void {
var data:ByteArray = new ByteArray();
stream.readBytes(fileData,0,stream.bytesAvailable);
var file:File = File.documentsDirectory.resolvePath("bla.pdf");
var fileStream:FileStream = new FileStream();
fileStream.open(file, FileMode.WRITE);
fileStream.writeBytes(fileData,0,fileData.length);
fileStream.close();
}