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 +0200, you 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 whatNumber
>     put whatNumber
>end
>
>This is what I get in the message window!
>
>-- <offspring "findSound" 4 125c4b8>
>
>All I want is the number 15, not this weird line. Can someone tell me what I
>am doing wrong please?
>How do I pass a variable from behavior to behavior?
>
>Thanks,
>
>Michael Nadel
>[EMAIL PROTECTED]
>Mediart - Multimedia as an Art Form
>
>
>
>
>
>
>
>
>
>
>[To remove yourself from this list, or to change to digest mode, go to
>http://www.penworks.com/LUJ/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/LUJ/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!]

Reply via email to