[Papervision3D] Can a DisplayObject3D accept and event listener?
Kevin Burke
pajhonka at yahoo.com
Wed Jan 7 13:08:59 PST 2009
Sorry, I know could be quite the novice question to some of you, but does
someone out there have any insight on this problem? The event listener of my
DisplayObject3D containing two planes doesn't recognize any mouse events.
I've looked in the Papervision documentation under DisplayObject3D class and
InteractiveSceneEvent. I was hoping to find some kind of "Interactive"
boolean I could pass when I create the DO3D, but I didn't find anything.
I've also searched these forums, but the only thing I found were a couple of
unanswered posts on the same topic:
http://www.nabble.com/DisplayObject3D-is-null-tp13709425p13709425.html
http://www.nabble.com/Displayobject3d-and-interactivity-tp14129809p14129809.html
Thank you very much.
Kevin Burke wrote:
>
> 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--tp21334695p21340347.html
Sent from the Papervision3D mailing list archive at Nabble.com.
More information about the Papervision3D
mailing list