3 Replies Latest reply on Jun 2, 2008 3:28 PM by Newsgroup_User

    Error on eject DVD

    John Twycross Level 1
      I am making a DVDROM in Director 11. When the DVD is ejected from the PC while the projector is still running a dialogue box opens repeatedly requesting the DVD be put back in. Any ideas how to stop this?
        • 1. Re: Error on eject DVD
          Level 7
          Yes - don't eject a disc that's currently in use!
          Seriously, it sounds like your projector is trying to access data on the
          disc - which is no longer available. What would you expect to happen?
          • 2. Re: Error on eject DVD
            John Twycross Level 1
            Nice simple solution, thanks, maybe I should supply a roll of gaffer tape with the DVD so that the user can tape the DVD drive shut.

            Seriously...
            Yes the projector is accesing data from the DVD. I would expect this to cause an error.

            What I had hoped for was a way of handling the event to close the software without entering an infite loop of requests for the user to replace the DVD.
            • 3. Re: Error on eject DVD
              Level 7
              > What I had hoped for was a way of handling the event to close the software
              > without entering an infite loop of requests for the user to replace the DVD.

              Depending on whether it's a Director-generated error or an OS-generated
              error (I would expect the latter, unfortunately, in which case there's
              nothing I'm aware of that you can do about it) you might try using the
              alertHook to suppress any errors (not recommended unless you're sure
              you've debugged thoroughly) (the following from James Newton, IIRC):
              -- parent script "error.suppress.class"
              on alertHook(me, anErrorType, aMessage, aGenerator) -------------------
              -- INPUT: <anErrorType> will be one of four strings:
              -- "Script runtime error"
              -- "Script syntax error"
              -- "File error"
              -- "File read error"
              -- <aMessage> will be a string such as "Handler not defined"
              -- <aGenerator> may be #alert or #script (D8.0 and later)
              -- OUTPUT: This handler should return an integer:
              -- 0, any non-integer value:
              -- authortime - Cancel/OK dialog (both buttons have the
              -- same effect), halts movie and opens Script
              -- window*
              -- runtime - Cancel/OK dialog (both buttons have the
              -- same effect), ignores errors and continues
              -- if possible
              -- Any non-zero integer:
              -- authortime - no dialog, halts movie and opens Script
              -- window*
              -- runtime - no dialog, ignores error and continues if
              -- possible
              --
              -- * Errors in do() commands or in the primary event handlers, such
              -- as the mouseDownScript will not result in the Script window
              -- opening if the error occurred in a string rather than in a script.
              --
              -- * alert() commands are considered to be error messages and
              -- are intercepted by the alertHook script. If the return value
              -- of the alertHook handler is not 0, no alerts will appear.
              -- Authortime use of alert() commands will not halt the movie even
              -- if the command is intercepted by the alertHook script.
              --
              -- * alert() commands used inside the alertHook() handler do not
              -- cause recursion.
              --
              -- * The MUI xtra's alert() function does not get intercepted, but
              -- it cannot be used in Shockwave.
              --
              -- * In Shockwave or a Projector, the alertHook() will give more
              -- information than the standard Director Player Error, but
              -- script member references will not be given.
              --------------------------------------------------------------------

              return 1
              end

              And you invoke it or set it up to intercept errors by the following:
              -- #movie script:
              on prepareMovie
              _player.alertHook = script("error.suppress.class")
              end