on 11/10/00 12:54 AM, Jon Rowe at [EMAIL PROTECTED] wrote:

> director is calling my global <on timeOut> handler which I'm using as a
> general timeout script for when the kiosk is inactive. Is this supposed
> to happen? I can't see why anyone would want it to happen, or am I just
> getting caught up in a destructive thought-loop. The new timeOut object
> method is unrelated to the old <on timeOut> handler, isn't it?
> 
> Hmmm, so how would I be able to have the 2 sorts of timeOut in one
> movie? Back to the drawing board... some kind of encapsulation I guess


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

------------------





-- 

Luke Wigley
Multimedia Director/Producer
Mecca Medialight Pty Ltd

Mecca Medialight:                       Medialight Sound Studio:
111 Moor Street                         1 Bakehouse Lane
Fitzroy, Vic. 3065                      North Fitzroy, Vic. 3068
Tel +613 9416 2033                      Tel +613 9416 2033
Fax +613 9416 2055                      Fax +613 9416 2055

www.medialight.com.au
__________________________________________________________________________



[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