>Is there any difference between
>
>on beginSprite me
>
>and on new me?

They are similar, but not the same.

You can use either or both in a behavior. The behavior will get the "new" 
message first, then the "beginSprite" message. So, both will execute if you 
have both.

If you are using the script as an ancestor script in OOP programming, it 
may or may not get the beginSprite message. You usually declare an ancestor 
like this:

property ancestor

on beginSprite me -- could be "on new" also
   ancestor = new (script, "mSomeAncestor")
end

Then in the parent script mSomeAncestor, you would have these handlers:

on new me
   return me
end

on beginSprite me
   -- do some stuff
end

In this case the beginSprite handler in the ancestor would never be called, 
because it has been overridden by the beginSprite handler in the child object.

This is something that is handy in OOP. You can write a basic class, and 
then derive specialized subclasses from it by writing new handlers with the 
same name in the child script. It will override the ancestor's handler.

HTH


Cordially,

Kerry Thompson


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/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