Monday, October 19, 2009

Flexbuilder color HTML document generation with View Source

The Tour de Flex submission instructions mention that a color HTML source document can be easily generated from the view source feature of Flexbuilder. That sounded like a cool feature, so I hunted in the Source menu and couldn't find anything that looked like it would generate a color HTML source. I tried right clicking, going to various menus all to no avail.
Finally after some googling, I uncovered a blog with instructions on how to do it. The source files are actually generated by clicking the "Enable view source" checkbox on the File-Export-Release Build menu. This will enable the source files to be produced. The warning message mentions that do to IE security the files will probably not work properly when accessed via localhost. I never tried IE, but did have trouble with the view source from Firefox. However, when I ran them from a server, all worked well.

From the localhost, I was able to view the color HTML source files directly by going directly to the files. On my installations, they are in ~/Documents/Flex Builder 3/project name/bin-release/srcview/src.

Getting Started in Flex

I recently begun an adventure of converting a javascript application to Adobe Flex. Why Flex? Mainly because a number of new features (and scaling issues) make a full rewrite a given. Graphing in javascript currently has some performance/compatibility issues (cough. IE. cough.) And of course, there are the general javascript/browser issues. Will using flash make things better?

I started by getting flexbuilder. They have a 60 day free trial available. If you are a student, work at a school, or are unemployed, you can also get a free license. I simply faxed in a copy of my Stanford ID, and had a registration code within a day or two.

Other useful bits include the Tour de Flex samples library as well as the instructions for installing the Flex Source Code Formatter (I suppose some people may find it intuitive to download the files and then look in help for a way to install... But for me, following the instructions seemed the better deal.) Tour de flex can also be added to the plugins, using the url:

in the Help-Find and Install Updates-New External sites area of flexbuilder. From here, I was able to do File-New Flex Project and simply copy some of the simple .mxml example from Tour De Flex into the "Source" view and successfully run them by using Run-Debug Sample project (or the icon.) For Eclipse users this should all be second nature. For people like me, who consider vi to be their preferred IDE, there was a short learning curve.