I cast bitmaps on the front and backs of 9 cubes and coded them to
rotate +180 on mouseout. I got very inconsistent results where some
would rotate on mouseover and a few wouldn't trigger on the outs. My
test setup with a single color material (no bitmap on front and back)
worked great and I just recoded them to planes and the interaction
works great.
Is something up when you have more than one material on a cube?
cube2 = new Cube(
{material:cubephongmaterial, width:320, depth: 50, height: 240 } );
cube2.cubeMaterials.back = cube2pic;
cube2.cubeMaterials.front = cube5pic;
cube2.addOnMouseOver(cubesonMouseOver);
-----------------------------------------------
private function cubesonMouseOver(event:MouseEvent3D):void {
if ( StartDone == true && !TweenMax.isTweening(event.target)){
var rot:Number = event.target.rotationY + 180;
TweenMax.to(event.target, 2, { ease:Elastic.easeInOut, rotationY:
rot } );
}
}
Thanks,
Jim