# Cube Rollover using Papervision3D / TweenMax libraries

**URL:** <https://forum.kirupa.com/t/cube-rollover-using-papervision3d-tweenmax-libraries/312947>\
**Category:** flash\
**Created:** [August 16, 2010, 6:04pm UTC](https://forum.kirupa.com/t/cube-rollover-using-papervision3d-tweenmax-libraries/312947 "2010-08-16T18:04:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nhilez](https://avatars.discourse-cdn.com/v4/letter/n/51bf81/32.png) [@nhilez](https://forum.kirupa.com/u/nhilez)\
**Post date:** [August 16, 2010, 6:04pm UTC](https://forum.kirupa.com/t/cube-rollover-using-papervision3d-tweenmax-libraries/312947/1 "2010-08-16T18:04:06Z")

</div>

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?
