Click to See Complete Forum and Search --> : sequence of execution


sidkdbl07
07-04-2003, 10:47 PM
I have a problem that I can't wrap my head around:

I have a function pointAt( target ) that moves an image across the screen and points at a target layer

My problem is that sometimes the function gets called twice (or more) via (a href="#" onClick="pointAt( 'target1' );pointAt( 'target2')"></a>

How do I get the second instance to wait until the first call if finished before executing.

Ay ideas are appreciated!
dbl07

Khalid Ali
07-05-2003, 07:35 AM
Add this line of code at the end of the first function

pointAt( 'target2')

sidkdbl07
07-12-2003, 04:23 PM
If you'll notice, both functions are called the same thing - pointAt() - so I can't place pointAt('target2') at the end of the function.

I need some kind on control mechanism that sees if the first function is finished. If the the first one is finished, then the second call can start.

Do I set a global variable for this? ... or something else?

Any suggestions are welcome.
Sid