Posts Tagged ‘Flex’

Flex accessibility

Posted: October 31, 2012 in Adobe

I found below links very useful for understanding Flex Accessibility feature.

Adobe Flex now Apache Flex

Posted: January 8, 2012 in Adobe, Flex, RIA, Technology
Tags: , , , , ,

End of the last year (Nov – 2011) Adobe planed to donate Flex to Apache foundation and now Flex is officially accepted by Apache Software Foundation(ASF). For more info on this check the mail thread conversation on voting at Apache –

This year 2012 is the first year of Flex to live outside Adobe and managed by open source Apache Foundation. In the other side Adobe is also planning to renovate the Flex compiler and they are researching on making it possible to convert ActionScript code to JavaScript code. In this way we can develop HTML/HTML5 based application using ActionScript code. The open source movement is very popular and this is strengthen every year. Now onwards Apache is the the future for Flex. Apache Software Foundation was founded and is governed by the common people that really understand open source development model. It is one of the most respected software foundations in the world. To know more about how Apache Software Foundation (ASF) works then visit this link –

For more info on this –

Adobe Flex now Apache Flex

Flex SDK 4.6

Posted: December 17, 2011 in Adobe, Flex, Mobile, RIA, Technology
Tags: , , ,

You must be knowing that Adobe has released Flex SDK 4.6. Thanks to Adobe Flex SDK team to keep enhancing the SDK. This release of SDK is majorly focus on mobile and tablet apps development. Flex SDK 4.6 bundled with new mobile optimized Spark components. In mobile or tablet apps development major area of consideration is performance and SDK team done a good job and by using this SDK apps performance will be improve by 50%.

New Flex SDK 4.6 support for the latest Flash player 11 and AIR 3 runtime. Now this new SDK also brings support of iOS5 platform.

For more information on Flex SDK 4.6 features please visit Adobe Flex SDK 4.6 page and you can also check What’s new in Flex 4.6 SDK and Flash Builder 4.6 by Jacob Surber.

Adobe Flash Player

Adobe Flash Player

Flash is travelled very long distance in last decade, from Macromedia Flash to Adobe Flash. This Flash word is always in tech buzz. Initially it was popular in animator group then gradually attracted the attention of application developers and became a de-facto for RIA applications.

Flash is always preferable for developing richest content and deployed on browser. This enables consistent look and feel across different browser wherever Flash Player installed. Last year Flash was rejected by Apple’s for their devices and Apple started advocating open source technologies HTML5. This incident started a new thread in tech community over Flash existence.  Now again the same buzz started on Flash and its future after the Adobe’s recent announcement that they will no longer develop the Flash player for mobile browsers. In tech history there were several popular technology rolled out and rolled back depends on market movement, like JavaFX, SilverLight etc. Every technology has their lifecycle and this is manipulated by technology deviations.

Now we are entered in handheld device from desktop era. Here in this era everyone is looking for application migration for handheld devices. Here now if anything happens related to mobile or handheld devices then there is big news, but last year Adobe also stopped future development for Linux based AIR then there was silence.

Compare to Flash Player currently HTML5 is now supported on all major mobile devices. HTML5 is now a preferable technology for browser based application on mobile devices. With the latest release of Flash Player 11.1 for mobile browser Adobe will not support further for Flash player of mobile browser. This version of Flash player is still a very advance and powerful, there is still a scope of development Flash based application for mobile browser by taking advantage of new Flash Player 11.1 features.

As per market trends most of the customer want to port there application as a mobile devices apps, not as a browser based application. Here in this segment Flash is still a key player and we can port our Flash based application on Mobile device using AIR. Good news Adobe is still working on Flash Player 12 version so there is no point of worry.HTML5 is a very good technology but it still need time to fulfil the entire RIA requirement. Video/Media content delivery model is still not consistent in HTML5. Here Flash Player is best solution.

I am waiting for the day when Flash Player become an open source product and managed by some open source community. Then after we can say that we as Flash developers are using non-proprietary technology like HTML5. In this area Adobe has already taken initiative by planning to contribute the Flex SDK to an open source foundation.  This step will really give a high momentum in Flex SDK area.

Flash journey start from FutureWave to Macromedia and from Macromedia to Adobe, now Flash is ready to open source community in future. There is one thing for sure wherever Flash will go it will rock, it will not going to die soon like others.

In my last project assignment I found Spring BlazeDS Integration API is very fruitful. It really helps developer to focus on only business implementation of application and forget about backend server level configuration. Spring BlazeDS Integration is a top-level Spring project, and a component of the complete Spring Web stack. This project’s purpose is to make it easier to build Spring-powered Rich Internet Applications using Adobe Flex as the front-end client. It aims to achieve this purpose by providing first-class support for using the open source Adobe BlazeDS project and its powerful remoting and messaging facilities in combination with the familiar Spring programming model.

Spring FrameworkBlazeDS

By this article I am going to share the basic and essential part of this API that helps to understand the integration process. In this example I am going to use Spring+BlazeDS integration API for integrating backend Spring based J2EE layer into client layer Flex application.

What I am going to cover here:
Creating Spring based J2EE backend layer
# Implementing Spring BlazeDS Integration API
# Creating Flex application for client layer

List of software used for this implementation:
FlashBuilder 4.5
# Flex Framework SDK 4
# Apache Tomcat 7.0
# Spring BlazeDS Integration 1.5.0
# Spring framework library
# BlazeDS library
# Eclipse with WTP for creating dynamic web application
Note – we can use compatible preceding version of these software also.

Creating Spring based J2EE backend layer

In this step first create a dynamic web application using Eclipse IDE by File->New->Project->Web- Dynamic Web Project options and enter the basic project details and settings.

New Dynamic ProjectContext Root

In the above steps cross check the context root name for this application. This context root name will be use for client layer integration. After this steps this project will look like below in project explorer of Eclipse IDE.

Project Explorer

Now put all the jar files of downloaded library in WebContent->WEB-INF->lib folder. Total number of jar files in lib folder are 36.

List of library files

Tips : If you unable to find any of these listed jar files then you can manually download this from by entering the full name of zar file. Make sure you have all the respective library jar files of Spring Framework, BlazeDS and Spring+BlazeDS integration API.

Now after this initial project setup steps move to J2EE layer development. In this example I am fetching the list of country for Flex client layer.

Creating Spring based J2EE backend layer

First modify ‘web.xml’ in the ‘WEB-INF’ directory. Go to the WebContent->WEB-INF->web.xml directory. Here I define a DispatcherServlet (also known as a ‘Front Controller’. It is going to control all the requests. This servlet definition also has an attendant <servlet-mapping/> entry that maps to the URL patterns that will be used for making request. Here I am defining url pattern as /messageBroker/*, that means all request url containing this pattern will be routed to the ‘blazeds’ servlet (the DispatcherServlet).

Modifying the Deployment Descriptor web.xml file

Now I have created blazeds-servlet.xml file in WebContent->WEB-INF-> directory. This file contains the bean definitions used by the DispatcherServlet. It is the WebApplicationContext where all web-related components go. The name of this file is determined by the value of the <servlet-name/> element from the 'web.xml', with '-servlet' appended to it (hence 'blazeds-servlet.xml'). In this I am configuring spring annotation framework and providing a base package location of J2EE interface layer classes for Flex communication. And most important thing is configuring message-broker of Spring+BlazeDS integration API for object serialization.

Configuring WebApplicationContext

After this we have to define blazeDS communication channel in services-config.xml file at WebContent->WEB-INF->flex-> (this is a default location of services config file).

Configuring services config file

Now all the configuration lavel part is done and move to Class lavel coding. Just have a look on this class.

J2EE layer service class MapManager

The best part of Spring+BlazeDS Integration API is we now we don’t need to configure remote-config file for every java class. We just have to write a one single Spring annotation tag in class and need to provide a remoting communication channel information. In the above class I have used these three basic Spring annotation tag:

  • @Service(“mapManagerService”) – for giving a destination name of this class for Flex layer remoting.
  • @RemotingDestination(channels={“my-amf”}) – for providing a remoting communication channel name.
  • @RemotingInclude – using this tag we can include the method of the class for remoting.

Now we are ready to deploy this application on server.

Creating Flex application for client layer

In Flex layer we don’t have to do anything extra just need to create a Remote Object and call the exposed service destination from J2EE layer. For testing we don’t need to deploy this Flex application on server.

Client layer Flex Application

Output screen of Flex application

Output screen of client layer Flex application

Reference link:

Source files of example projet :


I am currently looking into a Flex application framework for my upcoming Flex Enterprise project. In Flex application development Cairngorm and PureMVC framework is a de facto standards. For my project we are looking into a possibility to introduced Swiz framework for application architecture.

Swiz official website stated this as “The brutally simple micro-architecture for Enterprise ActionScript development”. This tagline is very catchy and promise to cater key requirement of any application i.e. simple framework for enterprise level application. While judging this statement I have migrated some of the small apps into Swiz framework and reduced 30-40% of codebase, it is interesting.

Here I am giving you simple steps to give a start Swiz based application:
Create a context file for configuring Swiz framework. In this configuration we are providing the Beans and configure the Swiz framework.

  1. Create a Bean factory as repository for Bean classes.
  2. Injecting the bean where it needed using [Inject] tag. After injecting the bean you are able access the bean object.
  3. Register handle for flash event using [Eventhandler(event=”EventClass.EVENT_NAME”)] for event handling.
Swiz Context Configuration


Swiz Bean factory


Injecting Bean and register event handler


Dispatching event


Now after this simple step we can give a start to Swiz based application development. This is really a very simple as stated in Swiz website. One key point here is all metadata tag related function and properties should marked as public. Swiz framework developer’s team are also ready with Swiz AOP version (Aspect Oriented Programming). Swiz AOP gives you the powerful ability to easily configure new functionality into existing code, instead of muddying up your fundamental business logic. It is an extremely powerful methodology that Swiz makes very easy to work with.

ActionScript 3 is an Object Oriented Programming language, and here access modifiers are used for handling declaration visibility. The common access modifiers in Object Oriented Programming are Public, Private and Protected, apart from this in AS3 new access modifier namespace is introduced. This is used when we want more control over who can access class items. A namespace is a context in which names are unique. There are three steps to gaining and sharing special access to items with namespaces. First, declare a new namespace. Second, determine what items belong in that namespace. For those items, use the namespace’s name as a visibility modifier instead of public, private, protected, or internal. Third, in code that needs special access to the namespaced item, open the namespace that we have created.

Flex framework is a very good example of using namespace. In Flex framework for handling internal data they used mx_internal namespace. There are so many variables are marked as mx_internal, these variables are available for developer whenever they use mx_internal namespace. As per Adobe mx_internal is a namespace used by the Flex framework to partition out functions and properties that may change in future releases of the Flex SDK. So before using mx_internal think closely on how to avoid using this, because mx_internal mark property which you are accessing will change in next release of framework. Although this is a very good feature by framework to exposing there internal function to developer, but this is advisable to use this as a reference only not for solving any requirement. In this post I am going to describe this risk area of using mx_internal.

I have simple usecase where I am using “mx:NumericStepper” component. As per requirement we need to provide a checkbox for controlling enable and disable of text input controls of “NumericStepper” component.

Editable Disable

There are no direct property are exposed for end user devleoper for taking a reference of text input controls of “NumericStepper”. In this case we use mx_internal for taking reference of text input. See the code below for reference.

Taking a reference of inputField using mx_internal This implementation will work fine if we not upgrading the flex framework for this application. As per Adobe’s clear statement this is an internal property and may be change in future release for framework version. So we can’t say this implementation will workable always. If you see the below code we are able to access the inputField properties using mx_internal, as this inputField properties is there in <mx> framework based NumericStepper component.

inputField are accessiable in <mx> based frework

But when we upgraded our framework and started using spark component then this properties is not more available and our implementation will go wrong. 

inputField is not available in spark controls

Although “mx_internal” may solve many problem but please take this as a reference and be aware that properties or functions defined under mx_internal may change in future versions of SDK.

In the course of migration from Flex3 project to Flex4 usually we faced common TypeError at runtime. These error are generally a type coercion failed error. The simple usecase of this is we are converting <mx:List> component to <s:List> component. Here we have an inline xml object for “imgList” and binding it to a <mx:List> component.

It was working fine but after changing the <mx:List> component into <s:List> we are faced runtime TypeError like this:

|TypeError: Error #1034: Type Coercion failed: cannot convert XMLList@284a62a9 to mx.collections.IList.

Runtime error
<s:List labelField=”@name” dataProvider=”{ imgList.image }”/>

Works fine
<mx:List labelField=”@name” dataProvider=”{ imgList.image}”/>

The xml object of imagelist is as such:
var imgList:XML = ‘<imagelist>
<image name=”Image 1” source=”assets/image_01.jpg”/>

The <mx:List> component could take a few different objects as dataproviders, but the <s:List> spark List is typed only for taking IList type of object. The fact that it’s named “List”, XMLList turned out to be a top level Flash object that doesn’t implement the mx.collection.IList interface, which is required for a data source to be qualified as a DataProvider. The commonly used classes that implement IList are ArrayCollection, ArrayList (curiously) and XMLListCollection.

So the solution of this is to we need to typecast dataprovider data object into IList type.
dataProvider=”{new XMLListCollection(imageList.image)}”

<s:List labelField=”@name” dataProvider=”{new XMLListCollection(XMLList(imageList.image))}”/>

For more information on collection and data provider check this page :

P.S. – The code written in post are only for reference purpose.

As a RIA specialist I have been doing client side development professionally over the last six years or so, in a variety of UI toolkits and libraries that spanned Ajax, Adobe Flex, HTML5, Swing, Applet and Silverlight. During this period I have been in touch with different RIA technology, JavaFX being one of them. Before continuing the discussion further first I would like to tell you little bit about JavaFX. The JavaFX is a rich client platform for building cross-device applications and content. Designed to enable easy development and deployment of rich internet applications (RIAs) with immersive media and content, the JavaFX platform ensures that RIAs look and behave equivalently across diverse form factors and devices. This is an innovative technology built on top of Java that allows the creation of next generation RIAs.


Client side developers are always seeking for most efficient way of creating expressive RIAs. They need to build high fidelity GUIs that operates seamlessly on multiple web browsers, operating systems and devices, without having to rewrite their applications for varied environment. JavaFX promised to provide this kind of technology for end user developer, with the power of most preferable web and device technology- Java. With the advent of JavaFX it was thought that java would be one stop shop for developers.

It’s been three years since JavaFX was introduced to the world, but alas it didn’t gain a lot of momentum, though being launched at the right nick of time when the web community was moving towards RIA. It introduced a new scripting language called JavaFX Script, a very powerful language. In fact, it’s a DSL (Domain Specific Language) for creating rich user interfaces where the resulting application runs inside the Java virtual machine on the client. To my surprise when I first loaded the demos on their sites it took lot of time to load as compared to Adobe flash based application. I was hoping that being developed on Java as base technology it should have outperformed the flash based application. The benchmark on different site shows that JavaFX is by far the slowest. JavaFX APIs are not stable yet, it is not an industry standard and not many vendors are committed to it. Further, competing technology such as Adobe Flash is very popular and almost dominates the RIA domain. The key mantra of JavaFX is deployment and performance. Unfortunately, this is where JavaFX has failed miserably. The original Java applets and swing application failed miserably in deployment and JavaFX (which was supposed to be the next applet technology or applets 2.0) has inherited the failed deployment with it. In other words, nothing has really changed since 1995. This is what happens most of the time – you click on a link to launch a JavaFX application inside the browser. The browser freezes for about 5 seconds. To my woes, yesterday night while discussing about the JavaFX deployment process with one of my friend, I tried to show him the demo on JavaFX site, and the browser crashed twice. Should I blame him for this, for he was trying to click here and there while the demo was trying to load itself? I think JavaFX failed to gain any significant momentum mainly because of deployment problems which I described here. Deployment was never simple. Running an applet could freeze the browser for a few seconds, present you with a number of scary securities dialogs, and maybe even launch. If you were not that lucky, you would see the Java logo as an animated GIF. What I described above is the main reason JavaFX has failed so far. Deployment is still a disaster. If Oracle needs to know how deployment should work, it’s very easy. Just look at Adobe Flash. Make it as simple and transparent as running a Flash application. That’s it.

Some people say they don’t like JavaFX because they need to learn a new language. Well that’s just a bunch of hot air. First of all, any decent Java developer can pick up JavaFX Script in about 2 days. If you are developer (any kind) today, you have to learn new stuff all the time.

After acquisition of Sun Microsystem by Oracle, the roadmap or vision of JavaFX is changed. As everyone knows by now, Oracle is making significant changes to JavaFX. Oracle is stopping any further development of JavaFX Script. Instead, it will develop Java APIs which will become a part of JavaFX 2.0 to be released in the second half of 2011. So, instead of using JavaFX Script to develop rich Java applications, you will use the new Java API. There is still time to make JavaFX successful, but the time is running out. First, fix the deployment issue need to be addressed. Just start from scratch, don’t try to fix the current deployment system. Second, if Oracle doesn’t want or need JavaFX, then open source it and let the community drive its future. I think Oracle has 6-12 months at the most to try and revive JavaFX. If nothing happens by then (which would be about 4 years since the technology was announced), we just might as well close the door on JavaFX. Now market trends driven towards open ended technology like HTML5, people are not ready to depend on any third party proprietary technology. As the history suggests Java popularised for being cross-device technology. So for me JavaFX still have a market in device development segment. If they fix the performance and deployment issue ASAP.