Posts Tagged ‘Flex’

h1

Custom Right-Click ContextMenu in Flex

December 12, 2008

Ever wanted to get rid of the typical context menu that you get when you right click anywhere in Flash Player? Well Flex API does not provide any feature to stop this. However some genius mind created a hack to not let the Flash Player know that the right click has happened. Instead, just call a Flex method using ExternalInterface. And in this method, create the menu (or do whatever else you want).

Run Demo

Download Demo/Source
Download Mirror 1
Download Mirror 2

P.S: All credits to custom-context-menu creators for developing the functionality!

Advertisements
h1

DateField as ItemRenderer

November 30, 2008

If you try to put the dateField as itemRenderer for a DataGridColumn directly using mx.controls.DateField, the chances of getting a runtime error is very high. In fact 9 out of 10 times, you will end up getting an error saying that it is unable to convert string to date. Here is a solution to that.

Run Demo
Download Source

h1

Loading Animated GIF in Flex

September 30, 2008

Loading Animated GIF in Flex is something that has always been the most wanted thing for Flex Developers. Doug McCune has made a component, Animated GIF Loader which actually loads animated gif. But the only drawback is that it costs $50!

Here is a free solution. There is a free component AS3GIF. The example shown with the code was made in Flash CS3. I ported it for Flex. Here is a sample…

Run Demo
Download Source | [Google Pages Mirror Link] | [Freehostia Mirror Link]

***
P.S: As many of you have reported that the 10gbfreehost link doesn’t seem to work, I have added a few other mirrors where I have uploaded the source zip file. One of them should definitely work!

h1

DataGrid Showing Date Difference in ToolTip

July 13, 2008

Again a request from Flex India group, I created a DataGrid which has two columns showing dates. And the tooltip for these colums show the difference between the dates in days as a ToolTip.

Run Demo
Download Source

h1

Cross Domain Woes

May 3, 2008

Cross domain has been something that has been nagging the developer fraternity since time eternity. The first time I heard about this term – cross domain was way back during my early days in e-learning. We were making simple e-learning courses and our client got over ambitious and wanted to use clustered servers to host the courses. They wanted the courses to reside on a different server and the Learning Management System (LMS) to be on a different server. And the best thing was that he did not even tell us before he did this.

What happened was an expectant collapse. The courses ran fine but did not track any data in the LMS. And since we did not have any clue about what the client did and even otherwise, atleast I did not have any clue what cross-domain policies are, we were all in deep trouble! Then after doing a lot of research and thankfully a timely information from the client that they had hosted the course on a different server as the LMS, it helped us zero in on this issue.
The reason I wrote this blog today is because it has been almost 4 years for the above mentioned incident to have occurred. And today after these four years, cross domain issue has haunted me again. I was making my website in Flex and till the time I was publishing the project locally, everything was working like a charm. And the moment I hosted it on the net, a few of the sections started breaking. There was an RSS feed on the home page from my blog, and then there was a complete section for Blog and Photos (from Picasa) and both these sections collapsed.

I am disappointed now that I did not realize this when I was designing my website and was finalizing on its contents. Now I am looking for some alternate solutions like a web service that can route the data to my website.

I seriously hope I get something 😦