links for 2009-04-27

Using Apache Ant with FlexBuilder 3 on Mac OSX – Some workarounds

I recently needed to compile a SWC from Flex Builder 3 on my Mac. I hadn’t done that before, as I really hadn’t had the need to share or publish my Flex components with a broader audience. This seemed like it was going to be a pretty straightforward thing to do, but after a while of tinkering about in FlexBuilder 3 with a number of different failures of varying types, it became abundantly clear that simply following the tutorials on LiveDocs, the docs on Labs and the help files in FlexBuilder wasn’t going to cut it. A number of posts on Mike Chambers blog regarding SWC compiling with compc and some messages in the FlexCoder’s discussion list got me closer to my goal, but it still took a lot more tiral and error than I think it should on a commerical product like Flex Builder. The bugs I found in Adobe’s Jira Flex SDK area on the subject were almost laughable, some mentioning compiling SWCs from FlexBuilder 3 on a Mac as an “edge use case”. Really? An edge use case?

FlexBuidler 3 on a Mac is not capable of compiling Flex components to SWC files out of the box. You need to install and configure Apache Ant before you will be able to share your code libraries with other developers.

So, for my own future reference and in the hopes of saving some Mac Flex developers the headache I encountered, here are the steps I needed to take to get Ant to successfully build a SWC that I could use in other Flex projects or give to developers on my team.

Installing Ant For FlexBuilder on OSX

You’ll need to load Ant into your FlexBuilder installation. To do this, open FlexBuilder and go to “Help -> Software Updates -> Find and Install..” Once the dialog appears, choose the “The Eclipse Project Updates” option and click finish. Choose a repository. You’ll need to install The Eclipse JDT package. Confirm the download, accept the agreement and wait for the install to happen. After the install completes you’ll need to restart Flex Builder to see it. After the restart, it should be available to you via “Window -> Other View -> Ant”. Before using it, though, we have a little more tweaking to get it to work.

Configuring Ant For FlexBuilder on OSX.

Add your SDK folder to your system’s $PATH environment variables. This is a simple step in theory, but in practice will cause you some headaches due to the default location of the Flex Builder install. By default, Adobe Flex is installed here: “/Applications/Adobe Flex Builder 3″. The folder has spaces in the name. Typically, when using spaces in folder names, specifying the path to that directory in a shell application requires using encapsulating quotes or the escape character “\” proceeding the space. In this case, using either of those failed for me. In order to workaround this, I needed to create a symlink at “usr/local/flex_sdk, allowing Ant to reach “compc” in a directory that didn’t have spaces in it. If you don’t do this, you’ll end up seeing errors like this.

So to do this, open Terminal and type: “sudo ln -s "/Applications/Adobe Flex Builder 3/sdks/3.2.0/" /usr/local/flex_sdk” – Of course, this assumes your SDK is located in “/Applications/Adobe Flex Builder 3/sdks/3.2.0/”, which for me, on a default FlexBuilder3 install, it was.

Once that is done, you may edit your “.profile” file to add the symlinked directory (pointing to your Flex SDK) to your $PATH environment variable. You have to do this, because without it, when Ant fires off the Compc Task, your Mac won’t know where the compc application is. You can use any text editor you like to edit the file, but since the file has a “.” prefix in the name, the file is invisible by default to the finder. Pico, Vi, etc in the Terminal have no problem with hidden files, and BBEdit is also capable of opening hidden files via the “File -> Open Hidden…” command. Your edited .profile file should look something like this after you are done:
export PATH=/opt/local/bin:/opt/local/sbin:/usr/local/flex_sdk/bin:/usr/local/flex_sdk/lib:$PATH

Once this edit is complete, logout of the Finder, log back in and check that the edit stuck by using this command in your Terminal:
echo $PATH

After that fun is over, you should be able to fire up Flex Builder… Once you have some AS you want to turn into a Ant Project, you’ll need to write a build.xml file and a build.properties file. Pretty much all the other tutorials out there on using Ant with Flex work after this point, so I won’t bore you with those details. After everything is working, I have to say Ant is pretty cool and I’m already thinking of some cool things to use it for to automate my workflow and speed up testing and deployment.

That said, I surely hope that FlexBuilder 4 fixes some of these dicier development issues that seem to plague FlexBuilder 3. Honestly, avoiding stuff like this was one of the main reasons I have paid for a FlexBuilder license, rather than simply downloading the free SDK and using the free Eclipse IDE, so if 4 doesn’t fix a lot of this stuff, I’ll likely do that. Writing MXML is easy enough, and with Catalyst just around the bend, it might supplant one of the bigger benefits of the FlexBuilder design view, so this seems even more plausible for many now than it did around the release of FlexBuilder 3.

In closing, I hope this article helps you, and if does, please comment below. If things aren’t working for you after following the tips in this post, comment and I’ll try to help you out!

links for 2009-04-26

RIAPalooza Two. Designers and Developers Together For a One Day Conference in Chicago.

Last Year I attended RIAPalooza, a conference focused on the design and development of Rich Internet Applications. It was a fantastic event, with a lot of great presentations covering AJAX, Flex, and Silverlight. I wrote a recap about the event, here.

The event is happening again this year, on May 8th. It looks to be another awesome lineup of sessions. One change from last year… I WILL BE PRESENTING THERE! I’ll be speaking with a coworker of mine, Erik Peterson. We’re going to be covering a site that is about to launch for a Chicago museum. The site features an Open Source CMS, AMFPHP, Flex and lots of cool social media integration points. We’re going to be discussing not only the nuts and bolts behind what makes it work, but also the process to get from the sales pitch to the finished product. Should be a great talk!

In addition to my session, Roundarch will be there, Josh Holmes and Mike Labriola among others. This is a great opportunity to see some platform agnostic information, with technology taking a back seat to the bigger issues in RIA design. It’s a cool way to learn a little bit about Silverlight, AJAX or Flex, too.

Best of all, the event is only $20 and includes lunch, a T-Shirt and free beer after the sessions! You can’t beat that with a wiffle ball bat. Register now.

links for 2009-04-22

links for 2009-04-21

links for 2009-04-20

The Open Screen Project Bears Fruit: Flash in Your Living Room Coming Soon.

Last year Adobe announced a partnership with device manufacturers to bring the Flash platform to devices other than PCs and Mobile. There was some question as to what types off devices would see the widely distributed runtime first, though. It looks as though NAB this year sheds some light on that one.

Engadget, NYTimes, and the BBC both report that a number of television manufacturers have models coming in late 2009, early 2010 that will feature the Flash player for use in widgets, tickers, search and much more.

This is a big move for Adobe in getting to the set top world before Silverlight and is a big boon for Flash platform developers. Working in the embedded systems market opens a largely untapped market, with many Flash developers (here) expressing interest in getting into that large market. Look at this:

More than 420 million TVs, set-top boxes, and media players are expected to ship globally in the next three years and increasingly they are capable of being connected to the net.

That is a big big market to create content and content delivery systems for. I see casual games, small utilities, custom video channels and a ton of other great applications coming around the bend.

Another thing about this that excites me… Often we create video kiosks for tradeshows, museums, etc. consisting of a low-end PC/Mac Mini and a large screen touchscreen. These configs usually just act as a video jukebox of sorts with a small amount of network connectivity required. If it turns out that the sets with the Flash system can have custom content loaded onto them via network, USB or SD cards, this could dramatically simplify the way we develop these solutions. No PC required!

Do you have Flash content ideas that will benefit from this development? How will this affect your day to day Flash platform projects? How can you take this development to market in your niche?

links for 2009-04-17

links for 2009-04-16

Page 1 of 212