[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[www-vrml] [xVRML] exposedFields in Scripts and PROTOs, the real issue here
The real issue with PROTOs is not being able to use
exposedField in Scripts. This forces hacks like this :
#VRML V2.0 utf8
# more notes at bottom
PROTO A [
exposedField SFBool event FALSE
]
{
PROTO MyexposedFieldAccess [
exposedField SFBool event FALSE
]
{Group {}}
DEF Fields MyexposedFieldAccess {
event IS event
}
DEF Scr Script {
field SFNode fields USE Fields
eventIn SFBool event
field SFBool storedValue FALSE
directOutput TRUE
url "javascript:
function initialize () {
storedValue=fields.event;
}
function event (val,ts) {
// val = value from this event
storedValue=val;
}
"
}
ROUTE Fields.event TO Scr.event
}
Notice the use of MyexposedFieldAccess proto and instance
to access the exposedField. This can then be accessed using
directAccess or ROUTEs
Another more serious problem is added a SFNode to the
contents of a PROTO. As at the moment this can only be done
using a Script node ie:
group.children[0]=node;
__________________________________
Celebrate Yahoo!'s 10th Birthday!
Yahoo! Netrospective: 100 Moments of the Web
http://birthday.yahoo.com/netrospective/
-------------------------------------------------------------------------
for list subscription/unsubscription,
go to http://www.web3d.org/cgi-bin/public_list_signup/lwgate/listsavail.html