re : accessing MFNode of another node 
Author Message
 re : accessing MFNode of another node

Hi,

I wish to access individual nodes contained in the MFNode eventOut. The
following code segments illustrate what I mean:

PROTO MyNode [
  ...
  eventOut MFNode myMFNode
]{ ... }

DEF node1 MyNode {
  ...

Quote:
}

Script {
  field SFNode node1 USE node1
  url "node1.class"

Quote:
}

------------ in node1.java ------------
...
public void processEvent(Event e) {
  SFNode temp = (SFNode) getField("node1");

  // ========> how do I get a reference to node1's myMFNode?

Quote:
}

I tried the following but it hangs there without proceeding on to
the next statement.

ConstMFNode temp2 =
  (ConstMFNode) ((Node) temp.getValue()).getEventOut("myMFNode");

Node nodes[] = null;
temp2.getValue(nodes);   // hangs here

thanx,
yong bing



Sat, 21 Jul 2001 03:00:00 GMT  
 re : accessing MFNode of another node
Hi again ...

Found the problem.

Quote:
> Node nodes[] = null;

                 ^^^^

should be

Node nodes[] = new Node[ ... array size ... ];

---
yong bing



Sat, 21 Jul 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Node array into an MFNode

2. Script node problem : MFNode.get1Value()

3. Accessing attribute nodes in SubVi's?

4. Accessing geometry node?

5. Accessing nodes after scene creation?HELP!

6. Accessing EAI nodes

7. EAI:Accessing child nodes

8. Problem accessing eventIns of nodes made with createVrmlFromString?

9. accessing a Box node with EAI

10. Accessing sub nodes after their dynamic creation in Java and EAI

11. Accessing Node fields from java

12. A quick question about accessing children nodes

 

 
Powered by phpBB® Forum Software