Archive for January, 2010
Flex 3.4 HTTPService Result Handler Called Twice Bug
by justin on Jan.26, 2010, under Adobe Flex, Programming
For those who have had the luxury of putting up with Flex 3.4, instead of moving onto Flex 4, here’s a nifty bug that you may have seen in your travels:
{
var service:HTTPService = new HTTPService();
service.resultFormat = "e4x";
service.method = "GET";
service.url = url;
var token:AsyncToken = service.send();
token.addResponder(new ItemResponder(resultHandler, faultHandler));
return token;
}
private function resultHandler(event:ResultEvent, obj:Object=null):void
{
// result code here
}
private function faultHandler(event:FaultEvent, obj:Object=null):void
{
// fault code here
}
The bug above is that the resultHandler will get called twice. Flex SDK 3.5 and 4.x fix this. Below is a workaround in case you’re stuck with SDK 3.4.
{
var service:HTTPService = new HTTPService();
service.resultFormat = "e4x";
service.method = "GET";
service.url = url;
service.addEventListener(ResultEvent.RESULT, resultHandler);
service.addEventListener(FaultEvent.FAULT, faultHandler);
var token:AsyncToken = service.send();
return token;
}
private function resultHandler(event:ResultEvent):void
{
// result code here and should most likely remove the event listeners
}
private function faultHandler(event:FaultEvent):void
{
// fault code here and should most likely remove the event listeners
}
Traffic
by justin on Jan.25, 2010, under Rants
What is it about people and their inability to drive correctly? Are people really that timid when driving? Are they just stupid? I know down here in the sa-yow-th, it doesn’t take much to get a driver’s license, especially when you offer the driving tester a beer, but why can’t people simply learn to press the gas pedal?
It doesn’t matter if I leave at 5:30am or 8:30am, it seems that I’m screwed. A wreck. A stalled car. Rain. Snow. Sunshine. Any one little thing, no matter how minor, and it will take me 1.5 hours to drive a whole 35 miles. I have to leave at 5am or 10:30am to get to work if I want to get there within 45 minutes. Then to get home I have to leave by 4pm or after 6:30pm to even have a chance of it taking less than an hour.
I wonder if the money is really worth it anymore. I keep trying to tell myself it is, but when I have to sit in the car listening to morons on the radio while watching morons on the road try to keep from falling asleep as we barely sputter along at 5-10 miles per hour, I really end up thinking that maybe those homicidal maniacs have something going. Remember that armored, gun-firing, flame-thrower-toting criminal at the start of Lethal Weapon 4? Yeah, that’s kinda where I’m going with this rant. Except it would be in the middle of GA-400 during rush hour. I wouldn’t hurt anyone. I’d just get them the hell out of my way.
