lingo-l passing variables from behavior to behavior

2001-06-22 Thread Michael Nadel
Whenever I pass a command from one behavior to another with a variable, the variable turns up all messed up! For example, when I write in a behavior on sprite 3: sendSprite(3, #checkRight, 15) And then on another behavior on sprite 3 I write: on checkRight whatNumber put whatNumber end

Re: lingo-l passing variables from behavior to behavior

2001-06-22 Thread Jakob Hede Madsen
At 13:48 +0200 2001_06_22, Michael Nadel wrote: Whenever I pass a command from one behavior to another with a variable, the variable turns up all messed up! For example, when I write in a behavior on sprite 3: sendSprite(3, #checkRight, 15) And then on another behavior on sprite 3 I write: on

Re: lingo-l passing variables from behavior to behavior

2001-06-22 Thread Pete Carss
try putting me into the behaviour: on checkRight me, whatNumber put whatNumber end On Friday, June 22, 2001, at 12:48 PM, Michael Nadel wrote: Whenever I pass a command from one behavior to another with a variable, the variable turns up all messed up! For example, when I write in a

Re: lingo-l passing variables from behavior to behavior

2001-06-22 Thread Clint Little
When using behaviors you need to remember that the object reference always gets passed as the first parameter. In other words: on foo me me.foo2(test) end on foo2 put param(1) -- you'll get something like you did below put param(2) -- you'll get test end HTH, -- Clint At 01:48 PM 6/22/01

Re: lingo-l passing variables from behavior to behavior

2001-06-22 Thread Irv Kalb
Others have already pointed out the need for the me variable. But I'll add something else. If you have a behavior where to want to send something to the same sprite number, instead of hard coding the sprite number, use the built in spriteNum variable. For example, instead of:

Re: lingo-l passing variables from behavior to behavior

2001-06-22 Thread Pete Carss
Correct me if I'm wrong - I mean this - CORRECT me if I'm wrong - but in the case below wouldn't spriteNum hold a reference to the sprite that the behaviour was attached to - and in effect, the behaviour would be sending the message to itself? Pete On Friday, June 22, 2001, at 03:57 PM, Irv

Re: lingo-l passing variables from behavior to behavior

2001-06-22 Thread Irv Kalb
OK, I'll have to I'll have to correct you. In the original posting, the question was about having two behaviors attached to the same sprite and how to send a message from one behavior to the other behavior. If you do what I suggest, by using spriteNum instead of hard-coding the number, the

Re: lingo-l passing variables from behavior to behavior

2001-06-22 Thread Pete Carss
Spot on - now I understand Cheers On Friday, June 22, 2001, at 05:30 PM, Irv Kalb wrote: OK, I'll have to I'll have to correct you. In the original posting, the question was about having two behaviors attached to the same sprite and how to send a message from one behavior to the other

Re: lingo-l passing variables from behavior to behavior

2001-06-22 Thread Kerry Thompson
sendSprite(3, #checkRight, 15) And then on another behavior on sprite 3 I write: on checkRight whatNumber put whatNumber end This is what I get in the message window! -- offspring findSound 4 125c4b8 Change your handler to: on checkRight me whatNumber Think about it--you're sending

Re: lingo-l passing variables from behavior to behavior

2001-06-22 Thread Carl West
Michael Nadel wrote: Whenever I pass a command from one behavior to another with a variable, the variable turns up all messed up! For example, when I write in a behavior on sprite 3: sendSprite(3, #checkRight, 15) And then on another behavior on sprite 3 I write: on checkRight

Re: lingo-l passing variables from behavior to behavior

2001-06-22 Thread Carl West
Irv Kalb wrote: Others have already pointed out the need for the me variable. But I'll add something else. If you have a behavior where to want to send something to the same sprite number, instead of hard coding the sprite number, use the built in spriteNum variable. For example,

Re: lingo-l passing variables from behavior to behavior

2001-06-22 Thread Irv Kalb
At 3:25 PM -0400 6/22/01, Carl West wrote: Irv Kalb wrote: Others have already pointed out the need for the me variable. But I'll add something else. If you have a behavior where to want to send something to the same sprite number, instead of hard coding the sprite number, use the