I have declared "g3d" as a global variable - The full script is pasted below
for anyone who feels like looking........
I noticed in the debug window that the value for "me" is the script, and not
the sprite - I think this explains a lot - but I'm lost as how to fix it.
As director makes my 3d model on the fly - I attach the behaviour through my
main movie script using the scriptInstanceList.add command (this works fine
when I attach any other custom behaviour)
Here is the script
property porigin, spritenum, pskip, pTime, pfrequency
global g3d
On beginsprite me
Porigin = point(sprite(spritenum).left, sprite(spritenum).top)
Pskip = -1
Ptime = the milliseconds
Pfrequency = 100
End
On exitframe me
Curtime = the milliseconds
Deltatime = curtime - pTime
If deltatime >= pfrequency then
Finpoint = the mouseloc - porigin
test = sprite(10).camera(1).Modelunderloc(finpoint)
If test <> void then
If pskip <> test then
If pskip <> -1 then
Exitaction(me,pskip)
End if
EnterAction(me,test)
Pskip = test
End if
Else
if pskip <> -1 then
exitaction(me, pskip)
pskip = -1
end if
End if
PTime = the milliseconds
End if
End
On exitaction me, whichmodel
Case(whichmodel.name) of
"Ball1":
g3d.shader("ball").emissive = rgb(0,0,0)
"Ball2":
g3d.shader("ball").emissive = rgb(0,0,0)
"Ball3":
g3d.shader("ball").emissive = rgb(0,0,0)
"Ball4":
g3d.shader("ball").emissive = rgb(0,0,0)
"Ball5":
g3d.shader("ball").emissive = rgb(0,0,0)
"Ball6":
g3d.shader("ball").emissive = rgb(0,0,0)
"Ball7":
g3d.shader("ball").emissive = rgb(0,0,0)
"Ball8":
g3d.shader("ball").emissive = rgb(0,0,0)
"Ball9":
g3d.shader("ball").emissive = rgb(0,0,0)
"Ball10":
g3d.shader("ball").emissive = rgb(0,0,0)
end case
End
On enteraction me, whichmodel
Case(whichmodel.name) of
"Ball1":
g3d.shader("ball").emissive = rgb(127,127,127)
"Ball2":
g3d.shader("ball").emissive = rgb(127,127,127)
"Ball3":
g3d.shader("ball").emissive = rgb(127,127,127)
"Ball4":
g3d.shader("ball").emissive = rgb(127,127,127)
"Ball5":
g3d.shader("ball").emissive = rgb(127,127,127)
"Ball6":
g3d.shader("ball").emissive = rgb(127,127,127)
"Ball7":
g3d.shader("ball").emissive = rgb(127,127,127)
"Ball8":
g3d.shader("ball").emissive = rgb(127,127,127)
"Ball9":
g3d.shader("ball").emissive = rgb(127,127,127)
"Ball10":
g3d.shader("ball").emissive = rgb(127,127,127)
end case
End
----- Original Message -----
From: Colin Holgate <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, April 19, 2002 1:50 AM
Subject: Re: <lingo-l> What's going on?
> >"property not found #name"
> >at the following piece of code
> >
> >"On exitaction me, whichmodel
> >
> > Case(whichmodel.name) of
> > "Ball1":
> > g3d.shader("ball").emissive = rgb(0,0,0)"
> >
> >Could someone please explain what this means.......
> >Am I just being stupid?
>
>
> I'm surprised that Paul didn't say:
>
> on exitaction me,whichmodel
> case(whichmodel.name) of
> "ball1":
> whichmodel.shader.emissive = rgb(0,0,0)
>
> but that's an aside. The thing that is likely to wrong in your
> version is that you haven't said:
>
> global g3d
>
> somewhere in the script.
>
> [To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/lingo-l.cgi To post messages to the list, email
[EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is
for learning and helping with programming Lingo. Thanks!]
>
>
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/lingo-l.cgi To post messages to the list, email
[EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for
learning and helping with programming Lingo. Thanks!]