Hi Luke,

The funny thing is I'm sure this is the first thing I tried and it
didn't work but now it's fine. Maybe I should try the first thing last
in the future.

But yes I do think it's a bit of an oversight that Macromedia used the
same name. This list is always a good place to hear people emphasise the
use of well-named handlers, objects and globals, and this is one of
those times, I think.

Thanks also to Kerry for your thoughts.

Jon

> Hi John,
> 
> I regularly use timeout objects for regular repeating calls, and
> timeoutScripts to handle lack of user interaction. As far as 
> I can tell,
> timeout objects coexist happily with timeoutscripts - but only if you
> specify the timeoutscript and not use on the "on timeout" handler.
> 
> I've never used the "on timeout" handler in a movie -I've 
> always preferred
> to manually set the timeout handler's name via the timeoutscript (I've
> always assumed  that "on timeout" was merely the default 
> handler name).
> 
> I just did a quick test (deleted the 'set timeOutScript 
> line', and created
> an 'on timeout' handler in a movie script), and got the same 
> error as you
> did. 
> 
> Conclusion? Not specifying the timeoutScript and relying on 
> 'on timeout'
> will generate error, probably because Director sees the
> "timeout("name").new()" line and assumes that 'timeout' is 
> referring to the
> handler of the same name (perhaps using the same name was an 
> over-sight on
> Macromedia's behalf)
> 
> Solution? Set the timeoutscript and do not use "on timeout". 
> For example,
> this code works: 
> 
> -- Parent Script
> 
> on new me
>   timeout("focusTracker").new(1000, #mTrackfocus, me)
>   the timeOutScript = "GeneraltimeOutHandler"
>   the timeoutLength = 60
>   return me
> end
> 
> on mDestroy me
>   timeout("focusTracker").forget()
> end
> 
> on mTrackfocus me
>   put "mTrackfocus"
> --  
> end
> 
> -- Movie Script 
> 
> global gFocusMgr
> 
> on startMovie
>   gFocusMgr = script("FocusMgr").new()
> end
> 
> on stopMovie
>   gFocusMgr.mDestroy()
> end
> 
> on GeneraltimeOutHandler
>   put "GeneraltimeOutHandler"
> end
> 
> --on timeout  <------- must not have this handler in a movie script
> --  put "Time out"
> --end

[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