[Papervision3D] How to capture events from a MXLM component ina MovieMaterial?

Strange Loop Studios info at strangeloopstudios.com
Tue Aug 4 12:51:11 PDT 2009


Hi all,

 

Just a quickie to add to this! I have a similar example I'm working on which
exhibits the same behaviour but in mine some of the components will work as
expected while others don't. Anything with a button seems to works fine
(meaning an mx:Panel with a mx:Button inside it mapped to a MovieMaterial).
I add no special listeners - just let the component do its default
behaviour. DateChooser is a weird one too - if it's on its own I get
rollovers working on the dates and the buttons at the top also work but if
it's in a scene with other components as planes I lose the rollovers.

 

Ta

Doug

 

  _____  

From: papervision3d-bounces at osflash.org
[mailto:papervision3d-bounces at osflash.org] On Behalf Of xero
Sent: 04 August 2009 20:04
To: papervision3d at osflash.org
Subject: Re: [Papervision3D] How to capture events from a MXLM component ina
MovieMaterial?

 

i will never get it from that snip.

please post the full code 

(or email me directly.)
____  ___
\   \/  /___________  ____
.\     // __ \_  __ \/ _  \
./     \  ___/ | | \( <_>  )
/___/\  \___  >__|---\____/
|     \_/   \/        |
| xero harrison       |
| xero.nu at gmail.com   |
| http://xero.nu      |
| http://fontvir.us   |
| http://hexarray.nu  | 
| http://xero.owns.us |
`---------------------'  



---------- Forwarded message ----------
From: aboteler <aboteler at harris.com>
To: papervision3D at osflash.org
Date: Tue, 4 Aug 2009 10:05:47 -0700 (PDT)
Subject: [Papervision3D] How to capture events from a MXLM component in a
MovieMaterial?

Hello,

I have a 3D virtual world containing 50+ objects where each has a separate
instantiation of an MXML Canvas component attached to a MovieMaterial
painted on the objects front face. The component has a button, slider,
checkbox, and a radio button. Also in that MXML file I specify an event
handler for when a click happens.

Unfortunately, the event handler is never called. I need help with
understanding the eventing flow in this case and how to fix it.  I believe
it has to do with the event going to PV3D and then somehow needs to flow to
the particular instantiation.

Thanks,

Aaron

FYI,

Here's the MXML class
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"
       width="200" height="200" backgroundColor="#FFEA00">

       <mx:VBox>
               <mx:Button id="btn" label="button" width="80" />
               <mx:HSlider width="230" />
       <mx:CheckBox label="Checkbox" />
       <mx:RadioButton label="Radio" />
       </mx:VBox>
   <mx:Script>
   <![CDATA[
   public function youClicked(evt : MouseEvent) : void
   {
       trace("mouse button clicked");
   }
   ]]>
   </mx:Script>
</mx:Canvas>

And, here's the section of code that adds it to the stage and cube:

var material:MovieMaterial;
material = new MovieMaterial(new MXMLNode(),false,true,true);
material.smooth = true;
material.interactive = true;
material.allowAutoResize = false;

// Material list with MovieMaterial used on the front, the rest being flat
shaded
var colorMaterial:MaterialObject3D = new ColorMaterial(0x02AABB);
colorMaterial.interactive = true;

var materialList:MaterialsList = new
MaterialsList({"all":colorMaterial,"front":material});

// create a new interactive projector
var projector:ProjectorCube = new ProjectorCube(id,materialList, NODE_WIDTH,
NODE_DEPTH, NODE_HEIGHT);
projector.addEventListener(InteractiveScene3DEvent.OBJECT_DOUBLE_CLICK,
onMouseDoubleClickOnObject);
projector.addEventListener(InteractiveScene3DEvent.OBJECT_OVER,
onMouseOverObject);
projector.addEventListener(InteractiveScene3DEvent.OBJECT_OUT,
onMouseOutObject);

// add it to the display list
node.visible=false;
this.addChild(node);

// add the projector to the scene, being part of the object group
scene.addChild(projector);
--
View this message in context:
http://www.nabble.com/How-to-capture-events-from-a-MXLM-component-in-a-Movie
Material--tp24812045p24812045.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

 


-- 
This message has been scanned for viruses and 
dangerous content by  <http://www.mailscanner.info/> MailScanner, and is 
believed to be clean. 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20090804/8eb40239/attachment.html>


More information about the Papervision3D mailing list