I'm experiencing strange behaviour of BitmapImage component with Flex 4.1 (more specificly - build 188.8.131.5276). Here is a sample application which causes an issue to arise:
private var imageClass:Class;
protected function this_creationCompleteHandler(event:FlexEvent):void
var container:Group = new Group();
var image:BitmapImage = new BitmapImage();
image.source = imageClass;
The problem is that the image is flipped horizontally (and it should not be). This probably have something to do with the bug SDK-26346, which is now closed. In comments I've found a "workaround" for the issue: if we switch places of two last lines of this_creationCompleteHandler() method (we add container to the display list and only after that we add image to that container) the problem dissapears. However, I must say that version 4.0 of the framework does not suffer from this issue. Moreover, this also does not apply for other components with 4.1 as well (I guess there might be a few others causing the issue but I have tested this with BitmapImage only).
So here is my question. Is it illegal to add BitmapImage to any container prior adding that container to the display list (and that effectively means that we have to create children of any component only in createChildren() method and not, for example, in a constructor)? If this is true, then why adding an image to a container before it has been added to the display list worked without any problems until the new version of the framework has been realeased? Or is this a bug introdused by "layout mirroring" feature in 4.1 version of Flex? In that case, I will have to report a bug.
Thanks in advance,
This looks like a bug to me. I have reproduced the issue in Flex 4.1 and yes it looks like a regression from 4.0.
Please file a bug and post the bug ID on this thread so we can investigate further.