I have been searching a solution for this since 2 days but couldn’t find any. My knowledge of Flex is intermediate.
I am writing on flex application where I use two elements lets call box 1 and box 2, inside a parent . There is a button which rotates parent and then I have to re-arrange these two child boxes with a particular way.

As the image shows initially parent box direction is horizontal and box 1, box 2 direction is vertical. When I rotate parent box with 90 degree I need to do perform following task:
- Rearrange the order of box 1 and box 2 => What happens is, after 90 degree rotation box 2 is on top of box 1 but what I want is box 1 should be first and then box 2 should be there.
What I did => I tried quite a few ways of doing this for example
box.swapChildAt
though its for z-ordering sometimes it works. But still I am in search of proper solution.
Thanks in advance 🙂
I think the problem you have is that rotation just applies rotation to the display object, while the layout logic is independent from that. Therefore, if you have a background to be rotated, I would recommend you to keep background in an isolated container and rotate it, while keep the container with those two children separately and introduce 4 states for that for every orientation (0, 90, 180, 270). Then you apply the corresponding state depending on the rotation and in that state you rotate children themselves and change their order.