[Papervision3D] Can a DisplayObject3D accept and event listener?

Ross Sclafani ross.sclafani at gmail.com
Wed Jan 7 13:16:48 PST 2009


since an object has to have an interactive material to be catch  
events, i would guess the answer is no.
i have seen no indication that do3ds inherit interactivity from their  
children.
i would recommend adding the event to each of the children which have  
interactive materials.
OR, you could create a child ViewportLayer from the parent object  
(recursive:true), and catch standard MouseEvents from that.

i cannot say for sure this is the definitive answer since we're on the  
mailing list,
but if it were just you and me I'd sound confident enough for you to  
believe me.
believe me.
_ross
On Jan 7, 2009, at 4:08 PM, Kevin Burke wrote:

>
> 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.
>
>
> _______________________________________________
> Papervision3D mailing list
> Papervision3D at osflash.org
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org




More information about the Papervision3D mailing list