Adobe MAX Widget – Embed it on your blog now.

Ted On Flash has a short bit demonstrating the blog-sized MAX widget. The hightlight is the testimonial features, which can switch on your web cam and let you record a few words about how excited you are about MAX.
Sadly, I’m committed on a project, so I won’t be attending this year. I’m sure you all will have fun without me, though!
Here’s the widget:

From: http://onflash.org/ted/2009/08/adobe-max-widget-embed-it-on-your-blog.php

Shift + F2 vs. AS3LR

If you’re smart enough to be developing in ActionScript, you’re also probably smart enough that you have figured out a way to bookmark the ActionScript Livedocs. However, there always seems to be reason to try access the docs at a time when finding your bookmark is a hassle. For me, that usually happens during peer programming. When I’m working at another person’s machine, they don’t usually have things set up just as I would, and finding an entry point for the current docs can be a little frustrating.
First, if you’re using FlashBuilder (or FlexBuilder), you can always use the ‘Shift + F2′ shortcut. This is mapped to ‘Go To Documentation’ in the ‘ General > Keys’ section of the FB preferences. This opens the Language Reference in the context the Eclipse help viewer.
Since I don’t like having the help viewer clutter the documents, I tend to go straight to a browser and punch in a URL. Fortunately, there is a handy link that automagically resloves to LiveDocs for the current Flex Language Reference.
http://www.adobe.com/go/AS3L
I don’t know for certain, but AS4LR seems likely once Gumbo is out of beta. For now, the AS3 Docs offer a link to the AS4 docs should you need it.

MAX 2009 Announcement

Though there has been information via the MAX Blog for a while, Adobe sent a MAX 2009 ‘call for sessions’ announcement to the community today. The event will be held October 4-7, 2009 in Los Angeles, California, U.S.A.
If you want to get started thinking about MAX now, there is an Adobe Groups page available for suggesting a session topic. Check that out if you’ve got something you think should be presented. The call for sessions will end April 15, 2009 midnight PST. Sessions and speakers should be selected by May 15, 2009.
Unfortunately, there will be no MAX in Europe this year. However, there are plans to make an online MAX experience that parallels the events in L.A. Granted, you’ll miss being able to get lost in the convention center, but you can simulate that on your own if needed.

AIR 1.5 rocks

Well, it’s sort of old news, but I figured I’d give a quick plug for AIR 1.5 on my blog.
First, this release of AIR supports Flash Player 10, which by itself is a big deal. FP10 includes much goodness: a more robust text engine, enhanced video, some 3D support, and Pixel Bender. The list is too long to do it justice here, check out the FP10 page for details.
Another great new feature for AIR 1.5 is the local database can now be encrypted. Since the Encrypted Local Store is not suited to handle large entries, this is a big win for users wanting to protect locally saved data.
Another thing that gets passed over a bit is the inclusion of Squirrelfish, which comes along with an updated WebKit, which is AIR 1.5′s HTML rendering engine. The WebKit project did some bytecode optimizing and pumped up the JavaScript performance by quite a bit. Even better, this was just a first pass at optimization. Future evolution of Squirrelfish will only get faster!
I know, it’s pretty hard to get excited about JavaScript, right? But considering how AIR 1.5′s support for HTML makes it so easy to port an existing web app into a desktop app, even I’m getting into it. And a lot of my friends are Ajax nerds, so hopefully they’ll start using AIR and I’ll actually have something to talk to them about.
So, get the runtime, check out a few applications, get inspired, crack open the SDK, and get your AIR app built!

Tour de Flex

tourdeflex.png
While at MAX, I learned about the ‘Tour de Flex’ website. I’m excited about the resources that are offered at Flex.org, but the Tour de Flex tool is especially focused and useful.
First, the site allows you to download the Tour de Flex AIR app. This is a tool similar to the Adobe Flex 3 Component Explorer. The Tour de Flex version is expanded, with 200 component examples, covering core components, data access, data visualization, mapping. and many others. Because it is an AIR app, the tool can also demo components and language features only available in AIR. There is also a listing of custom components, effects, skins, and other content created by the community.
One of the features I’m most excited about is the listing of Cloud APIs
cloudapi.png
A few clicks brings up example code for a bunch of online APIs. Viewing how to get started with Ebay, Amazon, or Google Maps is a great way to help an idea get off the ground. Even better, there’s examples for some of the services that Adobe offers, like Acrobat.com and Photoshop.com. Way cool.
The tool also includes a download option, which creates a zip of the source code for the example you choose to download.
Another great feature is the Tour de Flex plugin for Eclipse. With this installed, you can browse the 200 examples from within your IDE. Having an example to look at often makes it easier to implement a component you haven’t used before, or one you haven’t used in a while. With this, there’s no need to go looking around on the web for example code.
Check out the Tour de Flex page for more detail.

XD blog – Adobe on Adobe

The XD (experience design) group at Adobe has unveiled a new, flex based ‘blogazine’:
xd.adobe.com
There is an interesting video about the motives of XD in creating the blog, with a lot of focus on their motives to break out of the traditional blog structure and explore using various Adobe technologies in their new design.
They also mention guest speakers, interviews, and behind the scene insight into the world of XD and the evolution of Adobe’s products and technologies. There’s a lot of strong feelings in the wild about the Adobe experience. Having a closer look at the process involved in determining the evolution of the Adobe experience should prove interesting for all the followers of Adobe.

AIR 1.5 Cookbook

AIR 1.5 Cookbook cover - image by O'Reilly Media
David Tucker
Marco Casario
Koen De Weggheleire
Rich Tretola
ISBN 10: 0-596-52250-9 | ISBN 13: 9780596522506
Monday was the official print release of the O’Reilly AIR 1.5 Cookbook, which Ikezi and I worked on as technical editors. It was available at MAX for sale, but still is on pre-order in the US and UK on the O’Reilly web site. The book features examples for Flex and HTML/Javascript development of AIR applications, and covers a range of topics, from the basics to get someone started, to advanced techniques that put the power of the AIR platform to work.
The final list of chapters should enumerate the variety of skills this book can help you grasp:
1. AIR Basics
2. Application Settings
3. Application Windows
4. Screens
5. HTML Content
6. PDF Support
7. Clipboard Support
8. Drag and Drop Support
9. File System Integration
10. Embedded SQL Database Programming
11. Encrypted Local Store
12. Application and Window Native Menus
13. Taskbar and Dock Integration
14. File Types
15. Service Monitor Framework
16. Application Updates
17. AIR Application Distribution with the Browser API
18. Developing Mashup AIR Applications – online bonus chapter
On Adobe’s DevNet you can find all the resources you need to get started with AIR, including a chapter excerpt from the book. There is also a bonus chapter available through a link on the O’Reilly web site.
The code examples (which I have gone through in detail, trust me) are concise and helpful. Even if you are relatively new to ActionScript, Flex, or HTML and JavaScript, you should be able to easily follow this book and learn how to make your own AIR applications.
I enjoyed working on this, but would offer one insights to anyone thinking they want to be a technical editor. It was a lot more work than I thought it would be. However, since being a tech editor brings fame, groupies, and membership into an elite circle (the lucky few to have 3 sentences of recognition published about them in an O’Reilly book), I’d probably do it again.

MAX 2008, the VPN, and nerd joy

Mac users: did your VPN client quit on you recently? Read on, then. I have suffered a similar fate, and found a potential remedy, which I am glad to share.
I have been lucky enough to attend MAX this year, but have not blogged a single peep about it. That’s not because MAX is terribly dull, with no great announcements, code insights, or geeked out super nerds with kilts playing Unreal Tournament on bean-bag chairs. Ho, no. There’s been a ton of that. Sadly, there’s also been a broken VPN client on my MacBook.
20081119_01.png
The problem was Heisenberg quirky for a while, such that whenever I had some spare time and would attempt to fix the connection, the problem would stop occurring. It only seemed to break when I was stressed for time, working at a client’s site, and already grinding my teeth over some other problem. Luckily, if you use Google to search for ‘Error 51: Unable to communicate with the VPN subsystem’, you get two entries, one of which explains the whole thing. Note that, if you type ‘Area 51′, you will get considerably more than two results, on a topic not really related to broken VPN clients.
First, the word on the internet is “the Cisco VPN client tends to break with most OS X updates”. Like a good solider, I tend to accept OSX updates from Apple, mostly because I hope it will fix various annoying broken things. Like the kernal panic when unplugging my Apple keyboard, for example. While that issue persists, it looks like I’ve gained a new hassle by having an intermittently broken VPN. Expect the broken stopped being intermittent, as of last week, just before MAX and all the fun things I wanted to blog while sitting on a bean bag at Moscone West. So I’m fixing it.
The page continues; ‘I’ve found the Cisco VPN client to be the least reliable VPN client I’ve ever used. In fact, I think it breaks during most updates, possibly because Cisco (a) doesn’t bother to write a more modern launchd version, and/or (b) they put their StartupItem in the System/Library/StartupItems folder, which (unless I’m mistaken) is intended to be reserved for Apple software.”
The best part was finding the solution. There is nothing that delivers greater nerd joy than a shell command for punching a troublesome process in the kidney. Since the console log reported “com.cisco.VPNClient[301]: Could not attach to driver. Is kernel module loaded?”, the idea of giving the VPN driver a kick seemed worth a try. Here’s the command:
sudo /System/Library/StartupItems/CiscoVPN/CiscoVPN restart
Which I ran as such:
20081119_02.png
Type that into terminal, along with your password, and you should be up and running.
More on MAX in a bit; it’s (finally!) my turn to play some Unreal Tournament with kilt-boy.

Exporting Charts to PNG

On a recent project, we needed to export PNG images for a series of charts. Part of the design was to create the charts in ActionScript, rather than MXML. Below are code highlights of how we went about the process.
The charts were listed in a type safe enumeration. Coming from a long Java background, it’s always comforting to see an old OOP standby get implemented in ActionScript. For each chart, a representative ChartSetup class was created, that contained the specifics of the chart’s configuration, series, axis’s, etc. For each entry in the enumeration, we included a reference to each representation class, as well as a constant that declared what type of chart the class was representing.
Construction of an enumeration entry, passing in SpendingByBusinessUnit, the ChartSetup class for that chart:

public static var SPENDING_BY_BUSINESS_UNIT:ChartType = 
new ChartType(0, SpendingByBusinessUnit);

This class reference is later used during the creation of the charts. A loop reads all of the constants in the enumeration, the class representing each chart is instantiated, and the chart is added to the user interface.

for each (var chartType:ChartType in ChartType.allCharts)
{
var ClassReference:Class = chartType.chartClass;
var chartDetails:* = (new ClassReference() as ChartSetup);
var chartDisplay:*;
if (chartType.type == ChartType.COLUMN) {
chartDisplay = new ColumnChart();
chartDisplay.height = chartDetails.chartHeight;
chartDisplay.width = chartDetails.chartWidth;
chartDisplay.showDataTips = true;
chartDisplay.type= chartDetails.columnType;
chartDisplay.series = chartDetails.series;
// etc

This created a set of charts, but what about the screenshots? We needed to collect a PNG of each chart, which was sent off to be embedded in a PowerPoint template. Capturing a bitmap image of a DisplayObject is not a big secret these days. For us, the trick was all in the timing. If you capture the bitmap directly after the chart creation, you might get a blank image. This is where the ‘Update Complete’ event comes in handy. We added a listener, calling the bitmap capture once ‘Update Complete’ fired. With the listener added, the charts were placed in a UI container, for the immediate enjoyment of the user.

// chart build, add listener  
var chartBox:VBox = Application.application.chartsPane.chartBox;
DisplayObject(chartDisplay).addEventListener(
FlexEvent.UPDATE_COMPLETE, exportReady); // add to stage chartBox.addChild(chartDisplay);

Last, we needed to get the chart image captured. With a fully rendered DisplayObject, it’s not too complicated. Just create an instance of BitmapData using the DisplayObject‘s dimensions and encode with the PNGEncoder. Done!
Here’s the code:

public static function exportReady(event:FlexEvent):void
{
   // if all items are ready
   for each(var item:DisplayObject in images.getChildren())
{
screenshots.push(ChartImageCreator.screenshotChartForExport(item));
       // etc
// code snip from screenshotChartForExport ...
var bitmapData:BitmapData =
new BitmapData(displayObject.width, displayObject.height, true, 0);
bitmapData.draw(displayObject); var pngEncoder:PNGEncoder = new PNGEncoder(); return pngEncoder.encode(bitmapData);

That’s it. If your charts are strictly MXML, you should still be able to capture the PNG, by referencing the chart by it’s id attribute.

Hello World

Just a few days ago I was giving my Tech Editor biography to O’Reilly. They suggested I include a link to my blog. I explained that I didn’t have an active, all teh internets web log, because I am busy actually working. Now, look at me! I blog, therefore, I am … procrastinating? I’m all hooked up to the tubes, with Adobe.com in the URL. Wow. I promise I’ll make good use of the space. Be ready to hang on ever word. Or cringe at every word? We shall see.