February 2010
M T W T F S S
« Jan   Mar »
1234567
891011121314
15161718192021
22232425262728

Flip movieClips horizontally

Problem
How to flip movieClips horizontally

Solution
Use scaleX=-1 and scaleX=1

Detailed explanation

stage.addEventListener(KeyboardEvent.KEY_DOWN, starMoving);
var speed:Number=20;
function starMoving(event:KeyboardEvent):void {
trace(event.keyCode);

switch (event.keyCode) {
case Keyboard.LEFT :
face_mc.x-=speed;
face_mc.scaleX=-1;
if (face_mc.x face_mc.x=container_mc.x;
}
break;
case Keyboard.RIGHT :
face_mc.x+=speed;
face_mc.scaleX=1;
if
(face_mc.x+face_mc.width>container_mc.x+container_mc.width) {

face_mc.x=container_mc.x+container_mc.width-face_mc.width;
}
break;
default :
break;
}
}

index27

Source:
flip horizontal movie clip

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>