Macromedia Flash 7.0: RAD or BAD?
After hearing a lot of noise from the Macromedia community about the latest release of Flash and reading a lot of the hype, I was actually pretty excited to see what it could do. Yes, my intuition told me, "Macromedia can't possibly have gotten it right this time." But, there were these thoughts creeping around in some dark corner of my mind that kept whispering, "Maybe they did..." So, after much deliberation, I downloaded the Macromedia Flash 7.0 (2004) Professional Edition trial, so that I could put the debate raging in my mind to rest.
Launching the program, I quickly discovered that the UI looks pretty slick. I guess it is pretty similar to the MX UI, but the proper application of gradients here and there add quite a bit. What was even cooler was all the options I have when I selected "File | New...", the two that really caught my eye were "Flash Form Application" and "Flash Project." So, I began to think, maybe the hype was true, Flash now includes project support and support for form based applications, which both sound like a huge jump in the right direction.
Flash Form Application... Click.
One quick look at the screen told me something wasn't right... where was the new UI? Yah, I saw an additional panel added to my screen, but I still had all my drawing tools and an animation timeline cluttering up the screen. "Oh well," I thought, "one strike isn't too bad, I could just hide that stuff if I really didn't want to use it.... now where are these flashy components I've been hearing about?" Examining the panels on the right side of the screen, I found the "Components" panel. I guess you could say that it is pretty similar to the VS.NET toolbar, a list of available components is displayed, along with an icon and a text description. Like VS.NET, you can also double click to add the item to the form, or drag it directly to where you want it to appear. Unlike VS.NET, however, there is no "Add Tab.." or "Customize Toolbox..." options to easily snap in some third party component (I assume a simple installer will do the trick, but when doing internal dev in VS.NET, I am constantly adding tabs ad-hoc for individual projects that have their own custom UI components).
DataGrid... Drag... Drop...
My form now contained a box with some gradients on the top and left side... it didn't look like a grid, but there wasn't any data bound to it, so no biggy. However, the grid was definately too small. The grid was selected, but where were those cool resize blocks on the corners? Not there...
Right Click... Free Transform
Now, I found the resize tool... and, to my suprise, resizing the datagrid actually worked. It didn't scale like a movie clip, the header and scrollbar repositioned correctly without enlarging themselves. Neato. It was a little painful to do that extra click, but nothing I couldn't handle. Glancing through the list of available components, I noticed a window control. "Sweet," I thought, "now I can make a slick little dialog box with a form in it".
Window... Drag... Drop...
Now that I had my window on the screen, I had to add some controls.
TextArea... Drag... Drop...
Button... Drag... Drop...
"Wait," I began to think to myself, "How do I make these controls stay on top of this window when I drag it around?" In VS.NET, this wouldn't be a concern. Dragging items onto panels associates those items with that panel and you are good to go. However, the lack of UI feedback when I tried to do this told me that I wasn't going to be so lucky with Flash. I compiled the swf, just to make sure, and sure enough, the window dragged, but the controls were left behind. After searching through the UI, I couldn't find any options to attach controls to other controls, but I did find a "Insert Nested Screen" option. From the looks of things, this was going to work. When I dragged around my window in the UI, the controls moved with it. However, compiling exhibited the same behavior as before. After 10-15 minutes of looking around, I just gave up and decided to create a plain vanilla form.
It didn't take too long to drag my form items into place. The auto-snapping features in the UI where really slick. As you begin to drag an item on your form, guides appear when you position your control next to another, enabling you to quickly snap UI components into place. As a simple test, I wanted to create a standard mailto form. Unfortunately, you can't just double click a button and have an event handler pop up. Common actions are accessable through the "behaviors" panel, which contains all sorts of useful little dealies, but not a mailto command, so I needed to resort to hand coding (again, not a big deal, I would have done the same in VS.NET...). Unforunately, the behaviors panel (which is equivalent to the events panel in VS.NET) doesn't let you add a custom action, you only get to choose from Macromedia's preset list. It took me a few seconds to remember how and where to insert a custom action (you can't just say, "button.Click+=myHandler"), but I've used Flash enough times in the past to locate what I needed and add the event. ActionScript is fairly limited because it is a client-side, player only, scripting language (hey, the entire runtime fits in a 400k download). You can't send any mail, so that mailto form just isn't going to fly. I suppose you could create an ASP.NET webservice on the background and send your message via a SOAP call, but I'm not sure if the average flash dev. can do that (plus, you have to fire up a second IDE to do all your work, as well as work with two seperate sets of projects, which is a pain).
Oh well... I decided to play around with the components. Supposedly, there is a new component architecture in Flash 7.0 that completely changes the way components work. Components are now derived from a base class, which provides them with a bunch of misc. events (such as draw) and methods (such as invalidate and redraw). Still, the base class doesn't even contain properties as rudimentary as "visible," so the end result is that you can't even set the visibility of components programmatically (wait, let me clarify... the components that ship with Flash 7.0 sporradically support a visible property... some do, some don't...I haven't really discovered any consistancy there). Also, even though Macromedia took the timeto revamp the architecture, there still isn't a nice event model, so you are pretty limitted in what you can do (especially since you are probably going to hand-draw everything, which eliminates a lot of UI customization from your component that could only be done programmatically). This, of course, is probably why the components that ship with Flash have only a handful of properties. You can set text here and there and add some items, but that is the extend of what you can do. Without support for attributes, there is also no way to group common properties together in the property browser (a la CategoryAttribute), but I guess it isn't a big deal when you only have two or three anyway.
Didn't take too long before I was bored with components and moved on to projects. The first thing I noticed was that there is no way to add an item to a project, unless it already exists on the disk somewhere. You can't right click and select "Add New Form..." or "Add New Code File...", you just get one option: "Add File(s) to Project." Looking through the menus, I was able to locate the standard new file dialog, but going through the dialog and creating an item doesn't actually add it to the current project. You must first save the file, then add it manually.
If you're planning on doing a lot of coding in Flash, you probable want to use code (.as) files to store your code. This way, the data isn't baked into your FLA, and you can use an external editor to do your editing. Why would you want to do this, you ask? Because the fact of the matter is that the Flash actionscript editor has always blown chunks and the 7.0 editor is not any better. No auto-complete, no class browser, just visual notepad with some syntax highlighting.
So, my general impressions of Flash 7.0... not impressed. Macromedia has improved a lot of things, but it is still very apparent to me that Macromedia does not understand developers in the slightest bit. How do you add project support but forget to include the ability to add new items to your project? How do you revamp your component model, but forget to include elementary properties such as "visible" in the base class definition? The answer is pretty simple, you just don't get it. Macromedia is still a designer focused company, and Flash is still a designer focused tool. Developers tread lightly...