Created
July 23, 2014 12:14
-
-
Save illuzor/5b95daed941ab3ec5817 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var xPercent:Number; | |
var yPercent:Number; | |
if (stage.mouseX < stage.stageWidth / 2) { | |
xPercent = 100 - stage.mouseX / (stage.stageWidth / 2) * 100; | |
mainContainer.rotationY = xPercent/6; | |
} else { | |
xPercent = (stage.mouseX - stage.stageWidth / 2) / (stage.stageWidth / 2) * 100; | |
mainContainer.rotationY = -xPercent/6; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment