This just came up again yesterday, and I said, "We have had 
discussions in the past here on Lingo-L about this.  Many people 
commented that they felt that it is OK to get the value of such a 
property, but it is not OK to set such a value.  Again, I am strongly 
of the opinion that if you want to get the value of a property of an 
object [or in you case, a behavior], you should have an "accessor" 
method to do so. "

For more information about accessor methods, check out:

   http://www.furrypants.com/loope   (specifically chapter 4)


If, as you say, you already have behaviors that link themselves 
dynamically to your objects, as part of the "linking" mechanism, they 
could pass either their sprite number or a reference to themselves 
(me).  The receiving object can then store away this reference in a 
property variable, and use it again when it wants to communicate with 
the behavior.  If you pass a sprite number, then you can communicate 
back to the behavior using sendSprite.  If you pass a behavior 
reference, then you can communicate back to that behavior using 
"call", or a standard object/method pair: 
mGetSomeData.pReferenceToAppropriateBehaviorSentInEarlier.

Hope this helps,

Irv

At 4:12 PM +0200 6/29/01, faisal moro wrote:
>Hi all,
>i have a moral doubt here.
>I'm working on a project that i fully developed with objects.
>So, they act beetween themselves, everything works fine.
>But - of course - these objects must give some visual feedback of 
>their work on the screen, so i linked to them their relative sprites.
>Now, here's the question, as i consider sprites as objects 
>projections and not as objects themselves (they even link themselves 
>to the object dynamically), is it legal to access their properties 
>directly from the object or should i build some handlers to return 
>needed data?
>

-- 

Lingo / Director / Shockwave development for all occasions. 
          
   (Home-made Lingo cooked up fresh every day just for you.)

[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