Posted By

FlashJunior on 08/06/08


Tagged

DisplayObject


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

THEPWN3R
forchid
bobby


Flip a DisplayObject Vertical or Horizontal


 / Published in: ActionScript 3
 

just nice.

  1. public function flipHorizontal(dsp:DisplayObject):void
  2. {
  3. var matrix:Matrix = dsp.transform.matrix;
  4. matrix.a=-1;
  5. matrix.tx=dsp.width+dsp.x;
  6. dsp.transform.matrix=matrix;
  7. }
  8.  
  9. public function flipVertical(dsp:DisplayObject):void
  10. {
  11. var matrix:Matrix = dsp.transform.matrix;
  12. matrix.d=-1;
  13. matrix.ty=dsp.height+dsp.y;
  14. dsp.transform.matrix=matrix;
  15. }

Report this snippet  

You need to login to post a comment.