Flash vs. Flex: Why not skip Flex and use AS3's URLLoader + server code entirely? - apache-flex

I'm familiar with most of the Flash vs. Flex comparisons out there and most of them present some version of "Flex is better for RIA's while Flash is better for design work".
Yet isn't it entirely possible to write elaborate RIA's using the URLLoader class + server side code? In this regard, I'm unclear as to what Flex offers aside from a set of handy user controls.
The reason I ask is that I'm starting a fairly complex Flash piece that needs to take a lot of round-trips to the DB. I'm hoping to avoid introducing a new framework into the equation but don't want to get bit by performance, scaling issues down the road.
Thanks.
T

If all you need above basic Flash is to make HTTP requests to get data from the server, by all means, go ahead and use URLLoader.
Use Flex when:
You do want that nice GUI library. (This can be as simple as a desire to use Flex's automatic layout facilities, like VBoxes.)
You want to compile your app from the command line, like traditional software. (This is independent of the Flex framework. The Flex SDK build tools can also build plain old AS3 projects.)
You want to build your application in a traditional software development IDE, Flex/Flash Builder, rather than the graphics and animation centric Flash Professional environment.
Your UI is better declared in MXML than built graphically in Flash Professional.

Yes, I guess it would be possible to write RIAs using the URLLoader class + server side code - but Flex makes it easier to write them.
[Bindable]
I believe one of the major features that makes RIA development easier with Flex is data binding.
For example, you can easily assign httpservice.lastResult to the dataProvider of a DataGrid and forget about it. In Flash, you need to manually parse each time complete event is fired and recreate the dataProvider - while this might sometimes be efficient in terms of performance and memory management (provided we design it well), it takes some effort as compared to Flex's way of doing it with a one-liner.
Classes like XMLListCollection and ArrayCollection also makes things easier with flex.

Flash is meant for presentation/visual/pretty stuff. Flex is meant for data.
I beg to differ!
With the Flex SDK you can develop "pure" AS3 code that would do and look the exact same way that something you'd do with the Flash IDE.
Flex is an AS3 framework made for developing RIA's but first of all it's an AS3 framework.
Lots of Flex developers were using Flash before Flex/FlexBuilder came out. I just think that if you're into "pure" development and don't need all of the Flash IDE's drawing tools, you'll feel much more confortable with a text editor and the flex sdk.
I use URLLoader in my flex code sometimes, and other times I use RemoteObject or HTTPService, I don't think there's any rule for that.

If you're going to be making a lot of round trips to the DB, I think it would be a good idea to consider Flex since you'll be able to use the faster and less verbose AMF protocol rather than HTTP/RESTful protocols, which are generally slow and 'heavyweight.'

Flex provides a pretty decent set of UI controls, which saves enormous time when dealing with large amounts of data. Have you ever built a control in Flash? It's tough to do right and bug free. So that's the #1 reason.
Also Flex, and especially Flash Builder 4, have features existing and upcoming that better interface with data sources of all types..
Flash is meant for presentation/visual/pretty stuff. Flex is meant for data.

Related

Flex projects versus Actionscript projects

I have used Flex for about a year before deciding that I would rather develop Actionscript projects.
At the time, it seemed that the framework was too heavy for the kind of work I was dealing with, mainly small web applications , personal sites, portfolios this sort of thing. I also thought that Flex was like a odd hybrid , something targeting seasoned developers but at the same time , adding some function wizards that seemed to target beginners. It seemed overly complexed in some areas and way too basic in others.
On the other hand, the IDE was great , definitely no comparison with Flash CS IDE , so for me it made sense to stick to AS3 projects and use Flex , now FlashBuilder to write my code.
( I need to point out that I'm not a Flash designer, so working with Flash CS was never an option. )
It's been a while since I had a look at the Flex framework and I'm wondering about other Flex/Flash developers position on this issue.
Would you only consider Flex for enterprise level projects? What are the advantages of using one over the other? If you were a Flash developer and moved to Flex, what were your motivations? If you're creating both Flex & Actionscript projects , what are your choice criteria?
Edit:
Although I have received a great answer, I would have been interested to hear from Flex's users, what's your main practical motivation ( as opposed to philosophical :) ) for using Flex over pure Actionscript projects?
Preamble: my experience is primarily with AS3 projects built using a combination of the Flash IDE (FIDE) and Flash Builder 4 (FB4).
I generally prefer pure AS3 (PAS3) projects over Flex projects for the following reasons:
Size - Flex projects have a much larger minimum size than PAS3 projects. Not suitable for lightweight applications.
Performance - Flash is not known for its performance, and the layout computations required by a complex Flex application will hammer the end-user's machine. To them, things just end-up feeling slow, non-responsive, or "gunky". Unfortunately, this means that the applications where Flex might be most attractive (i.e. a very complex, adaptable, UI) are the exact places where it stumbles. In the end, you end up writing all this bizarre performance-enhancing optimization code that takes away most of the time you gained from using the built-in layout system.
Metaphor and Appearance - Flex aims to allow developers to provide end-users with a mature, flexible UI that has the same widgets and widget behaviors that they are used to from native applications. However, due to the performance problems echoed above, the UI never feels quite as nice or responsive as a native app. In addition, it's missing all of the OS-specific peculiarities that end-users are used to and will expect. I don't really understand the motivation to try to emulate native app development or behavior - you're never going to win that fight. Best to make something that stands by itself, which is what most native web applications are doing.
Flexibility - Dovetailing into the previous argument, Flash's main advantage is its ability to do things that traditional UI widget libraries can't do (at least not very easily). You can make some really, really novel UIs in Flash that just aren't practical to do in native apps without mucking about in OpenGL. Using Flex makes creating novel UI hard again (but it does make creating standard UI much easier, even if it is, in my opinion, sub-standard UI).
I'm curious if anyone has some good examples of Flex being used in any popular, public websites. Grooveshark is the only one that I know about (which is quite nice, but suffers from many of the problems I've outlined, especially on OS X where Flash performance is still poor).
However - it's a tradeoff. Always remember that your time is valuable. Your users might accept a slightly clunky, slightly confusing interface if it lets them do really cool things and that would mean that you could release it now as opposed to later. This brings is to the major downsides of PAS3 development:
Effort vs. Reward - You have to program all of your own UI. All of it. This can lead to some really, really bloated code where you have to define tons of event listeners for every button you want to create. I don't know how many times I've written various kinds of layout code specific to what I was working on. You can try to write your own abstract classes for these (which I have done), but at some point you're just going to end up re-implementing the Flex framework. Hardly worth your time.
Development - You can either use just Flash Builder 4, in which case you have to construct every graphical asset by hand in code (which takes forever), or you use the FIDE, in which case you can make lovely artwork but you're stuck with a stone-age code IDE and it takes forrrrrreeeeeeevvvvver to compile anything. Currently I use a hybrid setup where art generated in the FIDE is automatically imported into my FB4 project, but even that is not a perfect solution. They really need to be integrated better.
Another set of things to keep in mind: things that Flash sucks at.
Flash sucks at text. Do not try to re-implement a web browser inside Flash. Flash is actually quite good at displayed relatively small amounts of text that is unselectable (and, through the use of embedded fonts, is always pixel-perfect), but don't try to create large, expansive text documents inside your Flash project. First, performance will be terrible, and second, users will expect the text to behave the same way all other large text fields do in their native applications (most specifically, their web browser). Selecting text in Flash doesn't feel right because it doesn't feel how your OS does it.
Flash doesn't play nice with mouse and keyboard input - it constantly fights with the enclosing browser for focus. If your system needs either of those things, users need to click on it first. Don't fall into a trap where people will get confused because their inputs are going to the wrong place.
Flash is a performance hog - we've all heard this one, and it's not nearly as much of a problem as people like to think, but it does mean that you'll have to put a lot of thought into the performance of your system. Your UI should run at a stable 60FPS when being used and should not use much if any CPU when the user is not interacting with it. If your FPS dips below 60, then your UI will feel slow and gunky compared to native or HTML5 UI. Also make sure to watch for memory leaks.
In the end: user your head. Both approaches are just tools in your arsenal.

What is the benefit of using Flex?

Since Flex generates Actionscript.
Why not use Actionscript at all ?!
sorry, i'm just curious .
I agree with the points made about Flex being for developers and Flash being for designers, but that doesn't really cover what is going on in detail.
There are three main ways to produce a Flash application (SWF):
1) Using the Flash application - the timeline approach, mainly aimed at designers.
2) Writing pure ActionScript directly and compiling (either through an IDE such as FlashBuilder or from the command line), aimed at programmers with creative flare or designers who don't mind getting their hands dirty.
3) Writing 'Flex' - usually using an IDE such as FlashBuilder, but yes you can compile your Flex application on the command line. Flex is MXML (an XML markup) and ActionScript. As stated, Flex is aimed at software developers, typically those who have less focus on the 'creative' side (delegating this responsibility elsewhere, e.g. a visual designer).
There's a big difference between #2 and #3 though.
ActionScript is great for programmers who want to do highly interactive and graphical Flash application, for instance, some interactive demo or a game perhaps. To create a Flash app via ActionScript you would create an ActionScript file, add the meta data to indicate it is an application and the compiler will generate an appropriate and usually very small SWF file. There are some components available at the pure ActionScript level, but these are very lightweight compared to Flex and most of the work is done by manipulating Sprite objects.
Flex does a lot more. It gives the developer a rich suite of skinnable components with which to build applications, a component lifecycle, effects and data bindings to name a few things. I would say that Flex is more for rich applications for some business domain, typically in the format of a form based application, though you can do some very sexy things with it and can pull in resources created elsewhere (e.g. existing Flash resources).
A Flex application has a top level 'Application' object which is an MXML file containing a hierarchy of components. At compile/build time this MXML file is converted to ActionScript (lots of it! there is a compiler flag which keeps the generated ActionScript, see the docs for more info) which is ultimately compiled in to a SWF that can run in Flash Player.
For instance, you would add Labels, TextInputs, Buttons and so on to a Panel and add the Panel to the application. The user interacts with these components, and then the Flash app processes the input in some way and updates the view. Data binding allows you to mark an object as 'bindable' and then have Flex automatically update some other property when the bindable property changes.
Flex applications tend to generate larger SWFs, but that is because they are carrying the 'baggage' of the Flex SDK, though this can be mitigated using runtime shared libraries (a bit like DLLs for Flash, but is an advanced topic) or Modules, which are SWFs that will only run inside of a Flex application and not standalone. But the idea is that the application is loaded in to the client and is responsive without having to perform page-requests as in a traditional web application. The perception of loading time is improved by breaking your application up in to modules or using runtime shared libraries as mentioned above.
To be honest, I'm not doing Flex justice with my description, but hopefully I have made the differences much clearer.
Flex does not generate ActionScript. Flex compiles ActionScript.
At any rate, Flex is Flash programming aimed at developers (who don't necessarily like having timline-based vector editor as the main development environment).
Also, since Flex is a console application, you can include its functionality in shell scripts etc etc.
I think a rhetorical question best answers this:
Why not use raw machine code for all projects?
In more detail, the Flex Framework is indeed written in pure actionscript. It offers substantially more than actionscript alone, and like most frameworks, addresses a need for higher level programming constructs that are not offered by the language that they are written in.
Adobe Flex and Adobe Flash differs in only one thing:
According to Adobe: "Adobe Flash is for designers, Adobe Flex is for developers. Flex is released for developers who do not feel comfortable with timeline stuff. "
Adobe Flash is a powerful tool; however,
as more programmers became involved in
building Rich Internet Applications,
it quickly became clear that they were
not comfortable using drawing tools,
timeline and other visual panels to
create forms and other elements that
are common to the business
application.
Adobe Flex was created to solve this
problem for programmers.
See this video: http://www.adobe.com/devnet/flex/videotraining/xml/vid01.html
If you feel comfortable with timelines (i am not) then there is no difference at all. You can use Adobe Flash.
The Flex framework allows developers to write applications more rapidly than writing pure ActionScript. Flex is written in MXML, which is a 'convenience language' and has a lot of pre-built components for writing business applications.
However if your goal is for creative purposes only, Flash would be a better tool for the job. But if you're asking between AS3 and Flex, I presume you're not tweening things in a timeline, as you would in Flash.
If you start using Flex, you will find that you must know ActionScript to give your app functionality that's not provided out of the box. Also, knowing ActionScript will be beneficial to both Flex and Flash worlds (and you can also write pure AS3 apps as well, but very few folks do that in my experience).

Disadvantages of a Flex project vs an Actionscript project?

I've recently started making a game in FlexBuilder. The game is currently a Flex project.
Is there any downside to using Flex as opposed to just Actionscript?
A friend of a friend told me that Flex is slower than an Actionscript project. I've been unable to validate this on the internet; is there any truth to that claim?
Thanks!
If you're developing a game, you should be using an ActionScript project. Flex is to be used only for data driven applications and user interfaces.
The flex compiler generates a lot of intermediate code to convert mxml files into actionscript (you can view those files if you compile with -keep compiler option). This code, the flex framework incorporated to your SWF, adds significantly to the size.
Create an actionscript project with a textfield ("hello world") and a flex project with a label with the same text. Build them, go to their bin-debug folders and compare the file sizes. While actionscript one is only a couple of kilobytes, flex swf would be at least a 100 kB.
As far as speed is concerned, since the flex framework is sitting on top of actionscript, it obviously would have a performance downside.
The beauty of flex lies in the easiness to create UI components and developing data driven applications that frequently communicates with the server.
Don't use it unless you truly need it.
If you know flex and it helps you developing faster - do it in flex.
Download size doesn't matter for game with a lot of assets. Most popular flash games have size of 5 MB and more. (for example on kongregate)
Crucial part of game you can make in pure actionscript. Placing hundreds UIComponents to Canvas could doesn't slow in Flex, but Flex rending technology prevent smooth animation of objects.
Conclusion:
Flex is for rapid development. You can use it's easy skinnable components for menu. Even without Flex UI components binding is matter and makes life easier.
Download size = speed on the Internet. The smaller you can make your game, the faster it will load. Size also equals speed in an interpreted language like ActionScript, where the less code you have to execute, the faster it will run. Hand-coding an ActionScript routine might let you make it faster than the generalist approach of Flex.
That said, maybe you'd be willing to pay that overhead to avoid having to write a lot of utility classes in pure ActionScript. Your high-score screen would be easier to do in Flex, for example, and that might be worth the overhead to you. It won't matter if your high-score screen is a little slower, since it isn't a real-time thing like the actual game.
Also consider the cost of your time. By using Flex, you'll be done with those parts of your app faster than if you hand-code them in ActionScript. Unless your time is free, you should be thinking about how this trades off against the bandwidth cost of the Flex overhead. It might be that it's cheaper to pay the bandwidth than your time making a more efficient program.
A Flex Application won't necessarily run slower than a Pure AS3 application once it's fully loaded - everything gets compiled down to bytecode in the end, and a Flex App is like an AS3 app that uses a LOT of other classes.
Think of the Flex Framework as a set of shortcuts that allow you to do things much more quickly, but the real cost is that your project gets filled up with a LOT more code - even if you're actually writing less code, and you never have to see the additional code.
I would disagree with the assertion that Flex should only ever be used for complex data-driven applications, though it's certainly very useful for such projects. You can use it for anything, as long as you understand that the final product (the .swf you export) is going to be a lot larger than it might otherwise be.
If having a large .swf is not that big a deal to you (and it might not be, depending on what you're doing with it) then I'd say give Flex a try because ArrayCollection, RemoteObject and Data-Binding will save you hours of frustration and hundreds of lines of code.
However, if you want to make sure your final app is as small and efficient as possible, do it in pure AS3 and simply opt-in to more advanced libraries as you need them.
Flex provides a framework for building Rich Internet Applications. If your game requires a complicated GUI (such as an RPG), it might be useful. Otherwise, it adds layers that will complicate things if all you want to do is build a game.
As said above in the first point the only beverage is memory consume. But if u write in pure AS script you need to be in deadline combat. As flex provide lots of customizable comps. U can use Class files instead of MX Comps that save the Memory. Do not Create any components unless it is being used. Modules and RSLs are avail to acheive the peretainity

Flash versus Flex

I've tried looking everywhere for a concise list of the advantages and disadvantages of using Flex vs. Flash.
Coming from a programming background, I absolutely love Flex. It's easy to pick up, and since it can use flash classes, why would I want to use Flash without flex?
Flex:
Pros:
good for RIA development
provides many user-input options out of the box
Build in lay-outing system
the MXML is easier for non-programmers
You can quickly combine components to create small applications
components can provide an advantage in large-scale projects because of their modular
nature.
can be developed using linux
has a nice component lifecycle for validation, etc.
Cons:
increases the size of your .swf
Customizing the look of components can take a lot longer than anticipated, depending on the visual style you're looking for
when you find out you need a custom component that doesn't exist, you might need to go back to Flash to do the real programming work and packaging of the component
The "flexibility" of Flex means you will be reading a lot of documentation
Bugs in the Flex framework
You eventually will need to compromise with the architecture of the Flex framework
Flash
Pros:
good for making movies/animations
Timeline can be easier for designers/animators to conceptualize
when working from scratch, provides a great deal of control.
easier for someone with a programming background
You can program whatever you like; no compromises with existing frameworks
Cons:
only provides basic user input (text box) out of the box.
timeline can be daunting for programmers (although you can quite safely ignore it)
Development of certain types of applications will be slower than with Flex
can't be developed using linux
user input validation must all be handled in the code. No built-in validation.
need to implement your own lay-outing system
Please correct me if I missed anything said so far.
Flash and Flex both use the same underlying rendering engine, just with different front-ends. Flash is better suited for making movies and animations. Flex is better for application development.
From a programmer's viewpoint, the big difference between Flash and Flex is not so much which IDE/application you use for programming, but whether you program in ActionScript (AS) only, or use the Flex framework and MXML to program your applications.
I would say pure ActionScript is better for programming (whether you use Flash IDE or Flex IDE is not that relevant), and MXML is better for non-programmers to combine the components programmed in AS.
I would add to your list these pros/cons:
Flex:
Pros:
Easier for non-programmers to get into application development
You can quickly combine components to create small applications
Components can provide an advantage in large-scale projects
Cons:
Customizing the look of components can take a lot longer than anticipated, depending on the visual style you're looking for
When you find out you need a custom component that doesn't exist, you might need to go back to Flash to do the real programming work and packaging of the component
The "flexibility" of Flex means you will be reading a lot of documentation
Bugs in the Flex framework
You eventually will need to compromise with the architecture of the Flex framework
Flash (or Flex IDE in ActionScript project mode):
Pros:
Easier for someone with a programming background ;)
You can program whatever you like; no compromises with existing frameworks
Cons:
Timeline can be daunting for programmers (although you can quite safely ignore it)
Development of certain types of applications will be slower than with Flex
In short: pick the right tool for the right task.
Flex is a library of code written in ActionScript3, so it adds lots of capabilities and standard-library-like stuff to Flash. The downside is that it a is a huges amount code that gets included into your application. If you use any Flex at all in your app, the download size of the SWF goes up by 100's of K.
If your application has any kind of user interface widgets, then you almost have to use Flex as Flash itself only has the most basic things like text boxes. Flex has a whole XML GUI with layouts, data binding and XML setup etc.
Doing that in flash, you end up having to write from scratch things like list boxes...
In my opinion, the most important feature of the Flex framework is the component lifecycle, which provides a really elegant model for validation/invalidation of properties, component size, and hierarchical rendering.
The benefit to developers is that it creates discrete application phases for business logic and rendering, avoiding expensive geometry & rendering code until the last possible moment before drawing a frame.
Here's a really good presentation, explaining how it works:
http://tv.adobe.com/#vi+f15384v1002
The model is so well-designed that the component lifecycle remains almost entirely invisible during the majority of Flex development, when you're using the framework default components and containers. You only need to learn the inner-workings when you start developing your own components.
Developing in the Flash environment, or in pure Actionscript, you don't get any of that. Anyone developing pure AS3 applications either needs to code very carefully to separate business logic from rendering, or will suffer severely decreased performance.
[...] why would I want to use Flash without flex?
Flex is a new product, whereas Flash existed from the Macromedia days. Designer, animators and most anybody who is not brought up on a staple diet of programming education will probably find Flash easier to master than most other such solutions.
Target is different.
Flex is more dedicated for programmer while Flash is more friendly to Artist / web designer.
Flash is the IDE used (generally) to create animations and things that work well on a timeline.
Flex works better for creating internet applications which have interactions more akin to a desktop.
Why use Flash? Well, if you need to do something more specifically attached to a timeline, of course!
I see Flex as more of a solution for doing RIA applications where you need to develop application based solutions. There's quite a lot you get right out of the box with using Flex but it also comes at a price in terms of file size, granularity, etc.
If on the other hand you are working on a totally custom solution such as a game then perhaps Flash is the way to go because you can start fresh with a blank canvas. Many people still use Flash because they don't need all the app based bells and whistles of the Flex platform.
I like the freedom of Flash, and its really simple to embed assets in Flash, a little more confusing to do in Flex.
One thing that I love about flex is the ability to make a fluid application with minimal effort. Which would take forever in Flash.
Anything you can do in flex you can do in flash, just may take a lot longer to do. You can't do everything in flex that you can do in flash though.
Flex takes care of all the UI programming for you and lets you focus on the business logic, with flash you will spend a majority of time programming the UI.
You can develop Flex applications under Linux easily but with Flash you simply can't.
Another solution that was not suggested at here, will be to use them both. You can add flex components to flash movie clips using ContainerMovieClip. And you can add flash movie clips to flex components using SpriteVisualElement. Another thing that wasn't mentioned was lay-outing your application. It will be flex pros against flash disadvantage, because you got build in flex lay-outing system. But again when you are using them both, you can layout your movie clips with flex lay-outing system.
Also flex become Apache top-level project. And it become more and more excepted by the community now.
Flash and Flex are 2 complete different things, one is a design tool with support for action script, the other one is a framework that also has action script but is maily built around MXML which is a XML based UI definition "Language".

When should an oldschool flash developer use flex?

What are the key differences between Flash and Flex? I have over five years experience with flash and feel very comfortable developing with it and ActionScript3. I find myself more and more curious about Flex and want to know when it is best to use flash or flex. Also, is everything that can be done with MXML, able to be done with AS3? I have a strong understanding of AS3 and OOP and would like to know the diffrences between using AS3 and MXML in Flex.
Flex is great if you quickly want to build a UI, you can mock up a functioning UI in a couple hours. Since it still can be limiting for some custom UI's it's not perfect for everything but if something should "look" more or less like an application and fit in a grid it's super quick to mock up the UI in MXML. Also don't be intimidated of how most Flex apps look (ugly, imo), you can customize everything or easily create your own components.
Putting actionscript in mxml is the same as putting css or javascript in html = really bad. Unfortunately even Adobe has this in multiple examples (probably mostly because it's easier & faster for demostrations).. My personal opinion is that this applies to bindings too, as i don't want to put my data in the UI (mxml).
As an experienced developer I'm sure you don't do any development on the timeline (to clarify the Flash = timeline misconception). Still with Flex you have the UI separated in a framework that handles a lot of the burden with layout so that you can concentrate on the business logic. The rest of the workflow is close to what you probably already have with Flash.
It depends on what kind of applications you are developing now with Flash. I have been a Flash developer (mainly applications) for 7 years. I must honestly say that I was extremely glad when Flex 2 was released because it had the component framework (good components, layout managers, ...) I did not have in Flash. This is IMO the biggest difference between Flash and Flex (or the Flex framework).
MXML is a real blessing, especially when using data binding. In the end, everything is compiled down to ActionScript (check the -keep compiler option), but MXML just saves you so much time.
Flash and Flex provide different ways to produce different things. I am not familiar with Flash, but I would expect that it is dependent on a time-oriented way to produce something, whereas Flex is geared toward more traditional software development. That is, rather than dealing with time and frames in Flash, one is dealing with describing where components should be placed with MXML and how those components work with ActionScript.
One should also be able to write a Flex app with just AS3 and no need MXML.
The main difference between AS3 and MXML in Flex, as far as I know, is that MXML is not intended to be used with application logic, but rather it is intended to be used like HTML/CSS in web pages and puts components and content onto the Flex app. ActionScript is used to program behaviors, components, and other things outside or what MXML does. Thus, if you want to attach an event to a component one would write ActionScript code.
Hope that helps. I am still learning about Flex myself.
Some other differences that come to mind:
Flash allows you to create graphical assets and then work with them immediately. To use those same things in Flex, you need to use Flash to export them to a swf or swc first.
Flex has a layout manager, so applications that have variable window size are waaaay easier to make. For instance, you can take a window and set it to 90% width of the window, and it will change size... not scale mind you, but actually change its width as the window is made larger or smaller. This is not easy outside of the Flex framework.
Data Binding in Flex is a huge timesaver. It essentially creates all of the code you'd need to write in AS3 by simply saying blah="{foo}" The curley braces denote "bind to this".
The Flex Debugger is vastly superior to the Flash one. There is also a Profiler.
Since I started with Flex and not Flash, I'm not sure what kind of IDE is best for Flash dev, but the Eclipse based Flex Builder is quite nice. The code hinting is great. Subclipse integration is great.
Really, Flash and Flex are different beasts. You should know and understand AS3 if you want to use Flex, and since you do, you're in a perfect position to take advantage of Flex's features. Flash is not going anywhere as a tool for making more visually creative pieces, but Flex offers a lot of advantages for application development.
I prefer Flash IDE vs Flex (aka Flex Builder aka Flash Builder for my comment)
In general i would say it depends on the size of the project.
I find it easier to start and finish small projects quickly in Flash.
I would advise Flex for larger projects because it has various debug tools that can save you plenty of time (although i would still just use Flash my self)
But maybe if you really get used to flex, that might not matter.
some Cons of Flex from my experience.
When working on a team of 4 on a
large project, Flex failed to keep
the project
settings from one computer to another. (we shared files using SVN)
Flex constantly conflicted with SVN for us.
I felt distant from the art assets.
some Pros of Flex
being able to follow variable references from one class to another at the click of a button.
being able to easily see many variables while debugging. w/o needing to trace them.
and Flash used to not have Custom Class Code hinting, but now with CS5 it does.
I think you can use the newest features of Flash Player w/o waiting for a new Flash CS#, for example MoleHill (a new 3d api that uses the GPU) has a beta release out right now. and i think the Flex SDK can already use it.
hope this helps.
it should be noted that I am a rare case that doesn't prefer flex, most people strongly prefer flex, so you should give it a try at least.
MXML compiles to action script so it's really like a higher level version of that. So, yes, everything that can be done with MXML can be done with actionscript (but not the other way around).
Flash CSx:
GUI\Layout: Basic GUI class framework
Graphical Content: Great for editing graphical library objects with or without animation
Code: Lacks a good code editor
Flex/Flash Builder + Flex Framework:
GUI\Layout: Advanced GUI class framework and layout engine (Flex)
Graphical Content: Lacks drawing capabilities of Flash, but you can include Flash generated graphics by exporting them for ActionScript into a SWC and importing/referencing the SWC in Flash Builder.
Code: Much better code editor than Flash; not sure if it's on par with FlashDevelop
Other: Supports MXML, which is basically just another style of laying out content. Instead of writing a bunch of "c = new C()", "c.prop = x", "c.addChild"... you can structure display objects and thier children using XML constructs, and the MXML compiler will convert it all back into the less-readable, but basically the same AS3 code.
These technologies are all related and interoperable. They are natural and predictable extensions of the Flash player and ActionScript techonolgies, but for some reason Adobe developed the Flex/Flex-builder/MXML technologies as a totally separate product, and market it as something totally new and oh-so-amazing. Whatever. So now we have to go back and forth between the two to use all the features, which is LAME. They also have to waste time and resources developing unnecessary, but helpful, packages like the "Flex Component Kit" to reduce the number of steps necessary to get Flash content into Flash Builder.
You have to go back and forth between these applications, because of their mutually exclusive features -- Flash Builder lacks graphics editing, and Flash CSx lacks MXML and a good code editor -- but they're interoperable in the sense that you can use Flex classes in Flash, Flash classes (and their embedded graphics) in Flex, you can use Flash Builder and MXML without Flex, etc.
I think they need a single, truly integrated Flash IDE, so they need to merge Flash Builder into the Flash CSx editor.

Resources