Tuesday, August 18, 2009

My Blog is on AXNA/MXNA

This morning came with a big surprise for me. I was just browsing the blog list on Flex devnet and found that my blog is also registered with MXNA/AXNA (Macromedia/Adobe XML News Aggregator). I wasn't aware of this thing so it was a pleasant surprise for me and it made my day.
So, from now on, my posts can also be seen on Flex devnet. :)

Cheers!

Friday, August 7, 2009

Hyperlink Component

So many times I see people ask for Hyperlink kind of component in Flex. Though there is LinkButton available in Flex framework but it does not give the feel of traditional hyperlink as it is in HTML. Therefore I tried tweaking the Label component a bit and I guess it is exactly like traditional hyperlink. Trust me, it was far more easier than the imagination. Check out the code below:

package com.components
{
import flash.events.MouseEvent;

import mx.controls.Label;

public class HyperLink extends Label
{
public function HyperLink()
{
super();
this.setStyle('color','#0000FF');
this.addEventListener(MouseEvent.MOUSE_OVER,mouseOverHandler);
this.addEventListener(MouseEvent.MOUSE_OUT,mouseOutHandler);
}

override protected function commitProperties():void{
super.commitProperties();
this.buttonMode = true;
this.useHandCursor = true;
this.mouseChildren = false;
}

private function mouseOverHandler(e:MouseEvent):void{
setStyle('textDecoration','underline');
}

private function mouseOutHandler(e:MouseEvent):void{
setStyle('textDecoration','normal');
}
}
}

You can use this component directly.

Let me know if you like it. :)

Cheers!

Thursday, August 6, 2009

Flex HackrChallenges

HackrChallenges is a step taken by a group of Adobe evangelists in India to attract Flex users. I found it interesting because they have started it with a small Flex challenge. I hope it would grow positively in near future.

One more good thing is that they have created a new forum which contains some useful things and it is completely dedicated to Flex. Though it is in beta currently but I feel it is worth visiting.

It's been a long time

It has really been a long time since I wrote my last post. I can give thousands of reasons for that :)
but that would really be shameful, isn't it ;). But as they say its better late than never, I am trying to come back again. This time I would try (not PROMISE) to become more active on this blog.
Again I would be writing about some flex related topics and my findings (if any) on Flex.

Keep visiting, I will post something very soon.

Cheers!

Saturday, March 14, 2009

How to enable server in a Flex Project

Few days back I ran into a problem where I wanted to enable the server technologies in a pre-existing Flex project (A project in which server was not configured at the time of creation). In such projects when you right-click on the project inside project navigator and then click on Flex Server, you will find that everything is disabled!

Now what to do?

Should I create a new project with server configuration and then copy all the source file to that newly created project?

Sounds weird!!! There is not to do all those things, just a single configuration change.

Go to your project directory and open the .flexPeoperties file in a text editor and change the value of flexServerType to 1 (which is 0 by default.)

Save the file, close it. Now go back to your flex builder and again right click on your project, select properties and then select Flex Server.

Everything is enabled now and you can do your server configuration on the same project.

Do post your comments if you find it helpful.

Cheers!

Tuesday, February 17, 2009

Copy only selected items from a datagrid to clipboard in Flex

Hi,

After a long time I wished to write a post again :)
This time I am writing a simple class but I think it could be very useful to someone. There have been some classes which were copying the data from a datagrid. I decide to write a class which copies only the selected data from the datagrid.

First you will have to set the allowMultipleSelection="true" of the datagrid you want to copy. Then use the following class to copy the selected data from the datagrid.

package com
{
import flash.system.System;

import mx.controls.DataGrid;

public class CopyToCB
{
public static var ccString:String;
public function CopyToCB()
{
}

public static function CopyData(dg:DataGrid):void{
ccString = new String();
for(var i:Number=0;i<dg.columncount;i++){
ccString += dg.columns[i].headerText + "\t";
}
ccString += "\n";
for each(var item:Object in dg.selectedItems){
for(var t:Number=0;t<dg.columncount;t++){
ccString += item[dg.columns[t].dataField] + "\t";
}
ccString += "\n";
}

System.setClipboard(ccString);
}

}
}

Do let me know if it helps you.

Cheers!

-Ravi

Tuesday, October 14, 2008

Direct Connection of Flex to MySql

Yesterday I came across ASQL which is a complete library for creating a connection between Flex 2 and MySql without using any kind of service (RPC, Messaging, etc.). This is a kind of revolutionary thing in developing data application with Flex 2.

I tried my hands with it and found really interesting. We can just pass the query string in our Flex code and can get the result from MySql database. This is simply amazing.

Thanks to Lukasz Blachowicz for creating such a cool library.

Cheers!