Friday, April 10, 2009

Custrom Item renderer

This is a customitemrenderer and a live value mapping...



Thursday, April 9, 2009

endpoint issue is not end of the road

errors like..

RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Failed: url: http://localhost:8080/WebContent/messagebroker/amf'" 

can be resolved in a single step..

First ensure you don't modify anything in the service config file.. Leave the poor guy alone.
Then right click on your project ---> go to properties -> flex server ==> servercontextrooot --> 

Give it the same name as your project

if your project is Fantastico

your server root will be 

/Fantastico..

Now you are good to go on any server any place blazeDs or LCDS no issue

Thursday, April 2, 2009

Flex print screen

This is a simple method to do a print screen from flex

private function doPrint(){

var printJob:FlexPrintJob = new FlexPrintJob();
   if (printJob.start() != true) return; 

Application.application.minHeight = Capabilities.screenResolutionY;
Application.application.minWidth = Capabilities.screenResolutionX;

printJob.addObject(UIComponent(Application.application),  FlexPrintJobScaleType.MATCH_WIDTH);
printJob.send();

 application.invalidateDisplayList();
application.invalidateSize();
application.invalidateProperties();
application.initialize();

}


Last and not the least call this function from your button or image or any thing..

Saturday, March 28, 2009

A simple timer event

So many times one searches for a simple timer event. Say I want to do some thing after few seconds then one requires a timer so here it goes..

public var t:Timer;

public function init():void{
//This can be any function...

t = new Timer(3000); //3000 is the timer interval which corresponds to 3 secs
t.start();
t.addEventListener(TimerEvent.TIMER,targets);//So after 3 secs it goes to the targets function
}

public function targets(event:Event):void{
t.stop();//Stop the timer
Alert.show("Ta da I am here after 3 secs");
}