>Yes. However, by doing this, the user is not fully exploiting the power of
>Director.
So? I don't use the full power of my word processor or spread sheet,
either--I seldom write macros, but they're still fine tools.
>With regard to the script you provided:
>
>timeOut("bideAWee").new(5000, #goNext)
>
>on goNext
> go to "nextPage"
>end
>
>
>1. The targetObject identifies the name of the child object that
>contains the #timeoutHandler. So #goNext is a child object?
No, it's just a handler--a callback, programmers say. I admit, callbacks
had me confounded when I first ran into them, until I discovered I was
trying to make them more complicated than they are.
A callback is simply a handler that you tell somebody else to "call back."
In this case, you're telling the timeOut object to call the goNext handler
every 5 seconds--that's all.
> Where is the parent � is it �bideAWee�? I am not sure.
A timeOut object doesn't need a parent script--it's sort of built into
Director. You can call it anything you want--it's just a name. You can use
that name later to refer to the timeOut object you created.
>2. By calling for a child object, this #timeoutHandler is placed in
>a sprite script as a behavior?
In the instance I gave, the handler is in a movie script. You can put it in
a behavior, an object, wherever you want. It's a bit simpler in a movie
script because that's the default. If you have it someplace else, you have
to tell Director where it is. Again, look at the examples in the Lingo
Dictionary under "New."
>3. When a timeout object is created, it enables its targetObject to
>receive the system events prepareMovie, startMovie, stopMovie,
>prepareFrame and exitFrame.
>I think you used something similar to an �exitFrame� script in the above
>example?
It's really a substitute for an exitFrame script. It's something you can
depend on happening after a specific number of milliseconds. You don't have
that control with frame events--on slower machines, it's quite likely you
won't get the tempo you ask for. Remember, the tempo is really just a
maximum speed--it's no guarantee you will get that tempo.
>4. �If you don�t tell Director to stop the timeOut object, it will keep
>calling the goNext handler every 5 seconds.� I still do not understand
>how you use �forget� to stop the timer.
In the example above, like this:
on goNext
go to "nextPage"
timeOut("bideAWee").forget()
end
If you don't stop your timeOut object, it will keep running and calling its
target (callback) script over and over.
>I apologize if I have incurred your wrath but I really appreciate your help.
Ah, I'm not such an ogre, really--you'll know when/if you make me mad. Just
grumpy sometimes, but at least my cats like me. When you're 64 (octal),
you've earned the right to be a curmudgeon.
Cordially,
Kerry Thompson
[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!]