Php – Flex + PHP: Flash Builder 4 vs. Eclipse

apache-flexeclipseflashidePHP

I'm getting started with Flex and initially installed the Adobe environment (Flex Builder 3) and later found out that they're starting to call it Flash Builder 4.

Anyway since I'm very new to this technology and I have to leave Flex Builder 3 anyway, I'm trying to find out if there are any advantages to developing with Adobe's Flash Builder 4 (adobe's commercial IDE) vs. Eclipse (which Adobe seems to also heavily support, they make and support a special plugin for it).

My main language is PHP so my end goal is to integrate Flex with PHP. It sounds like Adobe did a decent job with integration in the Flash Builder 4 release (you can choose a language and choose data services options, etc. which should make that integration smoother), but is that integration only available through their commercial Flash Builder 4 or is it also available through the plugin they release for Eclipse? I'm trying to get some advice from those who used the technology so I can make up my mind whether there's a lot of advantage using Adobe's commercial IDE vs. the very robust open source Eclipse IDE. Other aspects I may not have considered are also welcome.

Note: I use php without a framework, and I keep also hearing Zend from Adobe themselves, which is kind of confusing too. I guess they're using part of the zend for remoting. Does anyone know how zend will affect my flex development environment?

Best Answer

Flex Builder and Flash Builder both function as Plug-ins to Eclipse, though each also comes in a "stand-alone" flavor - which is still eclipse, but with a lot of the Eclipse functionality torn out for a smaller footprint.

What you want to do is pretty simple - get eclipse set up, install PDT or whatever your favorite PHP plug-in is and then install Flash/Flex Builder into that same instance of Eclipse. Make sure when you download FB you choose to download the "Plug-in" version instead of the stand-alone version. When you go to install it, it'll ask you where you want to install it - pick a location, and hit next. It will then ask you if you want to plug-in to an existing instance of Eclipse or use the bundled Eclipse (at least Flash Builder comes with a Bundled eclipse). Opt to select an eclipse version and point it toward the Eclipse install that has your PHP coder plugged into it.

If all goes well, once it' done you can open Eclipse and then switch views between Flash Builder and PDT all within one instance of Eclipse. I do this with Aptana, it's very handy to be able to do your HTML, PHP and AS3 all in one editor.

Good luck!

Also [edit]:

Adobe promotes Zend because of a Zend plug-in called ZendAMF. ZendAMF is the spiritual successor to AMFPHP - basically, with a little bit of setup you can create a dev environment where you are able to call PHP functions right from your AS3 code. You can set up a ZendAMF Class, for instance, called getUsers() which then queries your DB and pulls out a list of Users. You can use that to populate PHP ValueObjects, and then it will pass those VO's back to Flex in binary (much, much faster than XML) and if you have it set up correctly they will be data-typed as AS3 Value Objects of the same type.

This is very useful because it's all very transparent - you can then write an AS3 function called getUsers() which returns an Array of value objects, set it up to quietly call your PHP which calls the database, and have it return a value as though it were just all AS3 from start to finish. A bit tricky to set up, but once you're rolling there's really no going back! :)