ParallelGraphics Forums
Cortona VRML Client
You are here: [Forums]::[Browsers]::[Cortona VRML Client]

Registration 
Registration
Forgot your password?

Help 
Help
Support

Quick search 

Subscribe to newsletters 

Install Cortona VRML Client for FREE!
Outline 3D
Try RobinZone!
email:  password:
   Browsers - Cortona VRML Client

Subject: Re: TouchSensor and isOver problem
Sender: hanci 11.03.08 08:29
Yes you are. That's ok with isOver event:

#VRML V2.0 utf8
DEF main_TS TouchSensor {}
Shape {
    geometry Cone {}
}
DEF main_SCR Script {
    eventIn SFBool go
    url "javascript:
    function go(val){
    trace(val);
    }
    "
}
ROUTE main_TS.isOver TO main_SCR.go

Thank you for your help! Now I see that the problem wasn't in isOver but in using Panel{} (an extension). I solved it with the ZGroup node. Thank you indeed for your help. (I haven't had a clue about such a useful function as a trace.)

#VRML V2.0 utf8
DEF main_TS TouchSensor {}
Shape {
geometry Cone {}
}
DEF HELP Switch {
whichChoice -1
choice [
Group { children [ DEF Z ZGroup {children []}]}
]
}

DEF main_SCR Script {
eventIn SFBool go
eventOut SFInt32 value_changed
eventOut MFNode remove
eventOut MFNode children
field MFNode temp Panel { sticky TRUE    source HTMLText {    body "<font face='tahoma' color='#0000aa' size='4'><b>Info</b></font>" } }

url "javascript:
function go(val){
//trace(val);
if (val) {value_changed =0; children = temp;}
else {value_changed = -1; remove = temp;}
}
"
}

ROUTE main_TS.isOver TO main_SCR.go
ROUTE main_SCR.value_changed TO HELP.whichChoice
ROUTE main_SCR.remove TO Z.removeChildren
ROUTE main_SCR.children TO Z.addChildren

 


TouchSensor and isOver problem / hanci / 7.03.08 20:48
     Re: TouchSensor and isOver problem / Uh / 11.03.08 00:42
         Re: TouchSensor and isOver problem / hanci / 11.03.08 08:29

Messages in thread: 3


© 1998-2007 ParallelGraphics. All rights reserved. Terms of use.