handlerExists

  how to call a handler that may or may not exist w/o getting a script error
MIAW sendallsprites




  conditional handler execution

<quote>
We have a self updating projector that may have to execute code in a
MIAW after an update.  The caveat here is that I do not want a script
error to appear if that handler is not found in the miaw.  Does
anyone have an approach that might allow this functionality?
</quote>

This is not really tested but seems to work since d8.5, may be much longer.
sendallsprites() which have not been eaten by behaviors get passed to movie
scripts thereafter.

D9, win.


testMiaw.dir has a movieScript

on handlerExists
  put "this handler exists"
end


From the message window:

dWin= window("testMiaw")

tell dwin to sendallsprites(#handlerexists)
-- "this handler exists"

tell dwin to sendallsprites(#handlerexistsNot)

No script error, just nothing.


Home shock + cgi Bits 'n pieces Director Lingo Shocklets Contact