AIR 2.0 and Flash 10.1 Betas

As I (slowly) try to recover from yesterday, I thought I'd send out a quick reminder to folks that the latest betas of both AIR 2.0 and Flash 10.1 are available.

AIR 2.0 should be an amazing release. I highly recommend catching up on Christian Cantrell's blog as he has quite a few entries on the new release.

Flash 10.1 is also now at beta 2. I've not followed the news much on this but from what I can see this will be an important update for mobile devices.

I hate to sound like a broken record, but, I'll say it again. For my readers who only know ColdFusion, now is the time to expand your skills and pick up AIR. Even if you don't want to learn Flex (which I recommend as well), you can simply build upon your existing HTML and JavaScript knowledge by adding the power of AIR.


Get BIRT-y with Flash and Flex

I am not familiar (at all) with BIRT, but I wanted to pass on their announcement of a new contest for Flash and Flex developers. The Get BIRT-y with Flash and Flex contest is open now till March 10 and has a nice (and large) cash prize of up to $5,000 for the winner. From my (seriously) 30 second glimpse, it looks like BIRT involves visualization and is open source, so it may be something for Flex folks to take a look at anyway (and if any of you guys have experience with BIRT, post a quick comment).

Best of CF9: MailClient

Today's Best of ColdFusion 9 entry is the second to last entry. Slowly but surely we're getting there. One more and it will be time to judge! Today's entry comes from Adam Tuttle. Hits entry is entitled MailClient. It's a simple entry so the review won't be too long, but it's got a lot of interesting bits to it I think folks will want to take a closer look at. Before getting started, ensure you read the following.


[More]

ColdFusion as a Service Examples - Images

I promised a few weeks ago that I'd eventually get around to posting some of the code from my RIAUnleashed presentation. This morning I'm going to share two of them - both related to the Image service. The first one is really simple. It allows you to enter a URL to an image. CFaaS is then used to perform a gray scale on the image and return the result to the user. The code behind this demo could be a bit cleaner perhaps, but let's take a look at it.

[More]

Flex/AS3 support in TextMate

I almost always use Flex Builder to edit Flex code, but when I double click on a file to quickly look at it, my Mac displays it with TextMate. I asked on Twitter today about Flex/AS color coding support for TextMate and Jeff Self came to my rescue. This blog post tells you how to get the bundles and it works great, except that the URLs used for SVN are out of date.

Replace

http://macromates.com/svn/Bundles/trunk/Review/Bundles/Flex.tmbundle

with

http://svn.textmate.org/trunk/Review/Bundles/Flex.tmbundle/

and replace

http://macromates.com/svn/Bundles/trunk/Review/Bundles/ActionScript\ 3.tmbundle

with

http://svn.textmate.org/trunk/Review/Bundles/ActionScript 3.tmbundle/

Adobe offering Flex training for ColdFusion developers

This is pretty cool - Adobe will be starting a multi-city tour this month offering free training in Flex and Flash Builder 4. This training is specifically targeted to experienced ColdFusion developers. Did I mention it was free? Yep - 100% free. The tour begins on November 13 in Texas and ends on the 20th in San Francisco. You can find a complete list, and more details, here: http://www.ce1.com/adobe/2009/flextrainingforcfdevelopers/. It looks like registration is required and limited, so get to it!

Building an AIR Spy Application

Earlier today I twittered that I wanted to build a simple AIR application. The idea would be to use the web cam on my Macbook Pro and snap a picture every minute or so. I thought this would be relatively easily in AIR and I wasn't surprised at all. Let me be honest - I did not do heavy research into this. I found two really good web sites and built my application from what I saw there. There is - most definitely - probably much cleaner ways of doing this. I built this for fun - nothing more. That being said, let's take a look.

[More]

BFusion/BFlex Conference

Registration has opened up for the BFusion/BFlex conference this weekend. This is a two day conference covering ColdFusion and Flex. It's being held in Bloomington, Indiana and can be attended for the low price of 10 dollars. AIR and Flash Catalyst will also be discussed. If you are in the area (or can make the drive, come on, it's 10 dollars!) than I'd definitely recommend attending!

CFaaS Demo - Dead Bike

One of the cool new features of ColdFusion 9 is CFaaS, or ColdFusion as a Service. I'll be honest, I hate the abbreviation. It makes me think of a disease. But - I'll get over it since the feature itself is so impressive. During the ColdFusion Meetup (recording here), ColdFusion Evangelist Terry Ryan demonstrated using CFDOCUMENT remotely via Flex. In his demo, he enters some text, clicks a button, and gets the URL to download a PDF. This reminded me that many moons ago, earlier in the ColdFusion 9 beta, I had created a simple demo called DeadBike. (I'll buy you a beer at CFUNITED if you can guess why.) Here is a quick video showing it in action (clicking will take you to a full screen view, so I'd recommend 'open in new tab'): So the code behind this is very similar to what Terry showed. Note that I've been lazy and hard coded all the security information within Flex.
   view plainprintabout
 <?xml version="1.0" encoding="utf-8"?>
 <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:cf="coldfusion.service.mxml.*" layout="absolute" viewSourceURL="srcview/index.html">
 
 <cf:Config id="conf" cfServer="127.0.0.1" cfPort="8502" serviceUserName="service" servicePassword="service" />
 
 <cf:Document id="doctestnow" action="generate" format="pdf" result="handleResult(event)" fault="handleError(event)" />
 
 <mx:Script>
 <![CDATA[
10  import mx.rpc.events.ResultEvent;
11  
12  public var res:String = new String();
13  
14  private function renderSourceAsPDF():void {
15      var source:String = sourceText.text;
16      if(source.length == 0) return
17      doctestnow.content = source;
18      doctestnow.execute();
19  }        
20  
21  private function handleResult(event:ResultEvent):void {
22      res=event.result.toString();
23      pdfviewer.location=res;    
24  }
25  
26  private function handleError(event:Event):void {
27   mx.controls.Alert.show(event.toString());
28  }
29  
30  ]]>
31  </mx:Script>
32  
33  <mx:HDividedBox width="100%" height="100%">
34  
35      <!-- source side -->    
36      <mx:VBox width="50%" height="100%">
37          
38          <mx:Panel title="Source" width="100%" height="100%">    
39              <mx:TextArea id="sourceText" width="100%" height="100%" />
40          </mx:Panel>
41      
42          <mx:HBox horizontalAlign="right" width="100%">
43              <mx:Button label="Render PDF" click="renderSourceAsPDF()" />
44          </mx:HBox>
45  
46      </mx:VBox>
47      
48      <!-- render side -->
49      <mx:Panel title="PDF" width="50%" height="100%">    
50          
51           <mx:HTML id="pdfviewer" width="100%" height="100%" />
52  
53      </mx:Panel>
54  
55  </mx:HDividedBox>
56  
57  </mx:WindowedApplication>
Let's focus on the interesting bits first. You can find the connection/service information here:
   view plainprintabout
 <cf:Config id="conf" cfServer="127.0.0.1" cfPort="8502" serviceUserName="service" servicePassword="service" />
 
 <cf:Document id="doctestnow" action="generate" format="pdf" result="handleResult(event)" fault="handleError(event)" />
CFaaS has two special security requirements. First, you must go to User Management and specifically create a user and then give them access to particular services. In this case I gave the user, service, access to the Document service. Secondly, you have to specify which IP addresses are allowed to use the service. Now - I have to say - this is a bit troubling. I get the idea behind it - but it's going to be a problem for an intranet. I can't imagine you would need to enter each and every single IP address of your corporation by hand. But - that seems to be the case for right now. Hopefully that will change before release. The code handling rendering is about as simple as it gets:
   view plainprintabout
 private function renderSourceAsPDF():void {
     var source:String = sourceText.text;
     if(source.length == 0) return
     doctestnow.content = source;
     doctestnow.execute();
 }
Essentially - if I ttyped something, execute the CF service. My services result handler then simply uses the HTML component to render the PDF.
   view plainprintabout
 private function handleResult(event:ResultEvent):void {
     res=event.result.toString();
     pdfviewer.location=res;    
 }
Note that I had gotten a URL back, like Terry's demo, but I went ahead and loaded the result in the component. I was going to package up the demo, but it's usability by the public is very limited. I'd recommend simply copying my code into a new Flex Builder project. Remember to include the cfservices.swc file with your project!

Quick example of ExternalInterface, communicating between Flex and JavaScript

A few days ago I did some mentoring with a ColdFusion developer in Baton Rouge. He was also doing some Flex and I got to take a look at some of his work. He was making use of a feature I had not seen before, ExternalInterface. This is a rather interesting little feature. It lets you create a bridge between your Flex code and JavaScript code on the page. This is not the same as the Flex Ajax Bridge (which apparently was a Labs product and then moved into core Flex 3). I plan on looking at that more later, but here is some basic info about ExternalInterface.

[More]

More Entries