> Now that my movie has grown and slowed down, some of my sprites send
> messages to other sprites in the frame before the receiving
> sprite is fully
> initialized. So I see an error message saying that handler so and
> so is not
> found, or property such and such does not exist. If I send the
> same message
> a split second later, all is well.

If you are getting error messages it suggests you're using syntax like
sprite(x).myMethod() OR sprite(x).myProp = someValue OR
call(#handlerName, scriptObject, args)

If you use sendSprite or sendAllSprites you probably won't get error
messages, but nothing will happen, either.

The problem is (probably) that one sprite's beginSprite handler is trying to
do something to a sprite whose own beginSprite handler hasn't run yet. As
you say, the receiving sprite isn't fully initialised (beginSprite is sent
to the sprite in channel 1 first, then to channel 2 etc.)

Both James Newton and Brennan Young wrote some *excellent* articles along
these lines. Check out:
http://www.director-online.com/accessArticle.cfm?id=335
http://brennan.young.net/Edu/Lingvad.html

They both detail different approaches to setting up communication between
sprite's script instances. James' approach - swapping references via
sendAllSprites - is perhaps more robust long-term, but Brennan has some
really useful techniques too.

HTH,
-Sean.


[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