"Mark R. Jonkman" wrote:

<valuable insight into 'me' deleted>

> Normally, one would declare the spriteNum property as a property to the
> behaviour and thus make it accessible without the need to include the me
> reference.
> 
> ie.
> 
> property spriteNum
> 
> on mouseUp me
>         set the foreColor of sprite(spriteNum) = 156
> end mouseUp

This works for behaviours that are dropped on sprites during authoring,
because the act of dropping the behaviour on the sprite tells it where
it is. 

If, on the other hand, you are assigning the behaviours at run time with
a statement like:

 add(sprite(x),scriptinstancelist, new(script "TheBehaviourInQuestion"))

The instance of the behaviour will have no idea what its spriteNum is,
it'll have to be told explicitly. For example, add the behaviour to the
sprite with:

 add(sprite(x),scriptinstancelist, new(script "TheBehaviourInQuestion",x))

and in the behaviour have:

property spriteNum

on new me, passedSpriteNum
  spriteNum = passedSpriteNum
  return me
end


<more valuable 'me' info deleted>
-- 
Carl West    [EMAIL PROTECTED]
617.262.8830 x246    

I have no superfluous leisure; my stay must be
stolen out of other affairs; but I will attend you awhile.

           - Isabella, Measure for Measure, Act 3 Scene 1

[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