Jon Rowe <[EMAIL PROTECTED]>
> Why can't I initialise a timeout object in a new object handler?
> Here's my script (called from a startMovie handler):
>
> on new me
>   pSpeechList = [:]
>   pTimeOutSpeechList = []
>   pTimeOutMode = 0
>   interval =  timeOut("textTO").new(3000, #tPause ,me)
>   append the actorlist me
>   return me
> end
>
> this gives a script error: object expected.

Hi Jon,

I created a new D8 movie, placed your "on new me" handler in a Parent
Script in the cast member 1, and added the handler...

on tPause(me)
  put #tPause
end

I then created a Movie Script with the scriptText...

on startMovie
  script(1).new() -- The new instance is added to the actorList
end

I finally placed a sprite on the stage, to keep the movie alive, and ran
the movie.  I got no script error.

The Message window happily printed out...

-- #tPause
-- #tPause
-- #tPause

So it looks as if initialising a timeOut object in a new object handler
is indeed possible.  Is the script error occurring later, after this
script has been run?  You might like to watch the value of the
expression "the timeOutList" (without the quotes) in the Watcher window.

Cheers,

James




[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