Just in case someone faced the same problem i did. Here’s the actual code to download a file with Flex


var fileToDownload:FileReference = new FileReference();
private function downloadFile(event:MouseEvent):void
{
var request:URLRequest = new URLRequest("file.txt");
fileToDownload.download(request, "aSpecificFilenameChosenByYou.txt");
}

It doesn’t work if your file reference object is declared as a local variable. For the non-coders, here is the negative example.

private function downloadFile(event:MouseEvent):void
{
var request:URLRequest = new URLRequest("file.txt");
var fileToDownload:FileReference = new FileReference();
fileToDownload.download(request, "aSpecificFilenameChosenByYou.txt");
}

Comments Comments

Yes finally got my hands on the iPhone 3G. It has been a really long wait. Even though i am under an unhappy situation(my grandma passed away the afternoon before the iPhone launch day), i was determined to get my hands on it asap. And so i did, on 22 August about 3:20am after queuing up for 3 plus hours at Singtel Comcentre.

It has been a really great desire of mine to venture into mobile application development. Before the iPhone, we only heard of apps done with Windows Mobile, J2Me and symbian. J2Me coding really sucked since Java did not have a trait of having nice user interface. Windows Mobile or symbian were the other potential platform however you have to pay quite a sum(IDE, etc) to develop on them.

Time to learn some objective-c and fiddle around with the iPhone SDK!

Comments Comments

Today, there is only one API for creating production grade front end for RIA talking to Java. It’s called Adobe Flex. In 2010, JavaFX may become another alternative. But meanwhile, please stop bashing Java. Do not forget that many of these new popular programming languages exist because there is a J2EE application they need to connect to. Do not forget that Java puts bread on the tables of many people (including mine) around the world. Do not spit in the well you drink from.

Yakov Fain from Farata Systems » Flex is strong because of Java.

I can feel so much from what Yakov has written. I totally agree with him. Coming from an enterprise world, it is really where the big money pot is. No offense to the other languages, you can laugh all you want about Java but you are missing out on the potential Java can give to a Flex application. I am still a little skeptical about JavaFX. Let’s see what Sun can do with JavaFX.

Comments Comments

I have package my slides and source codes. Click here if you wish to download it.

Something that i was unable to share with everyone. I have used BlazeDS with Spring and Hibernate. For my Flex client, i have used Flex with Cairngorm.

Have a look at the codes…

Drop me a msg if you have trouble setting the source codes up. You can tweet me @kennethteo.

Comments Comments

Cairngorm is the lightweight micro-architecture for Rich Internet Applications built in Flex or AIR. A collaboration of recognized design patterns, Cairngorm exemplifies and encourages best-practices for RIA development advocated by Adobe Consulting, encourages best-practice leverage of the underlying Flex framework, while making it easier for medium to large teams of software engineers deliver medium to large scale, mission-critical Rich Internet Applications.

Cairngorm Project Home at Adobe Open Source

Great news to the Flex community that Cairngorm is now open-sourced. I can only hope for more great things to come. Having completed my first project using Cairngorm, i would certainly recommend it to anyone who is using Flex in their projects.

Comments Comments

Go online, book a tee-time

New interactive system lets you do this real-time for courses in and around Singapore, reports JUSTINE MOSS

Go online, book a tee-time - August 9, 2008.

Excited to share that Clickateeonline.com got a feature on Business Time Singapore on a great day(Singapore’s National day). Click on the link to check the article out. If not, come visit us at our site, Clickateeonline.com

Comments Comments

Did a check on google analytics and found all the extra traffic from jarvis universal purchase company. Whoever they are, i do not like what they are doing. Probably a crawler of some sort.

Other people who have noticed the same thing. I wonder how many experienced this on their site.

  1. www.jaygeiger.com/index.php/2008/05/21/jarvis-universal-purchase-company/
  2. http://springcitychronicle.com/2008/03/20/blog-stuff-2/

Comments Comments

Before this, i only know how to do a normal search string and searching for the string through the whole document. Now i can search and replace all.. Yay!

First occurrence on current line:      :s/OLD/NEW
Globally (all) on current line:        :s/OLD/NEW/g
Between two lines #,#:                 :#,#s/OLD/NEW/g
Every occurrence in file:              :%s/OLD/NEW/g

Comments Comments

Dropped off my MBP at the iShop service centre. It was really dumb when everything was back to normal again. Grrr. The service centre person(malay lady) kinda had this look of disbelief. I asked whether there were any related cases with the recent GPU problem and i got a “i dunno” reply.

She ran a scan with ‘Disk Utility’ and after about 10 minutes of trying hard not to disturb her, the laptop started to show signs of problem. The light went off and she said, “It looks like your back light has some problem.” Fiddling around with the screen brightness keys, she managed to get the screen up. Soon afterwards, my laptop started to get hangy with the usual multi-color rolling ball. This time i really have no idea what the hell is wrong with my laptop. Quite irritating that these people have no clear idea of what happen as well. She checked with her mates and told me she will send it in for servicing.

3-5 working days is my downtime. Hopefully, i can get a clear answer on what happened. Luckily i still have my iMac. I still love my mac in case you guys think i might be thinking otherwise.

Comments Comments

Damn… just when i was all geared up to start work, my mbp just chose to give me a black screen of death. I narrowed down the problem to my GPU when i tried connecting it to a monitor. F7 simply does not switch the screen. Luckily everything else was intact when i could hear music with Last.fm activated with quicksilver.

The saviour of the night is my somewhat old iMac, a firewire cable and migration assistant on the mac. My MBP user workspace was all up and running in two hours of full user account migration. Everything remained the same (even desktop image and Stickies notes). Phew!!

Comments Comments