Flex Trends around the world…

September 4, 2007

A very special thanks to Mike Potter for bringing this to my notice. It is really exciting to see the trends analysis of adobe flex on Google Trends. Take a look…

Its really thrilling to see not only that India is on the top of the trends list, but also that Bangalore and Chennai tops the list of cities where the “flex” trend is really catching on… Wow, I didn’t know that Flex was so big a rage in India 🙂

I understand that any trend graph almost always kind of follows the below pattern and the above results are more of a validation of where the different countries are on the trend-graph rather than on the adoption of the trend itself. As the below graph suggests (Disclaimer: the graph is an illustration of a personal opinion and not based on any statistics), the adoption is already at a much higher state in the US than in India. This in turn, puts India on the list of countries where the adoption is low, but the adoption rate is higher than that in the US.

Since this adoption rate, rather than the adoption itself is the basis of Google trends, it is to be understood that the popularity of Flex might be much higher in US than in India. But its still great to see that India is keen to hop on to the flex bandwagon…

Indic Transliterator in Flex… powered by Google Labs

September 4, 2007

I saw this post on Abdul’s blog today. Google Indic Transliterator is cool. I played around with it a bit and then it stemmed a desire to do something similar in Flex. Thanks to the pointer by Abdul, I was able to achieve this.

Abdul, in his post talks of an URL (click on the link to see an example of what I’m talking about) which you can hit with your text through GET parameters and get it transliterated. The result, if tweaked a bit (i.e. removing unwanted characters including some escape characters) would yield a JSON.

Then I used the as3corelib to convert the JSON to an AS Object. I then embedded an Indic Font into my App and used it to render the text. The result is what you see below.

I’m not posting the code as of now because its still a very dirty 🙂 And also, the API is undocumented and may break soon. But I guess this should be pretty straight forward for anyone who wants to try this out…

Flex India is going great guns

September 3, 2007

Flex India is going great guns… Gone are the times when I, Mrinal & Abdul, among others were plotting how to get Flex to take off in India. It seems like ages back when we had the first Flex Developers meeting at Bangalore to brainstorm with John Koch, about the future of the Flex Community in India. Flex India today is not only up on its feet, but its ready for the race. Here are some stats that prove it…

FlexCoders is the grapewine for all Flex Community. Its a thriving group which has more than 7500 ( 7518 to be precise) people registered. This group has earned its reputation as a prime point where people can get their questions answered. Now lets compare it with the nascent group that is Flex-India.

Flex-India started off in July 2006 (while FlexCoders has been around from March 2004). It already has 430 people registered on it. This might look like a small number, but is sizable considering the fact that flexCoders is an international congregation of Flex developers, while Flex-India is regional. Just last month, we had more than 30 people joining the group, which is a very encouraging sight.

Another exciting factor is the traffic on flex-india. Take a look at the statistics below.

I tried to compare these monthly figures as a percentage of the corresponding traffic on flexcoders. This is what came out of it (I know i could have done these charts much better in Flex, but I just wanted to learn how to create charts in Excel 🙂 )

Click on the graph to see the full stats

I couldn’t believe that the average traffic on flex-india in the last 3 months has been around 20% as much as that on flexcoders. The fact that flexCoders is about 60 times the size of flex-india, just adds to the pride. I realize that these figurers are powered by the Services Companies in India and their clients abroad, but still the fact that the Flex Developer base in India is on a steady rise is a very heartening fact.

Additionally, it is personally gratifying to see that this rise began after March 2007, when we all got together and decided to do something about the Flex Community in India. Kudos to Mrinal who has been the cornerstone of community development in India from outside of Adobe. Being a flex developer himself for SAP, his passion for Flex matches that of any engineer on the Flex Team.

The flex developer community in India is getting stronger by the day. We now have active communities in Mumbai, Pune, Chennai and Bangalore and many more mushrooming by the day. Flex is Rocking India and India is Rocking Flex… This achievement is remarkable and I congratulate everyone who have been involved. Way to go 🙂

What is mx_internal ?

September 3, 2007

Traditionally in OOO languages access specifiers are used to control visibility of declarations (public, private, protected). Now with XML based languages like MXML making debut, a new mechanism for controlling visibility of declarations has evolved… using namespaces. Namespaces are essentially custom access specifiers, which can have names of your choosing. Namespaces are outfitted with a Universal Resource Identifier (URI) to avoid collisions, and are also used to represent XML namespaces when working with E4X.

What I’m interested in discussing here is an internal namespace that FLEX framework uses for its internal data, called mx_internal. A lot of variables in Flex are mx_internal variables and are available to the developers if they use the mx_internal namespace. Before we go into the details of how to use them… lets look at how to identify these variables. There are 2 ways to do this…

One is the straight forward way of looking into the source. Since Flex is Open Source and comes bundled with the source code.. one can easlily locate these variables in the source. For example, under the class defenition of VideoDisplay.as, you can see the an mx_internal variable called videoPlayer (of type VideoPlayer, which in turn extends from flash.media.Video)

mx_internal var videoPlayer:VideoPlayer = null;

This way of identifying mx_internal variables is not always effective, so a better way is to use FlexBuilder to identify them. This is what you need to do…

  1. Switch to Flex Debugging View
  2. Use the following code
      <mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml”&gt;
      <mx:Script> <![CDATA[
      public function debug():void{ } ]]>
      <mx:VideoDisplay id=”vid”/>
      <mx:Button label=”Debug” click=”debug()”/>
  3. Make sure that you can view the mx_internal variables in the debugging mode. You can do this by checking the options in the debug Layout as below
  4. Now put a break point in the debug() function and run the app in the debug mode. Click on the button to come to the debug view and add a watch for the VideoDisplay object. You’ll see the following in the debug view, when you search for videoDisplay under the watched vid variable…

The variables are color coded as below

  • Red Rectangle – private
  • Green Circle – public
  • Yellow Rhombus – mx_internal
  • Char codes “C” & “S” – constants and static vars

Now you have identified the mx_internal variables that you need to use. Now lets see how to use them. This is a 3 step process…

  1. Import the namespace that is going to be used. Note that this needs to be done after all other imports
      import mx.core.mx_internal;
  2. Tell Actionscript that is a namespace
      use namespace mx_internal;
  3. Prefix the property name with its namespace

Thus you can now access and use the mx_internal variable and all its properties, methods, styles etc. I’ll tell you about some scenarios where this is most useful in the coming posts. Hope this makes your job easier 🙂

Addendum (4th Sep ’07) :  As rightly pointed out by Mrinal…. I should add this disclaimer.

Adobe uses the mx_internal namespace to mark things that may change in future versions of the framework .. So you have to use it at your own risk, because your inherited class or component may not work with future releases of Flex.