Why is accessibility turned off in Flex by default? - apache-flex

I'm a blind developer who is considering learning Flex. According to this link when you compile a flex application with the defaults it isn't accessible to screen readers. Why is this, are there performance issues I should be aware of, or was this just an arbitrary choice Adobe made?

I think thats because it would increase the size of the compiled SWF, but I have no detailed information about this topic.

Simple Flex applications (like the samples) will benefit from having accessibility enabled. Unfortunately a large / complex Flex app requires a lot of effort in the design and implementation phases in order to be made properly accessible; it's not as simple as just enabling that one checkbox in Flex Builder. For this reason I'm sure Adobe decided to optimize the size of the SWF files generated by Flex Builder by disabling accessibility by default. More info on Flex accessibility can be found here:
http://www.adobe.com/accessibility/products/flex/

Related

Why people write Flash video players in Flex not in Flash?

One common hebavior I observed in my slow Internet connection is that most sites on the Web embedding Flash Video, their player is always written in Flex. I can tell by the extremely long loading scroll bar that Flex defaultly provides. From my experience Flash loads faster, Why do people stop writing stuff in Flash anymore?
Are there any fast loading yet rich feature Flash video players>
My experience is that the components provided by default in the Flex framework are more stable than the ones provided in the Flash IDE. So I'd prefer to use the Flex components simply because it means less time debugging problems in the actual component code. It is however true that players based on the Flex framework tend to be heavier in terms of download size. But since video is bandwidth heavy and people who watch video over the net tend to have good bandwidth these days, I guess the conclusions most developers come to is that the extra download size is an acceptable tradeoff for less time spent in coding boilerplate.
Personally, if the requirements state that the player has to load fast and be light weight then I always roll my own in pure AS3 and just implement exactly as much as is needed. But if there is no such requirement, then I'll use the Flex-components as a base and do customization from there.
As for the second part of your question, sorry can't think of any open source fast loading feature rich flash video players right now.
Flex produces a flash movie (swf), so the end result is still flash.
As for the reason behind it, not everybody has or wants Adobe Flash (Studio) or any of the other timeline based studios.
Flex enables anybody to create a flash based application or widget using XML and the free Flex SDK.
There may also aesthetic reasons such as standardised controls.
Try Flowplayer, JW FLV Media Player and the last contender, but not the least from Adobe - Strobe Media Playback http://www.osmf.org/strobe_mediaplayback.html
From my experience Flash loads faster, Why do people stop writing stuff in Flash anymore?
When done correctly, there's no difference in how they work - in fact, I'd argue that stuff done in Flex (specifically, using the Flex SDK) give you more freedom to control how loading is done.
But to answer the question, people stopped using Flash just because there's much better stuff out there. Flex Builder, FlashDevelop, FDT - they're all much better tools for any serious coding and debugging. I used to love the IDE, but now I can't fathom how would anyone do anything serious on it, even when using external code editors.
Flash still works when you need vectors, or to create a library with some embeddable assets, but that's pretty much all it's useful for nowadays.
I am a flex developer, see flex is somewhere flash, here flex has two frames, preloader stage(first frame) and creationComplete stage(second frame), the same frame concept as flash has, but flash has more than two frames and layer concept is also there
Major differneces comnes in the ease of using the components in flex, in flash, altho flash is one of powerful tools that has changes the web,
but flex gives the freedom, i m using flex, so i know that i can give more time on business login development, rather than concentrating on design aspects,
but it's also true, i have to see the design aspects as well in flex,
so happy flexing

How to improve the performance of Flex App?

I am working on a flex application.The application occupies 100% of the browser screen, but it is slow to load.How should i improve the performance, what are the best techniques one should follow for improving the performance of a flex App.
I did try some stuff though, i am not using relative layout instead i am using absolute layout and putting the buttons/images etc at exact places in a Canvas, still i feel it is slow.Can i profile the App or flex code to see where exactly the app is taking the maximum time to execute.
Adobe offers a great article about this topic: Flex Application Performance: Tips and Techniques for Improving Client Application Performance
Here are some great resources on improving performance of not only your Flex app, but of Actionscript in general:
Quick as a Flash Presentation by Grant Skinner - Optimizing Actionscript
Round up of Actionscript and Flex Optimizations
Flex Application Startup Performance
Actionscript Performance Tuning
Overall, some key things to always do:
Keep nesting thin: Don't nest too many VBoxes and Canvases, that will make your app dramatically lag/freeze
Don't Embed: Only embed things that are very small and need to show up immediately (icons in skins for example)
Deferred Instantiation: Only add what the user needs to see. Everything else will wait until the user goes there.
Explicitly size all item renderers. If DataGrid item renderers aren't explicitly sized, your app might freeze for an instance when constructing it.
Optimize Assets for the Web (icons ~< 20k, large images ~< 200k as a rule of thumb).
Refactor to remove excessing curly-bracket Binding (width="{something.other.width/4}"). Causes a bunch of events to be dispatched that you likely don't need. Too many events == too many temporary objects == lag.
People recommend using Modules to decrease swf size and only load what you need, but if your application isn't as large as a CMS, you generally don't need them.
Flex Builder Professional has a built-in profiler that works pretty well for profiling your own code. If the problem is drawing performance and layout, it's not as helpful (it profiles the code just fine, but it's harder to understand the results and apply them in a useful way to changes in your code).

What is the difference between Flex and Flash CS4?

What differences are there betwee Flash CS4 and Flex, besides the GUI of Flash?
"Flex" isn't the application, "Flex Builder" is. That's important - "Flex" is a framework. Asking the difference between Flash and Flex is a bit like asking the difference between JavaScript and JQuery.
Flex Builder is an eclipse-based code editor that has built-in support for the Flex framework. The Flex Framework gives you a powerful set of tools for working with data - these tools are generally speaking not available in Flash.
If you're doing something really complex that deals with dynamic data, it might be worth considering using Flex instead of straight up Flash.
It gets a little confusing, though - you can use Flex Builder as your ActionScript editor in a Flash project. In other words, you still have the .fla but you do your coding in Flex Builder instead of Flash. The reason many people do this is that Flex Builder provides a much more robust code editor. For instance, you'll get code hinting for custom classes - which is an enormous timesaver if you're building something even moderately complex.
I hope that helps! Both Flex Builder and Flash are powerful tools, I'd recommend playing with both of them to get a sense of what you can do with each.
Flex is a programming environment, with a proper programming IDE like you'd find for Java. It's focused on software development - the fact a Flex app is compiled to a Flash SWF binary is almost irrelevant.
Flash CS4 is an art/graphic design tool. It allows you to do some coding, but this is focused on tagging code onto animations. It's a bit like how you can do coding in MSAccess - it's allowed but not the main focus, and the development tools are not at all geared at coders. In fact you have to learn how to even find the code in CS4.
Bottom line, if you are a programmer then Flex will seem natural. CS4 won't.
Flash is more focused on animation (comes with a library, etc.) and Flex is focused on web application development.
A nice article covering Flash and Flex can be found here.

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".

What features distinguish Flex from DHTML?

I just got started using Adobe Flex SDK. I was very excited because it's the first time I've found a good, free way to create Flash applications. But then I noticed something: Flex doesn't seem to be much about making animations or designs. It seems more like an application to build forms and menus and the like... which I can already do in (D)HTML.
What features does Flex have that make it better than HTML in some cases?
Also, are there any techniques/software programs that would allow me to add the flash/design components that I mentioned earlier?
Thanks!
Flex, like Silverlight, is marketed for the creation of something called RIA = rich internet application. The idea being that (D)HTML isn't really well-suited to create large-scale, well-responding applications on the web. I'm not sure whether this is really (still) true but historically, it fits.
Flex and Silverlight attempt to correct this by providing two things: a different, extensible technology along with a large library and an adapted toolset for the creation of applications. The disadvantage in both cases is the dependency from further (non-free, non-standard) components. The advantage is a potentially much more productive workflow and better performance.
Flex has a cohesive component model, and the basic building blocks were designed to support applications. HTML, on the other hand was designed for displaying text, and the DOM is a sorry excuse for a component model -- and it was most definitely not designed with applications in mind.
There is a plethora of JavaScript libraries that try to implement a workable platform on top of the DOM, and to even out the differences between browsers. While these work fine in many situations most of them don't come near the richness of the Flex component model, or even the more basic Flash API:s.
However impressing libraries like Dojo, YUI and jQuery are, they are limited by the platform, and it is limited indeed. Flex has all the benefits of the Flash Player platform, like vector graphics, remote objects, video support, cross-domain loading, sockets, font embedding, etc. but also a very good component model, data binding and skinning capabilities, to name but a few. If you're writing rich internet applications Flex is as rich as it gets.
Flex is a layer on top of Flash, and was designed from the ground up for building applications. As such it has very powerful capabilities when it comes to interface construction and data manipulation. If you are interested in movies and animation sticking with Flash is more appropriate.
The advantages of Flex over DHTML (AJAX) include:
- Faster prototyping
- Better cross-browser support
- Better support for data management
- More "serious"
Disadvantages include:
- Stuck with a single vendor
- Requires the Flash plugin
You can do audio and video in Flex/Flash vs DHTML.
Some more details and comparisons are in this The Top 10 Things You Should Know About Flex article.
If you're interested in leveraging the graphics potential of Flex, why not go check out Degrafa which is an open source graphing and general graphics api. It's pretty cool, very well documented, and quote - "Adobe has asked if the Degrafa team would consider helping directly contribute to the Flex Graphics open source effort." - which they are!
It's not just all about charts and graphs.
Just a quick clarification - to be clear, Flex is built on top of Flash. What that means is that anything you can do in Flash, you can do in Flex when it comes to programming. Flex Builder does not come with any tools that let you make animations with timelines or vector art or anything like that, but all of those elements are still usable provided you have the tools to make them elsewhere.
Flex is really about bridging Actionscript 3 as a language and Flash as a runtime into an environment where application programmers can feel truly comfortable with it.
As stated above, "Better cross-browser support." That's probably the biggest factor right now for me.
A few more...
It's a lot easier to get "pixel perfect" designs in place.
It's really easy to integrate Flash content into Flex. Which makes it easier to work with designers.
Actionscript is better than Javascript (go ahead and flame me!)
There aren't any really good alternatives to buying the Flash product for making timeline based animations.
The bad sides:
Sometimes, html is just plain easier / more powerful
Make sure to pick the right tool for the right job. Sometimes DHTML, sometimes Flex, sometimes Flash, and many times a combination of those.
What you're talking about is Flash versus Javascript. Flex is Flash, DHTML is Javascript.
Flex allows for rapid prototyping, an alternate IDE for building Flash .swf s, and fits nicely into Air - Javascript only runs in browsers, includes less animation support by default (although there are plenty of well-established libraries that provide that functionality) and doesn't require a plugin to work.
Also with Flex you don't have to deal with JSON, XMLHttpRequest, compatibility issues and the likes... Everything works like magic.
Unless you need a lot of animations, HTML will feel more lightweight than Flex.
No "loading" screen.
On OS X performance of Flex is abysmal. Even DHTML animations are faster! (see GUIMark).
HTML has wider compatibility than Flex. It may not be as easy as writing for single implementation from single vendor, but OTOH you're not limited to that single implementation:
No problems with iPhone or 64-bit Linux.
With graceful degradation basic functionality might even be accessible from Lynx or BlackBerry browser.
HTML is better integrated with the browser and OS:
Form elements can have native look'n'feel.
Text has preferred type of anti-aliasing, no problems with ClearType.
Keyboard shortcuts, context menus and text selection work as expected.
Browser extensions can improve DHTML apps, but Flex is impenetrable.
Accessibility tools have better support for HTML.

Resources