>Anyone know how to (or if its possible) to share properties between multiple
>behaviors on the same sprite? Just declaring the same properties in the
>scripts doesnt seem to work.
>
>Any ideas of "cleaner" ways of doing this?!?!

Sure. Create a parent script with the properties and create an instance, 
then refer to the properties in that instance. Off the top of my head:

global pPropertiesHolder

on startMovie
   pPropertiesHolder = script("propScript").new()
end

-------- script propScript
property pX
property pY

on new me, x, y
   pX = x
   pY = y
   return me
end

Then in your sprite scripts, declare the global  pPropertiesHolder, and 
refer to the properties as pPropertiesHolder.pX and pPropertiesHolder.pY.

I would argue for an accessor method, but that's a different topic.


Cordially,

Kerry Thompson


[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