Quality Reads

Showing posts with label AIR. Show all posts
Showing posts with label AIR. Show all posts

Sunday, February 24, 2008

Full Open Source Flex 3 SDK Released

The full source for the Flex 3 SDK was just released on Adobe's new open source wiki. Check it out if you're so inclined: http://opensource.adobe.com/wiki/display/flexsdk/

There were two surprises on the website:
  1. You can view Actionscript source for the AIR specific classes in Flex
  2. There's a section on Flex 4 (codename Gumbo) with some bug details
Cheers,
Todd

PS - Flex 3 and AIR 1.0 have just shipped. I think the post script topped the actual post...

Thursday, July 26, 2007

Drag & Drop in AIR

I just ran into a great article by Alastair outlining the use of Native Drag & Drop functionality in AIR (w/ a little RoR mixin). The documentation for Native D&D is very spotty, there are more mistakes then anything else. So, if you haven't learned the hard way yet, let me make your life a little easier: http://blog.vixiom.com/2007/06/29/merb-on-air-drag-and-drop-multiple-file-upload/

Here's a simple test application you can use to get started:

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init(event)">

<mx:Script>
<![CDATA[
import mx.events.DragEvent;
import flash.desktop.DragManager;
import flash.desktop.DragActions;
import flash.events.NativeDragEvent;
import flash.desktop.TransferableFormats;
import flash.filesystem.File;

private function init(e:Event):void
{
//add the event handlers
this.addEventListener(NativeDragEvent.NATIVE_DRAG_ENTER, onEnter);
dropPanel.addEventListener(NativeDragEvent.NATIVE_DRAG_DROP, onDrop);
}

public function onEnter(event:NativeDragEvent):void
{
//Check to see if the drag item is the right format
if(event.transferable.hasFormat(TransferableFormats.FILE_LIST_FORMAT))
{
DragManager.acceptDragDrop(dropPanel);
}
}

public function onDrop(event:NativeDragEvent):void{
trace("dropped");
// Cast the drag & drop data as an array
var files:Array = event.clipboard.dataForFormat(flash.desktop.ClipboardFormats.FILE_LIST_FORMAT) as Array;
for each (var f:File in files)
{
// check out the file URL
trace(f.url);
}
}
]]>
</mx:Script>

<mx:Panel id="dropPanel"
top="10"
left="10"
height="100"
width="100"
title="Drop Files Here"
backgroundColor="#FFF">


</mx:Panel>

</mx:WindowedApplication>



Also worth a read: http://coenraets.org/blog/2007/06/air-to-desktop-drag-and-drop-two-simple-utility-classes/

I'll let you know why I'm reading up on D&D in a couple days :)

Cheers,
Todd

***Updated for AIR Beta 2***

Sunday, July 22, 2007

CT-CFUG Presentation

Just a quick heads up. JB and I are giving a presentation on Adobe AIR at the Connecticut ColdFusion User Group on Tuesday night (July 24th, 2007). If you're in the area and up on technology, you might want to think about stopping in for our jam session. I hear there's going to be some free Adobe swag in it.

Cheers,
Todd

Thursday, July 19, 2007

Bubblemark Animation Test Confirms It

Alexey Gavrilov compiled a nice set of performance tests for all the major RIA development platforms (Flex, Silverlight, JavaFX, AJAX). Flex (aka Flash) performed like a champ in the browser arena, which isn't horribly surprising considering how long its been around. Both Flex & Actionscript are up to, or on the way to, version 3.0 and Flash is rocking numero nine. I do have to admit that I'm impressed by Microsoft's progress on Silverlight. After the Flex 2.0 release, they must have recognized the enterprise level development capabilities that Flex brought to the table and jumped right on the issue. If they had taken a look at the crazy flash apps Pier was doing back in 2001, they might have foreseen this RIA trend long in advance.

Here are a couple surprises:
  • JavaFX is 4.4 times slower than Flash.
  • Firefox + Silverlight (CLR) — 99 fps
  • Flex and AIR peform at the same speed (as I previous reported)
While it looks like Silverlight is going to be a strong contender from a performance standpoint, I'm going to hold my opinion until they release the first non-Windows version.

Check out the complete results here.

PS- I also enjoyed reading Alexey's initial experiences w/ Flex. I distinctly remember dealing with each one of the issues he mentioned. Good times.

Thursday, July 12, 2007

There's an Advanced DataGrid!?!

I guess in all the excitement surrounding Adobe AIR, I missed out on a huge feature available in Flex 3, the Advanced DataGrid.


If you're working w/ alot of data in your Flex/AIR applications like I am, you need to check this component out. It may just save your life/sanity.

Here are some of the main features:
  • Multi-column sorting
  • Tree View (basically a tree component mashed into a DataGrid)
  • Cell Formatting
  • Summary Collections (allows you to perform a calcuation on the DataGrid columns and output a result)
  • Column Grouping
Seriously, half the work I'm doing right now could be handled with this component. Check out some of the details here or the Flex 3 docs here. This is the type of great stuff I expect from the Flex team. Now if we could only get the CS3-to-Flex skinning integration to work properly everything would be brilliant.

Cheers,
Todd

Tuesday, July 10, 2007

Performance in AIR


If you're like me, you might have thought that Adobe AIR (formerly Apollo) would provide a more powerful computing platform for desktop RIA development. Well, you'd be wrong. After running a number of performance tests ranging from long-running financial calculations to CPU intensive UI effects, AIR and Flex executed at approximately the same speed (~2% in favor of Flex -- insignificant).

While I must profess a little disappointment, I don't think its a huge downside of the platform since Flash provides so many other core competencies. However, you need to take it into account whenever you are about to perform a lengthy IO operation. The user interface will freeze up when saving/generating multiple files. At Pier, we've been popping up a modal window just prior to all IO ops to keep the user from trying to interact w/ the UI during the freeze.

My suggestion is take the time to setup you IO framework so you don't have to code a custom modal on every operation.

Cheers,
Todd

Saturday, June 30, 2007

Execution Times in Apollo vs. Flash

I just wrapped up a 12hrs. coding session at work. We're creating an application that provides ROI (return on investment) calculations to prospective technology clients. Its standard practice these days to sell software based on value even though selling on features is a heck of a lot more fun, which is where the ROI calc. comes in handy.

Behind the calculator's UI, there are a plethora of events being generated to update the key benefits used by the buyer. As we've continued to work on larger calculators (more benefits), the processing time in AIR has lagged even when the Flex seems to run unhindered. So tonight I did a little testing to see how significant the difference was, I was shocked to learn that AIR executed the same functions as the Flex application at a speed ~ 54% slower. The "native" application is running slower?!? Even more bizarre, the execution time goes back to normal when I load a secondary SWF inside the AIR application to handle the calculations. Very weird and disheartening to say the least. I don't have the tests at home otherwise I'd post them but if anyone has a reason for this discrepancy. Do tell.

You can expect the source for my tests tomorrow. Until then, you might want to think about creating a wrapper for calling functions w/in a SWFLoader. Here's a useful article about how to make calls from the child app. to the parent.

Cheers,
Todd

Thursday, June 21, 2007

Living in Boston...

I guess I haven't taken the time to make mention of my new job (or write a post for that matter). I packed up my bags about a week ago and made the long haul up to Boston, actually it was three short hauls. Besides the psycho that yelled at me for "borrowing" her parking space while I moved my furniture into my apartment, everyone I've met has been great. A trend I'm sure can't last forever but I'm enjoying it for now.


My new company, Pier Inc., creates Rich Internet Applications using Flash (Flex, AIR). We've got an impressive list of Fortune five clients and skunkworks to boot! I've got to get back to work for now but you can expect some great Flex/AIR tutorials to follow.

Cheers,
Todd