AS3 How to create double sided MovieClip which when rotation shows the other side as well?

后端 未结 3 2051
悲哀的现实
悲哀的现实 2021-01-28 04:35

I have a movie clip which has two frames. On the first frame I have the front side and on the second I have the back. I am rotating the MovieClip by rotationX, rotationY, rota

3条回答
  •  Happy的楠姐
    2021-01-28 04:54

    Check out this link.

    http://codingfiend.com/examples/greeting_card/

    Rather than using two frames, make your front and back as two movieclips on one frame. Place them on top of each other, front side on top, and flip the backside horizontally. I used this ENTER_FRAME event to track rotation and show and hide the front of the card. I start the event when clicking the front of the card, track the tween and kill the event when its open. Perhaps you could also track position as well as rotation to accomplish what you are looking for.

    protected function oef(evt:Event):void
    {
        var rot:Number = Math.round(_front.rotationY);
    
        if(rot >= 0 && rot <= 89)
        {
            _front.outside.visible = true;
        }
        else
        {
        _front.outside.visible = false;
        }           
    }
    

提交回复
热议问题