[Papervision3D] Flex with PV3D. How to make a Plane in a canvas to accept the events?

xero xero.nu at gmail.com
Wed May 6 10:09:46 PDT 2009


hey,
adding interactivity in PV3D is the
same weather your using flash or flex.

i cant see all your code.
but in the function that creates
the actual planes add this code:

[code]
 function somthing():void {
   var myPlane:Plane = new Plane(....);
   myPlane.material.interactive = true;
   myPlane.addEventListener(InteractiveScene3DEvent.CLICK, hit);
 }

 function hit(e:InteractiveScene3DEvent):void {
   Alert.show("This plane was clicked!");
 }
[/code]

hope that helps!
____  ___
\   \/  /___________  ____
.\     // __ \_  __ \/ _  \
./     \  ___/ | | \( <_>  )
/___/\  \___  >__|---\____/
|     \_/   \/        |
| xero harrison       |
| xero.nu at gmail.com   |
| http://xero.nu      |
| http://fontvir.us   |
| http://hexarray.nu  |
| http://xero.owns.us |
`---------------------'

 ---------- Forwarded message ----------
> From: j2me_soul <j2me_soul at 163.com>
> To: flexcoders <flexcoders at yahoogroups.com>
> Date: Wed, 6 May 2009 21:45:16 +0800 (CST)
> Subject: [Papervision3D] Flex with PV3D. How to make a Plane in a canvas to
> accept the events?
> Hi all,
>
> I put some planes in the viewport in a canvas.
> But the planes can't accept any mouse-click event from canvas.
> I set the viewport.interative = true, material of each plane = true, but it
> dosen't work.
> What should I do now ?
>
> /*
>  *   In the ReflectionWall class, for each Plane setting a function
>  *   p = new Plane(ma,_imageWidth, _imageHeight, _seg, _seg);
>  *   p.addEventListener(InteractiveScene3DEvent.OBJECT_CLICK,
> planeClickEvent);
> */
>    private var ref:ReflectionWall;
>
>    private function init():void{
>     ref = new ReflectionWall("images/Belle.png",100, 100, 54, can.width,
> can.height);
>     can.rawChildren.addChild(ref);
>     ref.camera.zoom = 50;
>     addEventListener(Event.ENTER_FRAME, ref.render);
>    }
>
> <mx:Canvas id="can" width="1000" height="750" />
>
>
> ------------------------------
> 穿越地震带 纪念汶川地震一周年 <http://512.mail.163.com/mailstamp/stamp/dz/activity.do>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20090506/343b7f63/attachment.html>


More information about the Papervision3D mailing list