[Papervision3D] Can a DisplayObject3D accept and event listener?
Kevin Burke
pajhonka at yahoo.com
Wed Jan 7 08:19:21 PST 2009
Please excuse my ignorance, but can a DisplayObject3D accept an
InteractiveScene3D event listener? I'm trying to create a double-sided plane
using MovieMaterials and, for some reason, the DisplayObject3D holding both
planes won't animate. Any idea what might be going wrong? Thanks.
var liveMaterial:MovieMaterial= new MovieMaterial(liveMC, true);
liveMaterial.interactive=true;
liveMaterial.animated=true;
liveMaterial.smooth=true;
liveMaterial.doubleSided=true;
liveMaterial.allowAutoResize = false;
var liveBackMaterial:MovieMaterial= new MovieMaterial(liveBack, true);
liveBackMaterial.interactive=true;
liveBackMaterial.interactive=true;
liveBackMaterial.animated=true;
liveBackMaterial.smooth=true;
liveBackMaterial.allowAutoResize = false;
var planeContainer = new DisplayObject3D();
planeContainer.x=-300;
var livePlane:Plane= new Plane (liveMaterial, 136, 204, 10, 10);
var liveBackPlane:Plane= new Plane (liveBackMaterial, 136, 204, 10, 10);
liveBackPlane.z = 1;
planeContainer.addEventListener(InteractiveScene3DEvent.OBJECT_OVER,
objectOverHandler);
planeContainer.addEventListener(InteractiveScene3DEvent.OBJECT_OUT,
objectOutHandler);
function objectOverHandler(e:InteractiveScene3DEvent):void {
TweenMax.to (e.target, .75, {z:-100, rotationY:180, rotationZ:90});
}
function objectOutHandler(e:InteractiveScene3DEvent):void {
TweenMax.to (e.target, .75, {z:0, rotationY:0, rotationZ:0});
}
planeContainer.addChild(livePlane);
planeContainer.addChild(liveBackPlane);
scene.addChild(planeContainer);
--
View this message in context: http://www.nabble.com/Can-a-DisplayObject3D-accept-and-event-listener--tp21334695p21334695.html
Sent from the Papervision3D mailing list archive at Nabble.com.
More information about the Papervision3D
mailing list