field and exposedField in PROTO's 
Author Message
 field and exposedField in PROTO's

Hi,

I created some PROTO a few months ago when i was learning vrml. But then, i
didn't see the point of using exposedField in my PROTO's.
Creating my EAI, i realized that i do need to declare them exposedField so i
can simply getEventOut("position_changed");

But when i changed my field into exposedField, (in my Protofile and
EXTERNPROTO definition), Cosmoplayer gives an error like:

"EXTERNPROTO field \'positie\' improperly type matched"

I just found out if i change it only in my EXTERNPROTO definition, i don't
get an error. Can i use the eventOut then ?

Thanks 2 all of you,

Gerry



Fri, 01 Nov 2002 03:00:00 GMT  
 field and exposedField in PROTO's
Hi,

Me again.:)

It doesn't seem like a problem for my proto, but for my script. All fields
of my PROTO which are not used in my script, get no error.

e.g.

PROTO VBox
[
    exposedField position 0 0 0
]
{
    DEF Tr   Transform
    {
        translation IS position
        Shape
        {
            geometry Box {}
        }
    }

    DEF script1 Script
    {
        field SFVec3f pos IS position
        url "javascript:  ........"
    }

Quote:
}

NOTE: This script isn't the real script.

I get a type mismatch (or something like that). When i use exposedField
SFVec3f .... , it says expected end of file at line "where exposedField is".

Do I have to handle it with eventIn's then ? If i do, how can i do it then ?

Thanks

Gerry

Quote:

>Hi,

>I created some PROTO a few months ago when i was learning vrml. But then, i
>didn't see the point of using exposedField in my PROTO's.
>Creating my EAI, i realized that i do need to declare them exposedField so
i
>can simply getEventOut("position_changed");

>But when i changed my field into exposedField, (in my Protofile and
>EXTERNPROTO definition), Cosmoplayer gives an error like:

>"EXTERNPROTO field \'positie\' improperly type matched"

>I just found out if i change it only in my EXTERNPROTO definition, i don't
>get an error. Can i use the eventOut then ?

>Thanks 2 all of you,

>Gerry



Fri, 01 Nov 2002 03:00:00 GMT  
 field and exposedField in PROTO's
it is because you are trying to IS map an exposedField to a script nodes
field, which is NOT exposed. to do this you have to use a plain field, and
define your own set_ and _changed events. script nodes fields are NOT
exposed.


Quote:
> Hi,

> Me again.:)

> It doesn't seem like a problem for my proto, but for my script. All fields
> of my PROTO which are not used in my script, get no error.

> e.g.

> PROTO VBox
> [
>     exposedField position 0 0 0
> ]
> {
>     DEF Tr   Transform
>     {
>         translation IS position
>         Shape
>         {
>             geometry Box {}
>         }
>     }

>     DEF script1 Script
>     {
>         field SFVec3f pos IS position
>         url "javascript:  ........"
>     }
> }

> NOTE: This script isn't the real script.

> I get a type mismatch (or something like that). When i use exposedField
> SFVec3f .... , it says expected end of file at line "where exposedField
is".

> Do I have to handle it with eventIn's then ? If i do, how can i do it then
?

> Thanks

> Gerry


> >Hi,

> >I created some PROTO a few months ago when i was learning vrml. But then,
i
> >didn't see the point of using exposedField in my PROTO's.
> >Creating my EAI, i realized that i do need to declare them exposedField
so
> i
> >can simply getEventOut("position_changed");

> >But when i changed my field into exposedField, (in my Protofile and
> >EXTERNPROTO definition), Cosmoplayer gives an error like:

> >"EXTERNPROTO field \'positie\' improperly type matched"

> >I just found out if i change it only in my EXTERNPROTO definition, i
don't
> >get an error. Can i use the eventOut then ?

> >Thanks 2 all of you,

> >Gerry



Sun, 03 Nov 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. mapping exposedField in a PROTO to a field in a script

2. exposedFields in PROTO

3. PROTO appearance exposedField default value

4. EAI:Manipulating proto'd fields

5. Do event into exposedFields change the field itself?

6. Of fields, exposedFields, PROTOs, and Scripts

7. how can i force an instance of a PROTO to provide a field value

8. routing a PROTO field

9. PROTO: changing the coordIndex field of a IndexedLineSet

10. reusing field, not node, with PROTO?

11. Q: PROTO MFNode fields in CosmoPlayer 1.0.1 PC

12. ROUTE to PROTO fields?

 

 
Powered by phpBB® Forum Software