SubClosure

{ Don't Repeat Yourself ! }

Browsing Posts published in September, 2009

As always with flex, the most simple problems are the hardest ones to solve.

For example to get FileReference to download a file from the server.

now you would think that creating a URLRequest followed by a simple call to the FileReference's download() function should do the trick.

But think again cause that results inĀ  no error and no download either.
The save dialog shows up and then … nothing … NICE

Now the solution is very simple:

just declare your FileReference instance as a class variable, outside of the function from where you use it.

And boom it magically works.

Another nice undocumented flex feature that can cost a bit of hair-loss and some
time spend in a mental hospital.

lucky are those who use FileReference as a class variable from the beginning.

In order to use a label as a button, the following parameters should be set

useHandCursor="true"
buttonMode="true"

and

mouseChildren=”false”

Get Adobe Flash player