Tag Archives: actionscript

Mirrored Bitmap Graphics in Flex SDK 4.1 Anyone?

A few days ago I decided to upgrade my PosterMyWall* Flash/Flex development environment from Flex Builder 3 to the latest IDE, Flash Builder 4 (Adobe can’t seem to decide on a name …). Flash Builder 4 comes with the latest version of the Flex SDK, 4.1.*.

When I compiled and ran the poster maker with the new SDK, I was appalled to notice that all my BitmapImage’s were mirrored horizontally. After Googling around for a bit, and going through Flex bug-fix logs, I came across this bug which gave me a clue as to what might be wrong.

The culprit is the default value of the layoutDirection property of some elements. Sometimes, based on how an element is located in the DOM, the value of layoutDirection might not be set properly. You’ll need to manually set it to LTR (or RTL) so that your images show up correctly.

*If you haven’t checked it out already, PosterMyWall is a great online poster maker that allows you to create posters and collages from your photos, which you can share online or get printed as large high quality posters.

Tagged , , , , ,

The complete solution for implementing a deep-copy clone() method in ActionScript 3

When I started out to write a clone method for a few of my AS3 classes, I looked online and didn’t find any official information about cloning classes from Adobe. There were however a few solutions that were hacked together to provide the same functionality (here and here). These solutions have one big problem though, they don’t work with classes which have non-primitive properties.

My solution mostly builds on top of these solutions but it also provides the ability to clone classes which have properties that are custom class. And it also works with inheritance.

I’ve placed all helper methods in a CloneUtility class for better modularity. We’ll be using these methods in the code examples below.

Continue reading

Tagged , ,