Wednesday, January 31, 2007

New Flex 2 Training Video

Totaltraining.com has just released a new Flex 2 video "Adobe® Flex 2 Advanced Visual Programming" hosted by Leo M. Schuman. This is actually very timely for me. I've got a couple of apps that I have just "finished" that I would like to dress up with some transitions to make the UI a little friendlier. Can't wait to see it!

Thursday, January 25, 2007

Flex 2 and SEO

I have been thinking a lot about FXT lately. This is a really interesting idea. Basically, you are creating an html page that contains nothing but content formatted into an xml structure and a Flex swf file that can parse the content to display in a full page flash layout. The xml can contain your sitemap structure which could be parsed using E4X into whatever kind of navigation you want, you could setup different nodes in the xml for different columns in the layout, the possibilities are wide open. All of this is databound to Flex controls or components so that Flex knows where to put everything. On top of that, you can use states to reformat the content on the fly. For instance, creating a state for a print version of the page, being able to change a page in real time from a two column layout to a three column layout, having a drag and drop layout that would remember the user's setting on a return visit, all of this would be trivial to build. And the best thing of all is that since the source of the html file would be almost purely content, the search engines can index your site just as they can a standard html site. Very exciting stuff.

Tuesday, January 23, 2007

Issues with the Coldfusion Wizards

I have noticed a few gotchas with the Coldfusion Wizards for Flex 2. In this post I want to talk about the issue I have found with the save method in the gateway CFC that is created when you generate an Active Record CFC type from a database table. This is the save method that is created:

<cffunction name="save" output="false" access="remote">
<cfargument name="obj" required="true" />
<cfreturn obj.save() />
</cffunction>

This works so far as it will save the object to the database, but it fails to return the object to the result method in Flex. After some banging around I modified the code to the following:

<cffunction name="save" output="false" access="remote">
<cfargument name="obj" required="true" />
<cfset obj.save() />
<cfreturn obj />
</cffunction>

This saves the object to the database AND returns the object back to Flex. Now if I can figure out if it is possible to modify the way the Coldfusion Wizards write code I can save myself alot of copy and paste! If anyone knows drop me a line.

Flex 2 and Coldfusion Remote Object Mapping Issues

Today I was having trouble mapping an object from Flex to Coldfusion. According to all the documentation I could find, all you have to do is match the properties between the Actionscript object and the CFC (same number of properties and naming) then set the "RemoteClass" metadata on the Actionscript class and the "alias" in your Coldfusion CFC. That should do it... The problem was that whenever I would debug my app and inspect the result from the remote call, I would see a generic object instead of the typed object that I was exspecting. The problem was solved by importing my class into the mxml file and creating a bindable variable of the same type as the class in question. When I debugged the app, there was my typed object. Interesting...

My Adventures with Flex 2 and Coldfusion

First off, let me say that I am fairly new to Coldfusion. I have been developing in .NET since it's inception and in ASP before that. I've been programming in Actionscript since Flash 4 and I didn't start working in Flex until the first beta release of version 2.0. However, from the moment I first installed Flex 2, I took to it like a duck to water. Everything in Flex 2 just clicked. It is what I have been longing for in a development environment. I enjoy it so much that I have even left my .NET security blanket for the promise of Flex/Coldfusion remoting bliss. While all has gone fairly smoothly, there have been a few bumps in the road. These bumps are what I'll be posting about while I get my blogging feet wet. In the future I plan on posting some tutorials about using frameworks such as Cairngorm, Reactor, and Coldspring with Flex and Coldfusion. Later.