Hans,
I am afraid that I do not quite follow all of this. You refer to a
Slide, a SoundOut, and an Inline, and I do not know how they all
interrelate (in particular, I do not recall the complication of a
SoundOut in your first post). At this point I would need you to draw
out a very clear diagram of your Procedure structure, along with
clear specifications of what you want it to do.
That said, first, you do not understand your code correctly. As
written, it means the color of the image, which was clicked, changes
to "cyan" and would later change to "black" at whatever time your
hitObject gets redrawn, and goodness knows when that will happen. If
you want your inline code to make the BorderColor black, then you
must also follow that line with another hitObject.Draw command, which
is missing from your code without comment. If you left that out on
purpose (e.g., because the redraw will be taken care of by a later
object), then you must add a comment to your code to explain that.
As far as settting the Sleep time to something like "remaining time
of SoundOut", I suppose you might use some combination of Clock.Read,
SoundOut.TargetOffsetTime, and GetNextTargetOnsetTime, but I think
that a sloppy way to do things. I would generally rather let the
SoundOut handle the timing, and then follow that with more inline
code to do whatever needs doing. Again, we need a better look at
your Procedure structure, you may need to revise it.
As a general strategy, I prefer to do as much as possible through the
program structure & object properties, and to leave less to inline code.
Regards,
-- David McFarlane