Hi,

I'm stuck in a loop and not sure what the problem is. I have code that is called from a button press and drag over and in this code is a loop with a counter. I am trying to get it to loop 3 times then exit the loop but so far it seems the counter is not working. At the start, the count variable is set to one but in the output window in testing, output shows count=1 a few hundred times until it reaches the end of the scroll then it outputs "= " and it equals nothing at all. On screen, clicking once on the button that calls this loop makes it scroll continuously until it reaches the end. But, it's only supposed to scroll 3 increments (hence the loop) and then stop unless the user is still pressing the scroll arrow.

So the variable is set to 1 but then it never changes. So my count is not working?

It looks like a straight forward loop to me. But I'm new so what do I know. =)

The code being called is:

Play
Set Variable: "count" = 1
Trace ("count="&count)
Loop While (count <= 3)
Trace ("count="&count)
Begin Tell Target ("/mc1/mc2/mc3")
Go to Next Frame
End Tell Target
Begin Tell Target ("/mca/mcb")
Go to Previous Frame
End Tell Target
Set Variable: count = count + 1
Trace ("count="&count)
End Loop

Thanks,
J