0

Is there a simple way to take existing rectangle on the stage and "flip" the rectangle so that if it was on the left it's now on the right side?

1
  • I see you switched the question title. So you're looking for simple DisplayObject help instead of BitmapData help?
    – user1385191
    Mar 1, 2011 at 22:26

2 Answers 2

1

Yes, it is quite simple by manipulating the rectangle's x position.

rectangle.x = stage.stageWidth - rectangle.x - retangle.width;

is about as simple as you can get. It may not be what you're looking for because I have no idea what you're trying to do, but that's how you go about simple position manipulations using variables like the stageWidth.

0

This should mirror it horizontally:

rectangle.width = -rectangle.width;
1
  • rectangle.scaleX = -1 is also used in this case.
    – user1385191
    Mar 2, 2011 at 0:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.