ParallelGraphics Forums
General
You are here: [Forums]::[General]

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:
  General

Subject: Dynamically change script node's url field
Sender: dan.vera@gmail.com 12.03.08 03:01

Hello,

I am trying to dynamically change the the "url" exposefield of a VRML script node, but it does not work. Could anyone tell me if this a limitation of VRML, or if it is a bug of the cortona browser. Many thanks

Here is the code that does not work; I narrowed the problem down to its simplest form:


The script node of which i want to dynamically set the url looks like this:

----------------------------------------------
DEF my_script Script {
eventIn SFFloat my_float
}
----------------------------------------------


A file called test_js.js located in c: contains the following code:

----------------------------------------------
javascript:
function my_float (val) {
print(val);
}
----------------------------------------------


The code i use to test the whole things defines two spheres with touch_sensors that are routed to the following script:

---------------------------------------------

DEF script Script {
field SFNode my_script USE my_script
    eventIn    SFTime event1
eventIn    SFTime event2

    directOutput TRUE
    url "javascript:

function event1 (){
my_script.url = new MFString('C:/test_js.js') ;
}

function event2 (){
my_script.my_float = 10;
}

"}    
-------------------------------------------------

 


Dynamically change script node's url field / dan.vera@gmail.com / 12.03.08 03:01
     Re: Dynamically change script node's url field / Uh / 13.03.08 23:03
         Re: Dynamically change script node's url field / dan.vera@gmail.com / 14.03.08 00:15

Messages in thread: 3


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