Hopefully there’s a Papervision3D and/or TweenMax expert out there who can help me with this.
I have created a cube using Papervision3D where the back face has an image and some text, and the right face has an image and some text and contains a URL. I want the back face (the one facing the user) to wait for a MOUSE_OVER event then roll 90 degrees to the right and present the right face to the user. The right face then waits for 2 mouse events: either a MOUSE_CLICK, which will launch the URL, or a MOUSE_OUT, which should cause the cube to roll 90 degrees back to the left and present the back face again to the user. I am using the Papervision3D and TweenMax libraries in my code, which looks like this:
//front1 = back face
//back1 = right face
front1.addEventListener(MouseEvent.MOUSE_OVER, handleRollOver);
back1.addEventListener(MouseEvent.MOUSE_OUT, handleRollOut);
back1.addEventListener(MouseEvent.CLICK, back1Click);
function handleRollOver(me:Event): void {
TweenMax.killTweensOf(cube);
TweenMax.to(cube, .5, {rotationY: -90});
}
function handleRollOut(me:Event): void {
TweenMax.to(cube, .5, {rotationY: 0});
if (Math.abs(cube.rotationY) < .01) {
cube.rotationY == 0;
}
}
function back1Click(me:MouseEvent):void {
navigateToURL(new URLRequest(url_here));
}
Neither the handleRollOver or handleRollOut functions are performing their duties! Any idea where I went wrong?