« Away3D is a lefthanded system
» Flex Reflections Component and Actionscript Class

Actionscript 3, Adobe Flex 2

BitmapData and Matrix weirdness

05.26.08 | 2 Comments

Yet another weird actionscript problem that’s been bothering me for some time. I’m trying to make a BitmapData snapshot of a Flex Component and then transform it with a Matrix. Quite simple you would say, this is how you would do it:

1
2
3
4
5
var flippedBmd:BitmapData = new BitmapData(myUIComponent.width, myUIComponent.height, true, 0xFFCC00);
var flipMatrix:Matrix = new Matrix();
flipMatrix.scale(-1, 1);
flipMatrix.translate(myUIComponent.width, 0);
flippedBmd.draw(myUIComponent, flipMatrix);

Where myUiComponent is any Flex Component instance.

This all works well, except for the text in the Component, all ‘dynamic’ texts won’t show in the BitmapData, whil everything works well if I comment out the flipmatrix.scale and flipmatrix.translate lines.

You can see this weird behavior in action here. Try it by clicking the ‘Flip’ button.

The first one who gives me a BitmapData-only solution to this problem deserves a free beer!

2 Comments

have your say

Add your comment below, or trackback from your own site. Subscribe to these comments.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

:

:


« Away3D is a lefthanded system
» Flex Reflections Component and Actionscript Class