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 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, instead of:
>
>  sendSprite(3, #checkRight, 15)
>
> use
>
>   sendSprite(spriteNum, #checkRight, 15)
>
> And be sure to declare "property spriteNum" as the top of the script. 
> This makes the behavior much more general.  You could use it in any 
> channel, and it will continue to work if you move your sprite from 
> channel 3 to some other channel.
>
> Irv

[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