> 
> I don't understand the role that "me" plays in a behavior argument list,
> could someone please explain it to me?
> 

me is just a variable naming convention in lingo, you can name it 'you',
'them', 'us' or anything else you like. The significance of this variable
(whatever you like to name it) is that it is a memory address where your
behavior instance lives in RAM. Any property variables that you may have
associated with your behavior is accessed through this memory location and
will be unique to that one particular instance of that behavior. This
becomes even more significant when you start to delve into Directors version
of OOP (Parent Scripts and Child Objects).

In any case you can instance each behavior/script or parent script several
times and although the script is identical in each case it will have its own
memory address in RAM. The example below will illustrate this with a
behavior.

------------------------

property pWhatAmI

on beginSprite me
  
  pWhatAmI = sprite(me.spriteNum).member.type
  
end beginSprite

on mouseUp me
  
  put pWhatAmI
  
end mouseUp

------------------------

Attach this same behavior to say a Bitmap sprite and a Text sprite. Run your
movie and start clicking on the sprites. You will notice in the message
window that when you click on the Bitmap sprite it will display #bitmap and
when you click on the Text sprite it will display #text. The 'me' variable
is keeping track of which instance of the behavior script is being used and
therefore returns the correct content contained in the property variable
pWhatAmI. 

This is a fairly generalized overview of what is going on with the 'me'
variable in a behavior.

For more information may I suggest Irv Kalb's online reference:

http://www.furrypants.com/loope/

or Peter Small's book "Lingo Sorcery"

ck


[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