Flex Example: Right-Click -> Save Image As

One of the things that is available in HTML web pages but usually left out of Flex applications is the ability to save images by right-clicking on them. This is not because it’s not possible with Flex – rather it just requires a little extra coding. So I created a simple Flex example that adds the “Save Image As” right-click menu item. Check out the demo and the source code.

Flex Example - Save Image As

This requires Flash Player 10 which allows users to save files generated at runtime on the client-side. I couldn’t find the ByteArray containing the original image file loaded by Flash Player so instead I had to read the bytes of the image wrapped in a SWF and slice out the image. I’m not 100% sure that this trick will work for all image formats. So give it a try and let me know what happens.