Jump to content
Search Community

conleth

Members
  • Posts

    1
  • Joined

  • Last visited

conleth's Achievements

0

Reputation

  1. As this is my first post, I think I should just say the GreenSock code is simply out of this world. Ok, to 'play' and learn the library, I set about making the now famous flipping card example. One movieclip with two internal movieclips, each one with a different image. A simple rollover player2.addEventListener(MouseEvent.ROLL_OVER ,flipOver); player2.addEventListener(MouseEvent.ROLL_OUT ,flipOut); a simple tween (just gonna show the flipOver - flip out is the same with rorationY=0) private function flipOver(e:MouseEvent):void{ var flipper:* = e.currentTarget; TweenMax.to(flipper,.9,{ease:Quart.easeInOut , rotationY: 180, onUpdate:flipProgress, onUpdateParams:[flipper]}); } then a switch private function flipProgress(flipper:Object):void { if (flipper.rotationY>=90){ if (flipper.getChildAt(1).visible==true) { flipper.getChildAt(1).visible=false; flipper.getChildAt(2).visible=true; } } else { if (flipper.getChildAt(1).visible==false) { flipper.getChildAt(2).visible=false; flipper.getChildAt(1).visible=true; } } } It was a bit jerky, but it worked and I was quite pleased. Then I said to myself, if I set the images on the z axis one infront of the other, as they rotate the flip effect should be automatic, so I tried it. Unfortuantly it doesn't work. Even though it seems it should. By making my tween very slow and making an extreme zaxis (+/-100) I can see the 2 objects rotate correctly, up until the 90º point. Then for some reason the objects on the Z axis are switched and the 'front' image returns to the front as the tween reaches 180º. Any ideas or suggestion would be greatly appreciated. Conleth
×
×
  • Create New...