Thursday, March 25, 2010

My Journey into using efflex

As I tried to introduce powerful animations to personal RIA project, I came across this project called Efflex. The demos showed a lot of potential. I was very impressed with some of the nice features to improve ViewStack selection (particularly the Flip3D and Cube3D demos). As my excitement drove me to use it, I found so many problems integrating to it, particularly with the following:
  1. There were no SWC files to use (the 2 provided never worked). 
  2. Building the source required FlexBuilder as well as to understand the project layout.
  3. Some of the code was not committed, hence the compilation failed in so many ways.
  4. There were dependencies that were not documented.
I took this as a personal challenge and I can happily report that I made it work. I'd like to describe what I had to do to make it happen in case others go through this problem (as I suspect it's the case based on some of the postings I read on the site).
As of the writing of this entry, all what I'm about to describe remains true. I have found some postings with instructions for a old revision of the efflex project. Things have changed a bit, particularly with flex4 and Fb4 (now out). For the purposes of this writing, it's important to point out that all these problems occurred in trying to use the CubeAway3 effect.

Attempt 1: I tried the obvious: using the SWC files found on their site. Of course, this didn't work at first.  I was trying to use the CubeAway3D effect.  Fb3 kept on reporting compilation errors (primarily on a missing type).  As Tink (the author of the library) suggested to use the source code and build it yourself (post found in the efflex site), I tried checking out the source code and importing it into Fb3.

Attempt 2: The import was somewhat troublesome as the source code (from svn) was not complete. I mean, there were missing classes (apparently never committed). Also, I found some classes that required some dependencies that were not documented anywhere. These were away3d, papervision3d and tink (the last one was simply a utility project).

Attempt 3: I imported the source code of away3d. This didn't take much time to fix, other than to ensure that I was compiling for flash player 10. Once that was fixed, I generated a SWC.  Success!

Attempt 4: I imported the source code of papervision3d.  Luckily this didn't cause much problem either. It was pretty straight forwar, however any documentation on this would have helped (in lieu of a SWC).

Attempt 5: I checked out the source code for tink. This was apparently another utility project developed by the author of efflex.  Fine, I accepted his philosophy, so I moved on. Luckily it compiled fine.

After doing all these, I decided to remove the non compiling classes (from the efflex project). I decided that as I checked this out from svn, I can recover them later (when their needed classes are committed). This helped compile and generate a SWC file which I was now able to use.  As I tried it, my CubeAway3D effect worked like a charm. It was very rewarding to see my ViewStack more vividly, nonetheless, I think we need to evaluate better how we can improve some of these projects.


Ирвигон said...

"This helped compile and generate a SWC file which I was now able to use"
Can you please save us all the trouble and upload this SWC file somewhere? I will be most grateful.

Alberto A. Flores said...

Here you go.

Anonymous said...

Any chance you can provide the source as well? There are some effects that I would like to use (CubeAway3DTile, FlipAway3DTile, TileMask), that don't seem to be available.


Alberto A. Flores said...

So I could post mine, but really, most of the code related to the Tile effect was incomplete. In fact, I noticed that there was some code that was not committed in SVN. The way I fixed it was by removing those files (Tiles) and re-compile. I figure tink would commit his files when he is ready. You may want to send him a note asking when those features are committed.

I'll try to keep checking his SVN commits later.